From 38faadfa95abc5cb8a6775ec56d2992b782ed53c Mon Sep 17 00:00:00 2001 From: Mokhtar Naamani Date: Thu, 20 Jul 2023 17:56:34 +0300 Subject: [PATCH] updated README to suggest workaround if dev machine doesn't support node18 --- README.md | 30 ++++++++++++++++++++++++++---- setup.sh | 14 ++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 97cb538489..2da31f756c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ functionality to support the [various roles](https://joystream.gitbook.io/testne ## Development +For best results use GNU/Linux with minimum GLIBC_2.28 for nodejs v18+, eg. Ubuntu 22.04 or newer. + The following tools are required for building, testing and contributing to this repo: - [Rust](https://www.rust-lang.org/tools/install) toolchain - _required_ @@ -19,19 +21,39 @@ The following tools are required for building, testing and contributing to this If you use VSCode as your code editor we recommend using the workspace [settings](devops/vscode/settings.json) for recommend eslint plugin to function properly. -After cloning the repo run the following initialization scripts: +After cloning the repo run the following to get started: +### Install development tools ```sh -# Install development tools ./setup.sh +``` + +### If you prefer your own node version manager +Install development tools without Volta version manager. + +```sh +./setup.sh --no-volta +``` + +### For older operating systems which don't support node 18 +Modify the root `package.json` and change volta section to use node version 16.20.1 instead of 18.6.0 +```json +"volta": { + "node": "16.20.1", + "yarn": "1.22.19" +} +``` -# build local npm packages +### Run local development network + +```sh +# Build local npm packages yarn build:packages # Build joystream/node docker testing image RUNTIME_PROFILE=TESTING yarn build:node:docker -# start a local development network +# Start a local development network RUNTIME_PROFILE=TESTING yarn start ``` diff --git a/setup.sh b/setup.sh index d8f51d068d..b4047aeb26 100755 --- a/setup.sh +++ b/setup.sh @@ -52,13 +52,15 @@ rustup component add rustfmt # cargo install --force subkey --git https://github.com/paritytech/substrate --version ^2.0.2 --locked # Volta nodejs, npm, yarn tools manager -curl https://get.volta.sh | bash +if ! [[ $1 == "--no-volta" ]]; then + curl https://get.volta.sh | bash -# source env variables added by Volta -source ~/.bash_profile || source ~/.profile || source ~/.bashrc || : + # source env variables added by Volta + source ~/.bash_profile || source ~/.profile || source ~/.bashrc || : -volta install node@18 -volta install yarn -volta install npx + volta install node + volta install yarn + volta install npx +fi echo "You may need to open a new terminal/shell session to make newly installed tools available."