feat: use nwaku/go-waku docker images instead of building binaries (#1259)

* merge: master

* fix: CI

* use: js script instead of shell script to run precheck and mocha

* use `console.log` instead of `debug.log` for `run-tests.js`
This commit is contained in:
Danish Arora 2023-04-17 10:29:36 +05:30 committed by GitHub
parent 0a80cd4315
commit dc3774c0ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 548 additions and 214 deletions

View File

@ -114,7 +114,8 @@
"webfonts", "webfonts",
"websockets", "websockets",
"wifi", "wifi",
"xsalsa20" "xsalsa20",
"statusteam"
], ],
"flagWords": [], "flagWords": [],
"ignorePaths": [ "ignorePaths": [

View File

@ -9,7 +9,6 @@ on:
pull_request: pull_request:
env: env:
NWAKU_VERSION: "v0.16.0"
NODE_JS: "18" NODE_JS: "18"
jobs: jobs:
@ -57,24 +56,15 @@ jobs:
node: node:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
WAKUNODE_IMAGE: "statusteam/nim-waku:v0.16.0"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get nwaku
shell: bash
run: |
mkdir -p nwaku/build
cd nwaku
wget "https://github.com/status-im/nwaku/releases/download/${NWAKU_VERSION}/nim-waku-ubuntu-latest.tar.gz"
tar xavf nim-waku-ubuntu-latest.tar.gz
- name: Ensure wakunode2 is ready
shell: bash
run: |
uname -a
cd nwaku/build
./wakunode2 --help
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- uses: ./.github/actions/npm - uses: ./.github/actions/npm
- run: npm run build:esm - run: npm run build:esm
- run: npm run test:node - run: npm run test:node
@ -95,35 +85,15 @@ jobs:
name: nwaku-logs name: nwaku-logs
path: packages/tests/log/ path: packages/tests/log/
node_with_go_waku: node_with_go_waku_master:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GO_WAKU_VERSION: "0.5.2" WAKUNODE_IMAGE: "statusteam/go-waku:latest"
WAKU_SERVICE_NODE_DIR: ../../go-waku
WAKU_SERVICE_NODE_BIN: ./waku
WAKU_SERVICE_NODE_PARAMS: "--min-relay-peers-to-publish=0" # Can be removed once https://github.com/status-im/nwaku/issues/1004 is done WAKU_SERVICE_NODE_PARAMS: "--min-relay-peers-to-publish=0" # Can be removed once https://github.com/status-im/nwaku/issues/1004 is done
DEBUG: "waku*" DEBUG: "waku*"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get go-waku
shell: bash
run: |
pwd
mkdir -p go-waku/
cd go-waku
wget "https://github.com/status-im/go-waku/releases/download/v${GO_WAKU_VERSION}/gowaku-${GO_WAKU_VERSION}-x86_64.deb"
sudo apt install ./gowaku-${GO_WAKU_VERSION}-x86_64.deb
cp $(which waku) ./
- name: Ensure go-waku is ready
shell: bash
run: |
uname -a
cd packages/core
cd "${WAKU_SERVICE_NODE_DIR}"
"${WAKU_SERVICE_NODE_BIN}" --version
- name: Install NodeJS - name: Install NodeJS
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@ -153,37 +123,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DEBUG: "waku*" DEBUG: "waku*"
WAKUNODE_IMAGE: "statusteam/nim-waku:deploy-wakuv2-test"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
- name: Install NodeJS - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- name: Pull nwaku origin/master
run: |
cd nwaku
git fetch origin
git checkout origin/master
- uses: ./.github/actions/npm - uses: ./.github/actions/npm
- name: build nwaku
run: |
cd packages/tests
npm run nwaku:force-build
- name: Ensure wakunode2 is ready
shell: bash
run: |
uname -a
cd nwaku
./build/wakunode2 --help
- run: npm run build:esm - run: npm run build:esm
- run: npm run test:node - run: npm run test:node
env: env:

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "nim-waku"]
path = nwaku
url = https://github.com/status-im/nim-waku.git

View File

@ -12,8 +12,8 @@ Do note that we have a [CI](./.github/workflows/ci.yml) powered by GitHub Action
To help ensure your PR passes, just run before committing: To help ensure your PR passes, just run before committing:
- `npm run fix`: To format your code, - `npm run fix`: To format your code,
- `npm run test`: To run all tests, including lint checks. - `npm run check`: To check your code for linting errors,
- `npm run test`: To run all tests
## Build & Test ## Build & Test
@ -21,13 +21,11 @@ To build and test this repository, you need:
- [Node.js & npm](https://nodejs.org/en/). - [Node.js & npm](https://nodejs.org/en/).
- Chrome (for browser testing). - Chrome (for browser testing).
- g++ & make (to build nim-waku)
To ensure interoperability with [nim-waku](https://github.com/status-im/nim-waku/), some tests are run against a nim-waku node. To ensure interoperability with [nim-waku](https://github.com/status-im/nim-waku/), some tests are run against a nim-waku node.
This is why `nim-waku` is present as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), which itself contain several submodules. This is why the relevant docker images for the node is pulled as part of the `pretest` script that runs before `npm run test`.
At this stage, it is not possible to exclude nim-waku tests, hence `git submodule update --init --recursive` is run before testing (see [`pretest` script](https://github.com/status-im/js-waku/blob/master/package.json)).
If you do not want to run `npm run test`, you can still build nim-waku by running `npm run pretest`. If you do not want to run `npm run test`, you can still pull the relevant nim-waku docker image by running `npm run pretest`.
Note that we run tests in both NodeJS and browser environments (using [karma](https://karma-runner.github.io/)). Note that we run tests in both NodeJS and browser environments (using [karma](https://karma-runner.github.io/)).
Files named `*.node.spec.ts` are only run in NodeJS environment; Files named `*.node.spec.ts` are only run in NodeJS environment;
@ -62,4 +60,3 @@ Commit messages should never contain any `@` mentions (usernames prefixed with "
Please refer to the [Git manual](https://git-scm.com/doc) for more information Please refer to the [Git manual](https://git-scm.com/doc) for more information
about Git. about Git.

1
nwaku

@ -1 +0,0 @@
Subproject commit 03f0de365cfee3a946257a6ce8a61fe19284976c

345
package-lock.json generated
View File

@ -1424,6 +1424,11 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@balena/dockerignore": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz",
"integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q=="
},
"node_modules/@bcoe/v8-coverage": { "node_modules/@bcoe/v8-coverage": {
"version": "0.2.3", "version": "0.2.3",
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
@ -5116,6 +5121,26 @@
"@types/ms": "*" "@types/ms": "*"
} }
}, },
"node_modules/@types/docker-modem": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/docker-modem/-/docker-modem-3.0.2.tgz",
"integrity": "sha512-qC7prjoEYR2QEe6SmCVfB1x3rfcQtUr1n4x89+3e0wSTMQ/KYCyf+/RAA9n2tllkkNc6//JMUZePdFRiGIWfaQ==",
"dev": true,
"dependencies": {
"@types/node": "*",
"@types/ssh2": "*"
}
},
"node_modules/@types/dockerode": {
"version": "3.3.15",
"resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-3.3.15.tgz",
"integrity": "sha512-az35KbxZZUCRgCoXqJUEvEbsOL3L7UbItuHSYoZ0uo/MWuNc03y7XMBVSCLLvxpxWK8X8pM5PoM0F/5TFHDF0g==",
"dev": true,
"dependencies": {
"@types/docker-modem": "*",
"@types/node": "*"
}
},
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "8.21.1", "version": "8.21.1",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.1.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.1.tgz",
@ -5299,6 +5324,15 @@
"integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==",
"dev": true "dev": true
}, },
"node_modules/@types/ssh2": {
"version": "1.11.8",
"resolved": "https://registry.npmjs.org/@types/ssh2/-/ssh2-1.11.8.tgz",
"integrity": "sha512-BsD9yrKmD8avjbR+N5tvv0jxYHzizcrC156YkPbNjqbu81tCm4ZdS7D6KtXbZfz+CFHgFrTC7j046Lr39W5eig==",
"dev": true,
"dependencies": {
"@types/node": "^18.11.18"
}
},
"node_modules/@types/strip-bom": { "node_modules/@types/strip-bom": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz",
@ -6878,6 +6912,14 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"dependencies": {
"safer-buffer": "~2.1.0"
}
},
"node_modules/assertion-error": { "node_modules/assertion-error": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
@ -6987,7 +7029,6 @@
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -7012,6 +7053,14 @@
"node": "^4.5.0 || >= 5.9" "node": "^4.5.0 || >= 5.9"
} }
}, },
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"dependencies": {
"tweetnacl": "^0.14.3"
}
},
"node_modules/before-after-hook": { "node_modules/before-after-hook": {
"version": "2.2.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
@ -7040,7 +7089,6 @@
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dev": true,
"dependencies": { "dependencies": {
"buffer": "^5.5.0", "buffer": "^5.5.0",
"inherits": "^2.0.4", "inherits": "^2.0.4",
@ -7228,7 +7276,6 @@
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -7263,6 +7310,15 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true "dev": true
}, },
"node_modules/buildcheck": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.3.tgz",
"integrity": "sha512-pziaA+p/wdVImfcbsZLNF32EiWyujlQLwolMqUQE8xpKNOH7KmZQaY8sXN7DGOEzPAElo9QTaeNRfGnf3iOJbA==",
"optional": true,
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/builtin-modules": { "node_modules/builtin-modules": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
@ -7809,8 +7865,7 @@
"node_modules/chownr": { "node_modules/chownr": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
"dev": true
}, },
"node_modules/chrome-trace-event": { "node_modules/chrome-trace-event": {
"version": "1.0.3", "version": "1.0.3",
@ -8432,6 +8487,20 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/cpu-features": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.4.tgz",
"integrity": "sha512-fKiZ/zp1mUwQbnzb9IghXtHtDoTMtNeb8oYGx6kX2SYfhnG0HNdBEBIzB9b5KlXu5DQPhfy3mInbBxFcgwAr3A==",
"hasInstallScript": true,
"optional": true,
"dependencies": {
"buildcheck": "0.0.3",
"nan": "^2.15.0"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/cpy": { "node_modules/cpy": {
"version": "9.0.1", "version": "9.0.1",
"resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz",
@ -9749,6 +9818,44 @@
"dns-query": "bin/dns-query" "dns-query": "bin/dns-query"
} }
}, },
"node_modules/docker-modem": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-3.0.8.tgz",
"integrity": "sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ==",
"dependencies": {
"debug": "^4.1.1",
"readable-stream": "^3.5.0",
"split-ca": "^1.0.1",
"ssh2": "^1.11.0"
},
"engines": {
"node": ">= 8.0"
}
},
"node_modules/dockerode": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-3.3.5.tgz",
"integrity": "sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA==",
"dependencies": {
"@balena/dockerignore": "^1.0.2",
"docker-modem": "^3.0.0",
"tar-fs": "~2.0.1"
},
"engines": {
"node": ">= 8.0"
}
},
"node_modules/dockerode/node_modules/tar-fs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
}
},
"node_modules/doctrine": { "node_modules/doctrine": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@ -10359,7 +10466,6 @@
"version": "1.4.4", "version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"dependencies": { "dependencies": {
"once": "^1.4.0" "once": "^1.4.0"
} }
@ -12220,8 +12326,7 @@
"node_modules/fs-constants": { "node_modules/fs-constants": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
"dev": true
}, },
"node_modules/fs-extra": { "node_modules/fs-extra": {
"version": "8.1.0", "version": "8.1.0",
@ -13039,7 +13144,6 @@
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -13175,8 +13279,7 @@
"node_modules/inherits": { "node_modules/inherits": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
"dev": true
}, },
"node_modules/ini": { "node_modules/ini": {
"version": "1.3.8", "version": "1.3.8",
@ -17253,8 +17356,7 @@
"node_modules/mkdirp-classic": { "node_modules/mkdirp-classic": {
"version": "0.5.3", "version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
"dev": true
}, },
"node_modules/mocha": { "node_modules/mocha": {
"version": "10.2.0", "version": "10.2.0",
@ -17748,6 +17850,12 @@
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
"dev": true "dev": true
}, },
"node_modules/nan": {
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==",
"optional": true
},
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
@ -21279,7 +21387,6 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"dependencies": { "dependencies": {
"wrappy": "1" "wrappy": "1"
} }
@ -23739,7 +23846,6 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"dependencies": { "dependencies": {
"end-of-stream": "^1.1.0", "end-of-stream": "^1.1.0",
"once": "^1.3.1" "once": "^1.3.1"
@ -24681,7 +24787,6 @@
"version": "3.6.2", "version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dev": true,
"dependencies": { "dependencies": {
"inherits": "^2.0.3", "inherits": "^2.0.3",
"string_decoder": "^1.1.1", "string_decoder": "^1.1.1",
@ -25163,7 +25268,6 @@
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -25196,8 +25300,7 @@
"node_modules/safer-buffer": { "node_modules/safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
"dev": true
}, },
"node_modules/sanitize-filename": { "node_modules/sanitize-filename": {
"version": "1.6.3", "version": "1.6.3",
@ -26362,6 +26465,11 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/split-ca": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",
"integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ=="
},
"node_modules/split2": { "node_modules/split2": {
"version": "3.2.2", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
@ -26376,6 +26484,23 @@
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
}, },
"node_modules/ssh2": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.11.0.tgz",
"integrity": "sha512-nfg0wZWGSsfUe/IBJkXVll3PEZ//YH2guww+mP88gTpuSU4FtZN7zu9JoeTGOyCNx2dTDtT9fOpWwlzyj4uOOw==",
"hasInstallScript": true,
"dependencies": {
"asn1": "^0.2.4",
"bcrypt-pbkdf": "^1.0.2"
},
"engines": {
"node": ">=10.16.0"
},
"optionalDependencies": {
"cpu-features": "~0.0.4",
"nan": "^2.16.0"
}
},
"node_modules/stack-trace": { "node_modules/stack-trace": {
"version": "0.0.10", "version": "0.0.10",
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
@ -26488,7 +26613,6 @@
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
"dependencies": { "dependencies": {
"safe-buffer": "~5.2.0" "safe-buffer": "~5.2.0"
} }
@ -26823,7 +26947,6 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dev": true,
"dependencies": { "dependencies": {
"bl": "^4.0.3", "bl": "^4.0.3",
"end-of-stream": "^1.4.1", "end-of-stream": "^1.4.1",
@ -27364,6 +27487,11 @@
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true "dev": true
}, },
"node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA=="
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@ -28174,8 +28302,7 @@
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
"dev": true
}, },
"node_modules/util/node_modules/inherits": { "node_modules/util/node_modules/inherits": {
"version": "2.0.3", "version": "2.0.3",
@ -28646,8 +28773,7 @@
"node_modules/wrappy": { "node_modules/wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
"dev": true
}, },
"node_modules/write-file-atomic": { "node_modules/write-file-atomic": {
"version": "3.0.3", "version": "3.0.3",
@ -29463,6 +29589,7 @@
"@waku/utils": "*", "@waku/utils": "*",
"app-root-path": "^3.1.0", "app-root-path": "^3.1.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"dockerode": "^3.3.5",
"p-timeout": "^6.1.0", "p-timeout": "^6.1.0",
"portfinder": "^1.0.32", "portfinder": "^1.0.32",
"tail": "^2.2.6" "tail": "^2.2.6"
@ -29473,6 +29600,7 @@
"@libp2p/interface-peer-discovery-compliance-tests": "^2.0.5", "@libp2p/interface-peer-discovery-compliance-tests": "^2.0.5",
"@libp2p/interface-peer-id": "^2.0.1", "@libp2p/interface-peer-id": "^2.0.1",
"@types/chai": "^4.3.4", "@types/chai": "^4.3.4",
"@types/dockerode": "^3.3.15",
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/tail": "^2.2.1", "@types/tail": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/eslint-plugin": "^5.57.0",
@ -30523,6 +30651,11 @@
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
"@balena/dockerignore": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz",
"integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q=="
},
"@bcoe/v8-coverage": { "@bcoe/v8-coverage": {
"version": "0.2.3", "version": "0.2.3",
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
@ -33318,6 +33451,26 @@
"@types/ms": "*" "@types/ms": "*"
} }
}, },
"@types/docker-modem": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/docker-modem/-/docker-modem-3.0.2.tgz",
"integrity": "sha512-qC7prjoEYR2QEe6SmCVfB1x3rfcQtUr1n4x89+3e0wSTMQ/KYCyf+/RAA9n2tllkkNc6//JMUZePdFRiGIWfaQ==",
"dev": true,
"requires": {
"@types/node": "*",
"@types/ssh2": "*"
}
},
"@types/dockerode": {
"version": "3.3.15",
"resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-3.3.15.tgz",
"integrity": "sha512-az35KbxZZUCRgCoXqJUEvEbsOL3L7UbItuHSYoZ0uo/MWuNc03y7XMBVSCLLvxpxWK8X8pM5PoM0F/5TFHDF0g==",
"dev": true,
"requires": {
"@types/docker-modem": "*",
"@types/node": "*"
}
},
"@types/eslint": { "@types/eslint": {
"version": "8.21.1", "version": "8.21.1",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.1.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.1.tgz",
@ -33501,6 +33654,15 @@
"integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==",
"dev": true "dev": true
}, },
"@types/ssh2": {
"version": "1.11.8",
"resolved": "https://registry.npmjs.org/@types/ssh2/-/ssh2-1.11.8.tgz",
"integrity": "sha512-BsD9yrKmD8avjbR+N5tvv0jxYHzizcrC156YkPbNjqbu81tCm4ZdS7D6KtXbZfz+CFHgFrTC7j046Lr39W5eig==",
"dev": true,
"requires": {
"@types/node": "^18.11.18"
}
},
"@types/strip-bom": { "@types/strip-bom": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz",
@ -34406,6 +34568,7 @@
"@libp2p/interface-peer-id": "^2.0.1", "@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/peer-id": "^2.0.2", "@libp2p/peer-id": "^2.0.2",
"@types/chai": "^4.3.4", "@types/chai": "^4.3.4",
"@types/dockerode": "^3.3.15",
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/tail": "^2.2.1", "@types/tail": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/eslint-plugin": "^5.57.0",
@ -34422,6 +34585,7 @@
"chai": "^4.3.7", "chai": "^4.3.7",
"cspell": "^6.31.1", "cspell": "^6.31.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"dockerode": "^3.3.5",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-comments": "^3.2.0",
@ -35176,6 +35340,14 @@
"integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==",
"dev": true "dev": true
}, },
"asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assertion-error": { "assertion-error": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
@ -35259,8 +35431,7 @@
"base64-js": { "base64-js": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
"dev": true
}, },
"base64id": { "base64id": {
"version": "2.0.0", "version": "2.0.0",
@ -35268,6 +35439,14 @@
"integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==",
"dev": true "dev": true
}, },
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"before-after-hook": { "before-after-hook": {
"version": "2.2.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
@ -35293,7 +35472,6 @@
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dev": true,
"requires": { "requires": {
"buffer": "^5.5.0", "buffer": "^5.5.0",
"inherits": "^2.0.4", "inherits": "^2.0.4",
@ -35438,7 +35616,6 @@
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"requires": { "requires": {
"base64-js": "^1.3.1", "base64-js": "^1.3.1",
"ieee754": "^1.1.13" "ieee754": "^1.1.13"
@ -35456,6 +35633,12 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true "dev": true
}, },
"buildcheck": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.3.tgz",
"integrity": "sha512-pziaA+p/wdVImfcbsZLNF32EiWyujlQLwolMqUQE8xpKNOH7KmZQaY8sXN7DGOEzPAElo9QTaeNRfGnf3iOJbA==",
"optional": true
},
"builtin-modules": { "builtin-modules": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
@ -35842,8 +36025,7 @@
"chownr": { "chownr": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
"dev": true
}, },
"chrome-trace-event": { "chrome-trace-event": {
"version": "1.0.3", "version": "1.0.3",
@ -36319,6 +36501,16 @@
} }
} }
}, },
"cpu-features": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.4.tgz",
"integrity": "sha512-fKiZ/zp1mUwQbnzb9IghXtHtDoTMtNeb8oYGx6kX2SYfhnG0HNdBEBIzB9b5KlXu5DQPhfy3mInbBxFcgwAr3A==",
"optional": true,
"requires": {
"buildcheck": "0.0.3",
"nan": "^2.15.0"
}
},
"cpy": { "cpy": {
"version": "9.0.1", "version": "9.0.1",
"resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz",
@ -37268,6 +37460,40 @@
"utf8-codec": "^1.0.0" "utf8-codec": "^1.0.0"
} }
}, },
"docker-modem": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-3.0.8.tgz",
"integrity": "sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ==",
"requires": {
"debug": "^4.1.1",
"readable-stream": "^3.5.0",
"split-ca": "^1.0.1",
"ssh2": "^1.11.0"
}
},
"dockerode": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-3.3.5.tgz",
"integrity": "sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA==",
"requires": {
"@balena/dockerignore": "^1.0.2",
"docker-modem": "^3.0.0",
"tar-fs": "~2.0.1"
},
"dependencies": {
"tar-fs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
"requires": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
}
}
}
},
"doctrine": { "doctrine": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@ -37732,7 +37958,6 @@
"version": "1.4.4", "version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"requires": { "requires": {
"once": "^1.4.0" "once": "^1.4.0"
} }
@ -39071,8 +39296,7 @@
"fs-constants": { "fs-constants": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
"dev": true
}, },
"fs-extra": { "fs-extra": {
"version": "8.1.0", "version": "8.1.0",
@ -39679,8 +39903,7 @@
"ieee754": { "ieee754": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
"dev": true
}, },
"ignore": { "ignore": {
"version": "5.2.4", "version": "5.2.4",
@ -39770,8 +39993,7 @@
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
"dev": true
}, },
"ini": { "ini": {
"version": "1.3.8", "version": "1.3.8",
@ -42720,8 +42942,7 @@
"mkdirp-classic": { "mkdirp-classic": {
"version": "0.5.3", "version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
"dev": true
}, },
"mocha": { "mocha": {
"version": "10.2.0", "version": "10.2.0",
@ -43076,6 +43297,12 @@
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
"dev": true "dev": true
}, },
"nan": {
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==",
"optional": true
},
"nanoid": { "nanoid": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
@ -45573,7 +45800,6 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -47210,7 +47436,6 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": { "requires": {
"end-of-stream": "^1.1.0", "end-of-stream": "^1.1.0",
"once": "^1.3.1" "once": "^1.3.1"
@ -47860,7 +48085,6 @@
"version": "3.6.2", "version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dev": true,
"requires": { "requires": {
"inherits": "^2.0.3", "inherits": "^2.0.3",
"string_decoder": "^1.1.1", "string_decoder": "^1.1.1",
@ -48221,8 +48445,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
"dev": true
}, },
"safe-regex-test": { "safe-regex-test": {
"version": "1.0.0", "version": "1.0.0",
@ -48238,8 +48461,7 @@
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
"dev": true
}, },
"sanitize-filename": { "sanitize-filename": {
"version": "1.6.3", "version": "1.6.3",
@ -49141,6 +49363,11 @@
"through": "2" "through": "2"
} }
}, },
"split-ca": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",
"integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ=="
},
"split2": { "split2": {
"version": "3.2.2", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
@ -49155,6 +49382,17 @@
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
}, },
"ssh2": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.11.0.tgz",
"integrity": "sha512-nfg0wZWGSsfUe/IBJkXVll3PEZ//YH2guww+mP88gTpuSU4FtZN7zu9JoeTGOyCNx2dTDtT9fOpWwlzyj4uOOw==",
"requires": {
"asn1": "^0.2.4",
"bcrypt-pbkdf": "^1.0.2",
"cpu-features": "~0.0.4",
"nan": "^2.16.0"
}
},
"stack-trace": { "stack-trace": {
"version": "0.0.10", "version": "0.0.10",
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
@ -49254,7 +49492,6 @@
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
"requires": { "requires": {
"safe-buffer": "~5.2.0" "safe-buffer": "~5.2.0"
} }
@ -49491,7 +49728,6 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dev": true,
"requires": { "requires": {
"bl": "^4.0.3", "bl": "^4.0.3",
"end-of-stream": "^1.4.1", "end-of-stream": "^1.4.1",
@ -49876,6 +50112,11 @@
"yargs": "^17.0.0" "yargs": "^17.0.0"
} }
}, },
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA=="
},
"type-check": { "type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@ -50450,8 +50691,7 @@
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
"dev": true
}, },
"utils-merge": { "utils-merge": {
"version": "1.0.1", "version": "1.0.1",
@ -50817,8 +51057,7 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
"dev": true
}, },
"write-file-atomic": { "write-file-atomic": {
"version": "3.0.3", "version": "3.0.3",

View File

@ -58,10 +58,6 @@
"fix": "run-s fix:*", "fix": "run-s fix:*",
"fix:lint": "eslint src *.js --fix", "fix:lint": "eslint src *.js --fix",
"pretest": "run-s pretest:*", "pretest": "run-s pretest:*",
"pretest:1-init-git-submodules": "[ -f '../../nwaku/build/wakunode2' ] || git submodule update --init --recursive",
"pretest:2-build-nwaku": "[ -f '../../nwaku/build/wakunode2' ] || run-s nwaku:build",
"nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$PROC wakunode2)",
"nwaku:force-build": "(cd ../../nwaku && rm -rf ./build/ ./vendor) && run-s nwaku:build",
"check": "run-s check:*", "check": "run-s check:*",
"check:tsc": "tsc -p tsconfig.dev.json", "check:tsc": "tsc -p tsconfig.dev.json",
"check:lint": "eslint src *.js", "check:lint": "eslint src *.js",

View File

@ -6,4 +6,7 @@ module.exports = {
rules: { rules: {
"@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-non-null-assertion": "off",
}, },
globals: {
process: true,
},
}; };

41
packages/tests/README.md Normal file
View File

@ -0,0 +1,41 @@
# Description
This package contains tests for the `js-waku` library.
# Pre-requisites
Some of the tests from this package require a running `nwaku` or `go-waku` node. These nodes are setup to be run in a docker container.
Therefore, you need to have `docker` installed on your machine to run the tests.
# Running interop tests
- The tests by default run against an `nwaku` node with the image name specified in `nwaku.ts` and `packages/tests/package.json`. The tests can be run against a different image by setting the environment variable `WAKUNODE_IMAGE` to the desired image.
- The tests can be run against a `go-waku` node by setting the environment variable `WAKUNODE_IMAGE` to the desired `go-waku` image.
- Whatever `WAKUNODE_IMAGE` is set to, the tests will run against that image. If the image is not available locally, the tests will pull the image from the docker hub.
You can run the tests by running the following command:
```bash
WAKUNODE_IMAGE=explicit-image-name npm run test:node
```
Or against the default docker image by running:
```bash
npm run test:node
```
- You can also run the tests against a local `nwaku` or `go-waku` node by setting the environment variable `WAKUNODE_IMAGE` to the name of the image. The tests will then run against the local image.
- For example, to run the tests against a local checkout of `nwaku` or `go-waku`, build the image first manually. You can build the image by running the following command:
```bash
docker build path-to-dockerfile -t image-name
```
Then, you can run the tests by running the following command:
```bash
WAKUNODE_IMAGE=image-name npm run test:node
```

View File

@ -37,17 +37,12 @@
"build:esm": "tsc", "build:esm": "tsc",
"fix": "run-s fix:*", "fix": "run-s fix:*",
"fix:lint": "eslint src tests --fix", "fix:lint": "eslint src tests --fix",
"pretest": "run-s pretest:*",
"pretest:1-init-git-submodules": "[ -f '../../nwaku/build/wakunode2' ] || git submodule update --init --recursive",
"pretest:2-build-nwaku": "[ -f '../../nwaku/build/wakunode2' ] || run-s nwaku:build",
"nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off\" make -j$PROC wakunode2)",
"nwaku:force-build": "(cd ../../nwaku && rm -rf ./build/ ./vendor) && run-s nwaku:build",
"check": "run-s check:*", "check": "run-s check:*",
"check:lint": "eslint src tests", "check:lint": "eslint src tests",
"check:spelling": "cspell \"{README.md,{tests,src}/**/*.ts}\"", "check:spelling": "cspell \"{README.md,{tests,src}/**/*.ts}\"",
"check:tsc": "tsc -p tsconfig.dev.json", "check:tsc": "tsc -p tsconfig.dev.json",
"test": "run-s test:*", "test": "run-s test:*",
"test:node": "TS_NODE_PROJECT=./tsconfig.dev.json mocha", "test:node": "node ./src/run-tests.js",
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build" "reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
}, },
"engines": { "engines": {
@ -61,6 +56,7 @@
"@waku/utils": "*", "@waku/utils": "*",
"app-root-path": "^3.1.0", "app-root-path": "^3.1.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"dockerode": "^3.3.5",
"p-timeout": "^6.1.0", "p-timeout": "^6.1.0",
"portfinder": "^1.0.32", "portfinder": "^1.0.32",
"tail": "^2.2.6" "tail": "^2.2.6"
@ -71,6 +67,7 @@
"@libp2p/interface-peer-discovery-compliance-tests": "^2.0.5", "@libp2p/interface-peer-discovery-compliance-tests": "^2.0.5",
"@libp2p/interface-peer-id": "^2.0.1", "@libp2p/interface-peer-id": "^2.0.1",
"@types/chai": "^4.3.4", "@types/chai": "^4.3.4",
"@types/dockerode": "^3.3.15",
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/tail": "^2.2.1", "@types/tail": "^2.2.1",
"@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/eslint-plugin": "^5.57.0",

View File

@ -1,4 +1,4 @@
import { ChildProcess, spawn } from "child_process"; import fs from "fs";
import type { PeerId } from "@libp2p/interface-peer-id"; import type { PeerId } from "@libp2p/interface-peer-id";
import { peerIdFromString } from "@libp2p/peer-id"; import { peerIdFromString } from "@libp2p/peer-id";
@ -6,8 +6,8 @@ import { Multiaddr, multiaddr } from "@multiformats/multiaddr";
import { DefaultPubSubTopic } from "@waku/core"; import { DefaultPubSubTopic } from "@waku/core";
import { isDefined } from "@waku/utils"; import { isDefined } from "@waku/utils";
import { bytesToHex, hexToBytes } from "@waku/utils/bytes"; import { bytesToHex, hexToBytes } from "@waku/utils/bytes";
import appRoot from "app-root-path";
import debug from "debug"; import debug from "debug";
import Docker from "dockerode";
import portfinder from "portfinder"; import portfinder from "portfinder";
import { existsAsync, mkdirAsync, openAsync } from "./async_fs.js"; import { existsAsync, mkdirAsync, openAsync } from "./async_fs.js";
@ -16,15 +16,15 @@ import waitForLine from "./log_file.js";
const log = debug("waku:nwaku"); const log = debug("waku:nwaku");
const WAKU_SERVICE_NODE_DIR =
process.env.WAKU_SERVICE_NODE_DIR ?? appRoot + "/nwaku";
const WAKU_SERVICE_NODE_BIN =
process.env.WAKU_SERVICE_NODE_BIN ??
WAKU_SERVICE_NODE_DIR + "/build/wakunode2";
const WAKU_SERVICE_NODE_PARAMS = const WAKU_SERVICE_NODE_PARAMS =
process.env.WAKU_SERVICE_NODE_PARAMS ?? undefined; process.env.WAKU_SERVICE_NODE_PARAMS ?? undefined;
const NODE_READY_LOG_LINE = "Node setup complete"; const NODE_READY_LOG_LINE = "Node setup complete";
const DOCKER_IMAGE_NAME =
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.16.0";
const isGoWaku = DOCKER_IMAGE_NAME.includes("go-waku");
const LOG_DIR = "./log"; const LOG_DIR = "./log";
const OneMillion = BigInt(1_000_000); const OneMillion = BigInt(1_000_000);
@ -90,8 +90,8 @@ export interface MessageRpcResponse {
} }
export class Nwaku { export class Nwaku {
private process?: ChildProcess; private docker: Docker;
private pid?: number; private containerId?: string;
private peerId?: PeerId; private peerId?: PeerId;
private multiaddrWithId?: Multiaddr; private multiaddrWithId?: Multiaddr;
private websocketPort?: number; private websocketPort?: number;
@ -124,6 +124,7 @@ export class Nwaku {
} }
constructor(logName: string) { constructor(logName: string) {
this.docker = new Docker();
this.logPath = `${LOG_DIR}/nwaku_${logName}.log`; this.logPath = `${LOG_DIR}/nwaku_${logName}.log`;
} }
@ -139,7 +140,7 @@ export class Nwaku {
} }
} }
const logFile = await openAsync(this.logPath, "w"); await openAsync(this.logPath, "w");
const mergedArgs = defaultArgs(); const mergedArgs = defaultArgs();
@ -154,82 +155,118 @@ export class Nwaku {
}); });
}); });
this.rpcPort = ports[0];
const isGoWaku = WAKU_SERVICE_NODE_BIN.endsWith("/waku");
if (isGoWaku && !args.logLevel) { if (isGoWaku && !args.logLevel) {
args.logLevel = LogLevel.Debug; args.logLevel = LogLevel.Debug;
} }
const [rpcPort, tcpPort, websocketPort, discv5UdpPort] = ports;
this.rpcPort = rpcPort;
this.websocketPort = websocketPort;
// Object.assign overrides the properties with the source (if there are conflicts) // Object.assign overrides the properties with the source (if there are conflicts)
Object.assign( Object.assign(
mergedArgs, mergedArgs,
{ {
tcpPort: ports[1], rpcPort,
rpcPort: this.rpcPort, tcpPort,
websocketPort: ports[2], websocketPort,
...(args?.peerExchange && { discv5UdpPort: ports[3] }), ...(args?.peerExchange && { discv5UdpPort }),
}, },
args args
); );
this.websocketPort = mergedArgs.websocketPort;
process.env.WAKUNODE2_STORE_MESSAGE_DB_URL = ""; process.env.WAKUNODE2_STORE_MESSAGE_DB_URL = "";
const argsArray = argsToArray(mergedArgs); const argsArray = argsToArray(mergedArgs);
const natExtIp = "--nat=extip:127.0.0.1"; const natExtIp = "--nat=extip:127.0.0.1";
argsArray.push(natExtIp); const rpcAddress = "--rpc-address=0.0.0.0";
argsArray.push(natExtIp, rpcAddress);
if (WAKU_SERVICE_NODE_PARAMS) { if (WAKU_SERVICE_NODE_PARAMS) {
argsArray.push(WAKU_SERVICE_NODE_PARAMS); argsArray.push(WAKU_SERVICE_NODE_PARAMS);
} }
log(`nwaku args: ${argsArray.join(" ")}`); log(`nwaku args: ${argsArray.join(" ")}`);
this.process = spawn(WAKU_SERVICE_NODE_BIN, argsArray, { if (this.containerId) {
cwd: WAKU_SERVICE_NODE_DIR, this.stop();
stdio: [ }
"ignore", // stdin
logFile, // stdout try {
logFile, // stderr await this.confirmImageExistsOrPull();
const container = await this.docker.createContainer({
Image: DOCKER_IMAGE_NAME,
HostConfig: {
PortBindings: {
[`${rpcPort}/tcp`]: [{ HostPort: rpcPort.toString() }],
[`${tcpPort}/tcp`]: [{ HostPort: tcpPort.toString() }],
[`${websocketPort}/tcp`]: [{ HostPort: websocketPort.toString() }],
...(args?.peerExchange && {
[`${discv5UdpPort}/udp`]: [
{ HostPort: discv5UdpPort.toString() },
], ],
}),
},
},
ExposedPorts: {
[`${rpcPort}/tcp`]: {},
[`${tcpPort}/tcp`]: {},
[`${websocketPort}/tcp`]: {},
...(args?.peerExchange && {
[`${discv5UdpPort}/udp`]: {},
}),
},
Cmd: argsArray,
}); });
this.pid = this.process.pid; await container.start();
log(
`nwaku ${this.process.pid} started at ${new Date().toLocaleTimeString()}` const logStream = fs.createWriteStream(this.logPath);
container.logs(
{ follow: true, stdout: true, stderr: true },
(err, stream) => {
if (err) {
throw err;
}
if (stream) {
stream.pipe(logStream);
}
}
); );
this.process.on("exit", (signal) => { this.containerId = container.id;
log(
`nwaku ${
this.process ? this.process.pid : this.pid
} process exited with ${signal} at ${new Date().toLocaleTimeString()}`
);
});
this.process.on("error", (err) => {
log( log(
`nwaku ${ `nwaku ${
this.process ? this.process.pid : this.pid this.containerId
} process encountered an error: ${err} at ${new Date().toLocaleTimeString()}` } started at ${new Date().toLocaleTimeString()}`
); );
});
log(`Waiting to see '${NODE_READY_LOG_LINE}' in nwaku logs`); log(`Waiting to see '${NODE_READY_LOG_LINE}' in nwaku logs`);
await this.waitForLog(NODE_READY_LOG_LINE, 15000); await this.waitForLog(NODE_READY_LOG_LINE, 15000);
if (process.env.CI) await delay(100); if (process.env.CI) await delay(100);
log("nwaku node has been started"); log("nwaku node has been started");
} catch (error) {
log(`Error starting nwaku: ${error}`);
if (this.containerId) await this.stop();
throw error;
}
} }
public stop(): void { public async stop(): Promise<void> {
const pid = this.process ? this.process.pid : this.pid; if (!this.containerId) throw "nwaku containerId not set";
log(`nwaku ${pid} getting SIGINT at ${new Date().toLocaleTimeString()}`);
if (!this.process) throw "nwaku process not set"; const container = this.docker.getContainer(this.containerId);
const res = this.process.kill("SIGINT");
log(`nwaku ${pid} interrupted:`, res); log(
this.process = undefined; `Shutting down nwaku container ID ${
this.containerId
} at ${new Date().toLocaleTimeString()}`
);
await container.remove({ force: true });
this.containerId = undefined;
} }
async waitForLog(msg: string, timeout: number): Promise<void> { async waitForLog(msg: string, timeout: number): Promise<void> {
@ -383,10 +420,6 @@ export class Nwaku {
async getMultiaddrWithId(): Promise<Multiaddr> { async getMultiaddrWithId(): Promise<Multiaddr> {
if (this.multiaddrWithId) return this.multiaddrWithId; if (this.multiaddrWithId) return this.multiaddrWithId;
if (!this.websocketPort) {
return Promise.reject("No websocket port defined.");
}
const peerId = await this.getPeerId(); const peerId = await this.getPeerId();
this.multiaddrWithId = multiaddr( this.multiaddrWithId = multiaddr(
@ -436,10 +469,34 @@ export class Nwaku {
} }
private checkProcess(): void { private checkProcess(): void {
if (!this.process) { if (!this.containerId || !this.docker.getContainer(this.containerId)) {
throw "Nwaku hasn't started"; throw "Nwaku container hasn't started";
} }
} }
async confirmImageExistsOrPull(): Promise<void> {
log(`Confirming that image ${DOCKER_IMAGE_NAME} exists`);
const doesImageExist = this.docker.getImage(DOCKER_IMAGE_NAME);
if (!doesImageExist) {
await new Promise<void>((resolve, reject) => {
this.docker.pull(DOCKER_IMAGE_NAME, {}, (err, stream) => {
if (err) {
reject(err);
}
this.docker.modem.followProgress(stream, (err, result) => {
if (err) {
reject(err);
}
if (result) {
resolve();
}
});
});
});
}
log(`Image ${DOCKER_IMAGE_NAME} successfully found`);
}
} }
export function argsToArray(args: Args): Array<string> { export function argsToArray(args: Args): Array<string> {
@ -460,7 +517,7 @@ export function argsToArray(args: Args): Array<string> {
export function defaultArgs(): Args { export function defaultArgs(): Args {
return { return {
listenAddress: "127.0.0.1", listenAddress: "0.0.0.0",
rpc: true, rpc: true,
relay: false, relay: false,
rpcAdmin: true, rpcAdmin: true,

View File

@ -0,0 +1,50 @@
import { exec, spawn } from "child_process";
import { promisify } from "util";
const execAsync = promisify(exec);
const WAKUNODE_IMAGE =
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.16.0";
async function main() {
try {
await execAsync(`docker inspect ${WAKUNODE_IMAGE}`);
console.log("Using local image");
} catch (error) {
console.log("Pulling image...");
await execAsync(`docker pull ${WAKUNODE_IMAGE}`);
console.log("Image pulled");
}
// Run mocha tests
const mocha = spawn(
"npx",
[
"mocha",
"--require",
"ts-node/register",
"--project",
"./tsconfig.dev.json",
],
{
stdio: "inherit",
}
);
mocha.on("error", (error) => {
console.log(`Error running mocha tests: ${error.message}`);
process.exit(1);
});
mocha.on("exit", (code) => {
console.log(`Mocha tests exited with code ${code}`);
process.exit(code || 0);
});
}
main().catch((error) => {
console.log(error);
process.exit(1);
});

View File

@ -12,7 +12,8 @@ describe("ENR Interop: nwaku", function () {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -43,7 +43,8 @@ describe("Waku Message Ephemeral field", () => {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -25,7 +25,8 @@ describe("Waku Filter", () => {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -27,7 +27,8 @@ describe("Waku Light Push [node only]", () => {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -10,7 +10,7 @@ describe("nwaku", () => {
const actual = argsToArray(args); const actual = argsToArray(args);
const expected = [ const expected = [
"--listen-address=127.0.0.1", "--listen-address=0.0.0.0",
"--rpc=true", "--rpc=true",
"--relay=false", "--relay=false",
"--rpc-admin=true", "--rpc-admin=true",

View File

@ -357,7 +357,8 @@ describe("Waku Relay [node only]", () => {
}); });
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });
@ -427,7 +428,8 @@ describe("Waku Relay [node only]", () => {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku1 && !!waku1 &&
waku1.stop().catch((e) => console.log("Waku failed to stop", e)); waku1.stop().catch((e) => console.log("Waku failed to stop", e));
!!waku2 && !!waku2 &&

View File

@ -49,7 +49,8 @@ describe("Waku Store", () => {
}); });
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });
@ -580,7 +581,8 @@ describe("Waku Store, custom pubsub topic", () => {
}); });
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -13,7 +13,7 @@ describe("Wait for remote peer", function () {
afterEach(async function () { afterEach(async function () {
if (nwaku) { if (nwaku) {
nwaku.stop(); nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
nwaku = undefined; nwaku = undefined;
} }
waku1?.stop().catch((e) => console.log("Waku failed to stop", e)); waku1?.stop().catch((e) => console.log("Waku failed to stop", e));

View File

@ -31,7 +31,8 @@ describe("Waku Dial [node only]", function () {
let nwaku: Nwaku; let nwaku: Nwaku;
afterEach(async function () { afterEach(async function () {
!!nwaku && nwaku.stop(); !!nwaku &&
nwaku.stop().catch((e) => console.log("Nwaku failed to stop", e));
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
}); });

View File

@ -5,6 +5,6 @@
"rootDir": "src", "rootDir": "src",
"tsBuildInfoFile": "dist/.tsbuildinfo" "tsBuildInfoFile": "dist/.tsbuildinfo"
}, },
"include": ["src"], "include": ["src", "src/run-tests.js"],
"exclude": ["src/**/*.spec.ts", "src/test_utils"] "exclude": ["src/**/*.spec.ts", "src/test_utils"]
} }