setup.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. set -e
  3. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  4. # code build tools
  5. sudo apt-get update
  6. sudo apt-get install -y coreutils clang llvm jq curl gcc xz-utils sudo pkg-config unzip libc6-dev make libssl-dev python
  7. # docker
  8. sudo apt-get install -y docker.io docker-compose containerd runc
  9. elif [[ "$OSTYPE" == "darwin"* ]]; then
  10. # install brew package manager
  11. if ! which brew >/dev/null 2>&1; then
  12. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  13. fi
  14. # install additional packages
  15. brew update
  16. brew install coreutils gnu-tar jq curl
  17. echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
  18. echo "It is also recommended to install qemu emulators with following command:"
  19. echo "docker run --privileged --rm tonistiigi/binfmt --install all"
  20. fi
  21. # If OS is supported will install build tools for rust and substrate.
  22. # Skips installation of substrate and subkey
  23. curl https://getsubstrate.io -sSf | bash -s -- --fast
  24. source ~/.cargo/env
  25. rustup install nightly-2021-03-24
  26. rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
  27. rustup default nightly-2021-03-24
  28. rustup component add rustfmt clippy
  29. # Volta nodejs, npm, yarn tools manager
  30. curl https://get.volta.sh | bash
  31. # source env variables added by Volta
  32. source ~/.bash_profile || source ~/.profile || source ~/.bashrc || :
  33. volta install node@14
  34. volta install yarn
  35. volta install npx
  36. echo "You may need to open a new terminal/shell session to make newly installed tools available."