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