start.sh 1.4 KB

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