start.sh 1.6 KB

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