start.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env bash
  2. set -e
  3. # Run a complete joystream development network on your machine using docker.
  4. # TODO
  5. # - Check if docker is installed and prompt to install.
  6. # - Prompt user if they wish to rebuild before starting . default no, timeout if not prompted.
  7. # - Try to fetch a cached joystream/node image if one is found matching code shasum.
  8. # if ! docker inspect joystream/node:latest > /dev/null 2>&1;
  9. # then
  10. # echo "Didn't find a joystream/node:latest docker image."
  11. # exit 1
  12. # fi
  13. # Clean start!
  14. docker-compose down -v
  15. function down()
  16. {
  17. # Stop containers and clear volumes
  18. docker-compose down -v
  19. }
  20. trap down EXIT
  21. # Run a development joystream-node chain
  22. docker-compose up -d joystream-node
  23. ## Storage Infrastructure
  24. # Configure a dev storage node and start storage node
  25. DEBUG=joystream:storage-cli:dev yarn storage-cli dev-init
  26. docker-compose up -d colossus
  27. # Initialise the content directory with standard classes, schemas and initial entities
  28. yarn workspace cd-schemas initialize:dev
  29. ## Query Node Infrastructure
  30. # Initialize a new database for the query node infrastructure
  31. docker-compose up -d db
  32. yarn workspace query-node-root db:migrate
  33. # Startup all query-node infrastructure services
  34. docker-compose up -d processor
  35. echo "press Ctrl+C to shutdown"
  36. # Start a dev instance of pioneer and wait for exit
  37. docker-compose up pioneer