setup.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. set -e
  3. # If OS is supported will install build tools for rust and substrate.
  4. # Skips installing substrate itself and subkey
  5. curl https://getsubstrate.io -sSf | bash -s -- --fast
  6. source ~/.cargo/env
  7. rustup component add rustfmt clippy
  8. # Current version of substrate requires an older version of nightly toolchain
  9. # to successfully compile the WASM runtime. We force install because rustfmt package
  10. # is not available for this nightly version.
  11. rustup install nightly-2020-10-06 --force
  12. rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-06
  13. # Sticking with older version of compiler to ensure working build
  14. rustup install 1.47.0
  15. rustup default 1.47.0
  16. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  17. sudo apt-get install -y coreutils clang jq curl gcc xz-utils sudo pkg-config unzip clang libc6-dev-i386
  18. sudo apt-get install -y docker.io docker-compose
  19. elif [[ "$OSTYPE" == "darwin"* ]]; then
  20. brew install b2sum gnu-tar jq curl
  21. echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
  22. fi
  23. # Volta nodejs, npm, yarn tools manager
  24. curl https://get.volta.sh | bash
  25. volta install node@12
  26. volta install yarn
  27. volta install npx