Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from node v14 to v18.6.0 #4778

Merged
merged 17 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/joystream-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/joystream-node-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'

- id: compute_shasum
name: Compute runtime code shasum
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/joystream-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'

- id: compute_shasum
name: Compute runtime code shasum
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'

# docker manifest inspect requires authentication
- name: Login to DockerHub
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/joystream-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'
- uses: technote-space/get-diff-action@v3
with:
PREFIX_FILTER: |
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'
- uses: technote-space/get-diff-action@v3
with:
PREFIX_FILTER: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/joystream-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/metadata-protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/query-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run-network-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'

- id: compute_shasum
name: Compute runtime code shasum
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'
- name: Get artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18.x'
- name: Install packages and dependencies
if: env.GIT_DIFF
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/storage-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Joystream Monorepo ChangeLog

This is a top-level view of changes in the repo, linking to detailed changelogs of individual packages changed.
If no packages or cargo crates are changed then the changes are usually "devops" related.

### 2023-7-20 - Node.js update

This is developer tools update release.

#### Moving to node v18.6.0 from v14
This is a potentially breaking change for your setup, since it requires a minimum GLIBC_2.28 on gnu/linux systems. If you use Ubuntu then you should be at least on the `20.04` release.

To check your glibc version use this command: `ldd --version`

If your version is older than v2.28 you should really consider updating your OS it is probably quite dated and vulnerable to security bugs.

The minimum required node engine for all monorepo packages is updated to v14.18.0

No npm packages have not been published with new engine version yet, so you are not impacted if your application depends on them, until the next package version release. To be ready do one of:

1. Update to latest version of nodejs if possible, or
1. If you have to stick with v14 update to the latest v14 release

If you are using volta and your OS distro is fairly new you will not need to do anything, volta will automatically fetch and use required version. For workarounds see the install development tools section in the [README.md](./README.md)
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,55 @@ functionality to support the [various roles](https://joystream.gitbook.io/testne

## Development

For best results use GNU/Linux with minimum glibc version 2.28 for nodejs v18 to work.
So Ubuntu 20.04 or newer.

You can check your version of glibc with `ldd --version`

The following tools are required for building, testing and contributing to this repo:

- [Rust](https://www.rust-lang.org/tools/install) toolchain - _required_
- [nodejs](https://nodejs.org/) v14.x - _required_
- [nodejs](https://nodejs.org/) >= v14.18.x - _required_ (However volta will try to use v18.6)
- [yarn classic](https://classic.yarnpkg.com/en/docs/install) package manager v1.22.x- _required_
- [docker](https://www.docker.com/get-started) and docker-compose v2.20.x or higher - _required_
- [ansible](https://www.ansible.com/) - _optional_

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 image
yarn build:node:docker
# Build joystream/node docker testing image
RUNTIME_PROFILE=TESTING yarn build:node:docker

# start a local development network
yarn start
# Start a local development network
RUNTIME_PROFILE=TESTING yarn start
```

## Software
Expand Down
10 changes: 5 additions & 5 deletions RUNTIME-CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ WS_URI=wss://rpc.joystream.org yarn ts-node src/get-wasm-from-chain.ts ./runtime
# compute the blake2-256 hash of the runtime
b2sum -l 256 ./runtime.wasm
# Inspect the runtime version
node --experimental-wasm-bigint src/inspect-wasm-runtime-version.js ./runtime.wasm
node src/inspect-wasm-runtime-version.js ./runtime.wasm
```

### Using [subwasm](https://github.com/chevdor/subwasm)
Expand Down Expand Up @@ -105,7 +105,7 @@ docker rm test
# compute the blake2-256 hash of the runtime
b2sum -l 256 ./master.wasm
# Inspect the runtime version information
node --experimental-wasm-bigint utils/api-scripts/src/inspect-wasm-runtime-version.js ./master.wasm
node utils/api-scripts/src/inspect-wasm-runtime-version.js ./master.wasm
```

Compare results with the runtime you fetched from the chain in previous section.
Expand All @@ -131,7 +131,7 @@ WS_URI=wss://rpc.joystream.org yarn ts-node src/get-wasm-from-proposal.ts 123 ./
# compute the blake2-256 hash of the runtime
b2sum -l 256 ./proposed.wasm
# Inspect the runtime version information
node --experimental-wasm-bigint src/inspect-wasm-runtime-version.js ./runtime.wasm
node src/inspect-wasm-runtime-version.js ./runtime.wasm
```

Checkout the proposed runtime from the proposer's fork of joystream repository, and build it.
Expand Down Expand Up @@ -331,9 +331,9 @@ Specific test scenario should be written to test for any state migration code pe
There are some scripts in `tests/network-tests/run-migration-tests.sh` that are executed by github workflow to perform such tests,
but they should also be executed locally.

The tool is being updated for Ephesus network: https://github.com/Joystream/joystream/pull/4569

### Additional Resources
Some tooling that would be useful to add to our node and runtime to improve testing capabilities:
- https://docs.substrate.io/reference/how-to-guides/tools/use-try-runtime/
- https://docs.substrate.io/reference/command-line-tools/try-runtime/

This is coming in nara release https://github.com/Joystream/joystream/pull/4705
6 changes: 3 additions & 3 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"typescript": "^4.4.3"
},
"engines": {
"node": ">=14.0.0",
"node": ">=14.18.0",
"yarn": "^1.22.0"
},
"publishConfig": {
Expand Down Expand Up @@ -170,7 +170,7 @@
},
"types": "lib/index.d.ts",
"volta": {
"node": "14.16.1",
"yarn": "1.22.15"
"node": "18.6.0",
"yarn": "1.22.19"
}
}
2 changes: 1 addition & 1 deletion devops/ansible/roles/common/tasks/install-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
shell:
cmd: |
bash -ic "
volta install node@14 && volta install yarn
volta install node@18 && volta install yarn
"
args:
executable: /bin/bash
Expand Down
6 changes: 3 additions & 3 deletions distributor-node/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"typescript": "^4.4.3"
},
"engines": {
"node": ">=14.16.1"
"node": ">=14.18.0"
},
"volta": {
"node": "14.16.1",
"yarn": "1.22.15"
"node": "18.6.0",
"yarn": "1.22.19"
},
"homepage": "https://github.com/Joystream/joystream",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions distributor-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
"widdershins": "^4.0.1"
},
"engines": {
"node": ">=14.16.1"
"node": ">=14.18.0"
},
"volta": {
"node": "14.16.1",
"yarn": "1.22.15"
"node": "18.6.0",
"yarn": "1.22.19"
},
"files": [
"/bin",
Expand Down
Loading
Loading