start.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env bash
  2. set -e
  3. # Run a complete joystream development network on your machine using docker.
  4. # Make sure to run build-docker-images.sh prior to running this script to use
  5. # the local build.
  6. set -a
  7. . .env
  8. set +a
  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. ## Run a local development chain
  18. docker-compose up -d joystream-node
  19. WS_PROVIDER_ENDPOINT_URI=ws://localhost:9944 SKIP_MOCK_CONTENT=true \
  20. ./tests/network-tests/run-test-scenario.sh setup-new-chain
  21. ## Set sudo as the membership screening authority
  22. yarn workspace api-scripts set-sudo-as-screening-auth
  23. ## Query Node Infrastructure
  24. # Initialize a new database for the query node infrastructure
  25. docker-compose up -d db
  26. # Override DB_HOST for db setup
  27. # Make sure we use dev config for db migrations (prevents "Cannot create database..." and some other errors)
  28. export DB_HOST=localhost
  29. yarn workspace query-node config:dev
  30. # Migrate the databases
  31. yarn workspace query-node-root db:prepare
  32. yarn workspace query-node-root db:migrate
  33. # Set DB_HOST back to docker-service one
  34. export DB_HOST=db
  35. # Start processor and graphql server
  36. docker-compose up -d processor
  37. docker-compose up -d graphql-server
  38. ## Storage Infrastructure
  39. docker-compose up -d colossus-1
  40. docker-compose up -d distributor-1
  41. ## Pioneer UI
  42. docker-compose up -d pioneer
  43. echo "use Ctrl+C to shutdown the development network."
  44. while true; do
  45. read
  46. done