start.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. ## Query Node Infrastructure
  20. # Initialize a new database for the query node infrastructure
  21. docker-compose up -d db
  22. # Override DB_HOST for db setup
  23. export DB_HOST=localhost
  24. # Make sure we use dev config for db migrations (prevents "Cannot create database..." and some other errors)
  25. yarn workspace query-node config:dev
  26. # Migrate the databases
  27. yarn workspace query-node-root db:prepare
  28. yarn workspace query-node-root db:migrate
  29. # Set DB_HOST back to docker-service one
  30. export DB_HOST=db
  31. # Start processor and graphql server
  32. docker-compose up -d processor-mnt
  33. docker-compose up -d graphql-server-mnt
  34. ## Storage Infrastructure
  35. docker-compose up -d colossus
  36. # # Create a new content directory lead
  37. # yarn workspace api-scripts initialize-content-lead
  38. # # Set sudo as the membership screening authority
  39. # yarn workspace api-scripts set-sudo-as-screening-auth
  40. docker-compose up -d pioneer
  41. echo "use Ctrl+C to shutdown the development network."
  42. while true; do
  43. read
  44. done