From 50eb30cfaf56f6a95204e1a9584fc11829f08d71 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 2 Dec 2021 11:14:30 +0000 Subject: [PATCH] chore: update peer-id (#119) Pulls in new libp2p-crypto and peer-id Also adds dependabot BREAKING CHANGE: requires node 15+ --- .aegir.js | 2 +- .github/dependabot.yml | 8 ++++++++ .github/workflows/main.yml | 19 +++++++++++++++++-- package.json | 16 ++++++++-------- test/floodsub.spec.js | 1 + test/utils/create-peer.js | 2 +- 6 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.aegir.js b/.aegir.js index a0b5c3db62..56ba69d5b7 100644 --- a/.aegir.js +++ b/.aegir.js @@ -12,7 +12,7 @@ const PeerId = require('peer-id') const WS = require('libp2p-websockets') const MPLEX = require('libp2p-mplex') -const { NOISE } = require('libp2p-noise') +const { NOISE } = require('@chainsafe/libp2p-noise') const RelayPeer = require('./test/fixtures/relay') diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..de46e32616 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3db8bb122d..25f1413e11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,11 +22,11 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - node: [14, 16] + node: [16] fail-fast: true steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - run: npm install @mapbox/node-pre-gyp -g @@ -38,6 +38,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* - run: npm install - run: npx aegir test -t browser -t webworker --bail --timeout 60000 test-firefox: @@ -45,6 +48,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* - run: npm install - run: npx aegir test -t browser -t webworker --bail --timeout 60000 -- --browser firefox test-webkit: @@ -52,6 +58,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* - uses: microsoft/playwright-github-action@v1 - run: npm install - run: npx aegir test -t browser --bail --timeout 60000 -- --browser webkit @@ -60,6 +69,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* - run: npm install - run: npx xvfb-maybe aegir test -t electron-main --bail --timeout 60000 test-electron-renderer: @@ -67,5 +79,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* - run: npm install - run: npx xvfb-maybe aegir test -t electron-renderer --bail --timeout 60000 diff --git a/package.json b/package.json index 364d258f56..5a98846e2b 100644 --- a/package.json +++ b/package.json @@ -43,29 +43,29 @@ }, "homepage": "https://github.com/libp2p/js-libp2p-floodsub#readme", "devDependencies": { + "@chainsafe/libp2p-noise": "^4.1.1", "@types/debug": "^4.1.5", - "aegir": "^35.0.1", + "aegir": "^36.0.2", "benchmark": "^2.1.4", "buffer": "^6.0.3", "chai": "^4.3.4", - "ipfs-utils": "^8.1.0", + "ipfs-utils": "^9.0.2", "it-pair": "^1.0.0", - "libp2p": "^0.32.0", - "libp2p-interfaces-compliance-tests": "^1.0.1", + "libp2p": "^0.35.0", + "libp2p-interfaces-compliance-tests": "^2.0.3", "libp2p-mplex": "^0.10.3", - "libp2p-noise": "^4.0.0", "libp2p-websockets": "^0.16.0", "multiaddr": "^10.0.0", "multiformats": "^9.4.5", "os": "^0.1.1", "p-wait-for": "^3.1.0", - "peer-id": "^0.15.0", - "sinon": "^11.1.1", + "peer-id": "^0.16.0", + "sinon": "^12.0.1", "util": "^0.12.3" }, "dependencies": { "debug": "^4.2.0", - "libp2p-interfaces": "^1.0.1", + "libp2p-interfaces": "^2.0.1", "time-cache": "^0.3.0", "uint8arrays": "^3.0.0" }, diff --git a/test/floodsub.spec.js b/test/floodsub.spec.js index 5c9cd4b5e8..3325b33f48 100644 --- a/test/floodsub.spec.js +++ b/test/floodsub.spec.js @@ -77,6 +77,7 @@ describe('floodsub', () => { // receive the message once await floodsub._processRpc(peerStream.id.toB58String(), peerStream, rpc) + await floodsub.queue.onIdle() // should have received the message expect(callCount).to.equal(1) diff --git a/test/utils/create-peer.js b/test/utils/create-peer.js index b8383f78db..00ca6687b7 100644 --- a/test/utils/create-peer.js +++ b/test/utils/create-peer.js @@ -15,7 +15,7 @@ const PeerId = require('peer-id') const WS = require('libp2p-websockets') const filters = require('libp2p-websockets/src/filters') const MPLEX = require('libp2p-mplex') -const { NOISE } = require('libp2p-noise') +const { NOISE } = require('@chainsafe/libp2p-noise') const { isNode } = require('ipfs-utils/src/env')