setup.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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-05-23 --force
  12. rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23
  13. # Latest clippy linter which comes with 1.47.0 fails on some subtrate modules
  14. # Also note combination of newer versions of toolchain with the above nightly
  15. # toolchain to build wasm seems to fail.
  16. # So we need to stick with an older version until we update substrate
  17. rustup install 1.46.0
  18. rustup default 1.46.0
  19. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  20. sudo apt-get install -y coreutils clang jq curl gcc xz-utils sudo pkg-config unzip clang libc6-dev-i386 make libssl-dev
  21. sudo apt-get install -y docker.io docker-compose containerd runc
  22. elif [[ "$OSTYPE" == "darwin"* ]]; then
  23. brew install b2sum gnu-tar jq curl
  24. echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
  25. fi
  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