start.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. set -e
  3. # Run a complete joystream development network on your machine using docker
  4. INIT_CHAIN_SCENARIO=${INIT_CHAIN_SCENARIO:=setup-new-chain}
  5. if [ "${PERSIST}" == true ]
  6. then
  7. echo "Services startup up.."
  8. else
  9. # Clean start!
  10. docker-compose down -v
  11. function down()
  12. {
  13. # Stop containers and clear volumes
  14. docker-compose down -v
  15. }
  16. trap down EXIT
  17. fi
  18. ## Run a local development chain
  19. docker-compose up -d joystream-node
  20. ## Init the chain with some state
  21. export SKIP_MOCK_CONTENT=true
  22. # TODO: Move back to this approach once Giza<->Olympia integration tests merged
  23. # HOST_IP=$(tests/network-tests/get-host-ip.sh)
  24. # export 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="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. ## Storage Infrastructure Configuration
  33. # TODO: Move back to INIT_CHAIN_SCENARIO approach once Giza<->Olympia integration tests merged
  34. ./storage-playground-config.sh
  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