-
Notifications
You must be signed in to change notification settings - Fork 16
/
tutorial.sh
executable file
·46 lines (33 loc) · 1.48 KB
/
tutorial.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
vm=${1:-"wasm-vm"}
dune build || exit 1
dir=$(dirname $0)
source $dir/scripts/common.sh
export DEKU_TEZOS_RPC_NODE=${DEKU_TEZOS_RPC_NODE:-http://localhost:20000}
message "Using Tezos RPC Node: $DEKU_TEZOS_RPC_NODE"
export DEKU_VALIDATORS="tz1fpf9DffkGAnzT6UKMDoS4hZjNmoEKhGsK,tz1PYdVbnLwiqKo3fLFXTKxw6K7BhpddQPh8,tz1Pv4viWq7ye4R6cr9SKR3tXiZGvpK34SKi,tz1cXKCCxLwYCHDSrx9hfD5Qmbs4W8w2UKDw"
export DEKU_VALIDATOR_URIS="127.0.0.1:4440,127.0.0.1:4441,127.0.0.1:4442,127.0.0.1:4443"
export DEKU_TEZOS_SECRET="edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq"
export DEKU_TEZOS_CONSENSUS_ADDRESS="$(octez_client --endpoint $DEKU_TEZOS_RPC_NODE show known contract consensus | grep KT1 | tr -d '\r')"
export DEKU_API_PORT=8080
export DEKU_DEFAULT_BLOCK_SIZE=${DEKU_DEFAULT_BLOCK_SIZE:-10000}
for N in 0 1 2 3; do
source "./networks/flextesa/node_${N}_env"
mkdir -p ./chain/data/$N
# Creates the FIFO
test -p "./chain/data/$N/pipe_write" || mkfifo "./chain/data/$N/pipe_write"
test -p "./chain/data/$N/pipe_read" || mkfifo "./chain/data/$N/pipe_read"
# Starts the VM
node examples/tutorial/index.js "./chain/data/$N/pipe" &
sleep 0.4
# Starts the Node
_build/install/default/bin/deku-node \
--default-block-size=10000 \
--port "444$N" \
--database-uri "sqlite3:./chain/data/$N/database.db" \
--named-pipe-path "./chain/data/$N/pipe" \
--data-folder "./chain/data/$N" &
sleep 0.1
done
wait