start.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:=setup-new-chain}
  6. if [ "${PERSIST}" == true ]
  7. then
  8. echo "Services startup 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. ## Run a local development chain
  20. docker-compose up -d joystream-node
  21. ## Init the chain with some state
  22. export SKIP_MOCK_CONTENT=true
  23. HOST_IP=$(tests/network-tests/get-host-ip.sh)
  24. export COLOSSUS_1_URL=${COLOSSUS_1_URL:="http://${HOST_IP}:3333"}
  25. 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)
  26. export DISTRIBUTOR_1_URL=${DISTRIBUTOR_1_URL:="http://${HOST_IP}:3334"}
  27. ./tests/network-tests/run-test-scenario.sh ${INIT_CHAIN_SCENARIO}
  28. ## Set sudo as the membership screening authority
  29. yarn workspace api-scripts set-sudo-as-screening-auth
  30. ## Member faucet
  31. docker-compose up -d faucet
  32. ## Query Node Infrastructure
  33. ./query-node/start.sh
  34. ## Storage Infrastructure Nodes
  35. docker-compose up -d colossus-1
  36. docker-compose up -d distributor-1
  37. ## Pioneer UI
  38. docker-compose up -d pioneer
  39. ## Orion
  40. docker-compose up -d orion
  41. if [ "${PERSIST}" == true ]
  42. then
  43. echo "All services started in the background"
  44. else
  45. echo "use Ctrl+C to shutdown the development network."
  46. while true; do
  47. read
  48. done
  49. fi