-
Notifications
You must be signed in to change notification settings - Fork 115
/
start.sh
executable file
·77 lines (61 loc) · 1.95 KB
/
start.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
set -e
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd $SCRIPT_PATH
rm tests/network-tests/output.json || :
# Run a complete joystream development network on your machine using docker
JOYSTREAM_NODE_TAG=${JOYSTREAM_NODE_TAG}
if [[ "$JOYSTREAM_NODE_TAG" == "" ]]; then
export RUNTIME_PROFILE=${RUNTIME_PROFILE:=TESTING}
JOYSTREAM_NODE_TAG=`./scripts/runtime-code-shasum.sh`
fi
export JOYSTREAM_NODE_TAG=${JOYSTREAM_NODE_TAG}
INIT_CHAIN_SCENARIO=${INIT_CHAIN_SCENARIO:=setupNewChain}
echo "Creating Local Joystream Network"
if [ "${PERSIST}" == true ]
then
echo "Services will persist"
else
function down()
{
# Stop containers and clear volumes
docker compose -f ./docker-compose.storage-squid.yml down -v
docker compose down -v
}
trap down EXIT ERR SIGINT SIGTERM
fi
if [ "${SKIP_NODE}" != true ]
then
## Run a local development chain
docker compose up -d joystream-node
fi
## Query Node Infrastructure
./query-node/start.sh
## Orion
./start-orion.sh
## Storage Squid
docker compose -f ./docker-compose.storage-squid.yml up -d
## Init the chain with some state
if [[ $SKIP_CHAIN_SETUP != true ]]; then
export SKIP_QUERY_NODE_CHECKS=true
HOST_IP=`tests/network-tests/get-host-ip.sh`
export COLOSSUS_1_URL=${COLOSSUS_1_URL:="http://${HOST_IP}:3333"}
export DISTRIBUTOR_1_URL=${DISTRIBUTOR_1_URL:="http://${HOST_IP}:3334"}
./tests/network-tests/run-test-scenario.sh ${INIT_CHAIN_SCENARIO}
## Member faucet
export INVITER_KEY=`cat ./tests/network-tests/output.json | jq -r .faucet.suri`
docker compose up -d faucet
## Storage Infrastructure Nodes
docker compose up -d colossus-1
docker compose up -d distributor-1
fi
if [ "${PERSIST}" == true ]
then
echo "All services started in the background"
echo "Remember to run 'docker compose down -v' to kill all docker services before starting new playground."
else
echo "use Ctrl+C to shutdown the development network."
while true; do
read
done
fi