setup.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. set -e
  3. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  4. sudo apt-get install -y coreutils clang jq curl gcc xz-utils sudo pkg-config unzip clang libc6-dev-i386 make libssl-dev python
  5. sudo apt-get install -y docker.io docker-compose containerd runc
  6. elif [[ "$OSTYPE" == "darwin"* ]]; then
  7. brew install b2sum gnu-tar jq curl
  8. echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
  9. fi
  10. # If OS is supported will install build tools for rust and substrate.
  11. # Skips installing substrate itself and subkey
  12. curl https://getsubstrate.io -sSf | bash -s -- --fast
  13. source ~/.cargo/env
  14. rustup component add rustfmt clippy
  15. # Current version of substrate requires an older version of nightly toolchain
  16. # to successfully compile the WASM runtime. We force install because rustfmt package
  17. # is not available for this nightly version.
  18. rustup install nightly-2020-05-23 --force
  19. rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23
  20. # Latest clippy linter which comes with 1.47.0 fails on some subtrate modules
  21. # Also note combination of newer versions of toolchain with the above nightly
  22. # toolchain to build wasm seems to fail.
  23. # So we need to stick with an older version until we update substrate
  24. rustup install 1.46.0
  25. rustup default 1.46.0
  26. # Volta nodejs, npm, yarn tools manager
  27. curl https://get.volta.sh | bash
  28. # source env variables added by Volta
  29. source ~/.bashrc || :
  30. source ~/.bash_profile || :
  31. volta install node@12
  32. volta install yarn
  33. volta install npx