start.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env bash
  2. set -e
  3. # Run a complete joystream development network on your machine using docker
  4. export JOYSTREAM_NODE_TAG=${JOYSTREAM_NODE_TAG:=$(./scripts/runtime-code-shasum.sh)}
  5. INIT_CHAIN_SCENARIO=${INIT_CHAIN_SCENARIO:=setupNewChain}
  6. if [ "${PERSIST}" == true ]
  7. then
  8. echo "Services starting up.."
  9. else
  10. # Clean start!
  11. docker-compose down -v
  12. function down()
  13. {
  14. # Stop containers and clear volumes
  15. docker-compose down -v
  16. }
  17. trap down EXIT
  18. fi
  19. if [ "${SKIP_NODE}" != true ]
  20. then
  21. ## Run a local development chain
  22. docker-compose up -d joystream-node
  23. fi
  24. ## Query Node Infrastructure
  25. ./query-node/start.sh
  26. ## Orion
  27. docker-compose up -d orion
  28. ## Init the chain with some state
  29. if [[ $SKIP_CHAIN_SETUP != 'true' ]]; then
  30. set -a
  31. . ./.env
  32. set +a
  33. export SKIP_MOCK_CONTENT=true
  34. export SKIP_QUERY_NODE_CHECKS=true
  35. HOST_IP=$(tests/network-tests/get-host-ip.sh)
  36. export COLOSSUS_1_URL=${COLOSSUS_1_URL:="http://${HOST_IP}:3333"}
  37. export COLOSSUS_1_TRANSACTOR_KEY=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${COLOSSUS_1_TRANSACTOR_URI} --output-type json | jq .ss58Address -r)
  38. export DISTRIBUTOR_1_URL=${DISTRIBUTOR_1_URL:="http://${HOST_IP}:3334"}
  39. ./tests/integration-tests/run-test-scenario.sh ${INIT_CHAIN_SCENARIO}
  40. ## Member faucet
  41. export SCREENING_AUTHORITY_SEED=$(cat ./tests/integration-tests/output.json | jq -r .faucet.suri)
  42. export INVITING_MEMBER_ID=$(cat ./tests/integration-tests/output.json | jq -r .faucet.memberId)
  43. docker-compose up -d faucet
  44. ## Storage Infrastructure Nodes
  45. docker-compose up -d colossus-1
  46. docker-compose up -d distributor-1
  47. fi
  48. if [ "${PERSIST}" == true ]
  49. then
  50. echo "All services started in the background"
  51. else
  52. echo "use Ctrl+C to shutdown the development network."
  53. while true; do
  54. read
  55. done
  56. fi