From 39526c7e9b9867ebc99b7bf9402fcbd476c9b964 Mon Sep 17 00:00:00 2001 From: droak Date: Mon, 23 Dec 2024 05:29:44 +0900 Subject: [PATCH] deps: upgrade circuit-relay --- packages/network/package.json | 2 +- packages/network/src/node.ts | 12 ++++-------- pnpm-lock.yaml | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/network/package.json b/packages/network/package.json index 1c659c31..4ca4e1e3 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -32,7 +32,7 @@ "@chainsafe/libp2p-yamux": "^7.0.1", "@libp2p/autonat": "^2.0.6", "@libp2p/bootstrap": "^11.0.6", - "@libp2p/circuit-relay-v2": "^2.1.5", + "@libp2p/circuit-relay-v2": "^3.1.3", "@libp2p/crypto": "^5.0.5", "@libp2p/dcutr": "^2.0.6", "@libp2p/devtools-metrics": "^1.1.5", diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index 1b4bf35c..f8a125fd 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -117,7 +117,9 @@ export class DRPNetworkNode { this._node = await createLibp2p({ privateKey: this._privateKey, addresses: { - listen: this._config?.addresses ? this._config.addresses : ["/webrtc"], + listen: this._config?.addresses + ? this._config.addresses + : ["/p2p-circuit", "/webrtc"], }, connectionEncrypters: [noise()], connectionGater: { @@ -130,10 +132,7 @@ export class DRPNetworkNode { services: this._config?.bootstrap ? _bootstrap_services : _node_services, streamMuxers: [yamux()], transports: [ - circuitRelayTransport({ - discoverRelays: 2, - reservationConcurrency: 1, - }), + circuitRelayTransport(), webRTC(), webRTCDirect(), webSockets({ @@ -143,9 +142,6 @@ export class DRPNetworkNode { ], }); - console.log(this._node.status); - console.log("ma:", this._node.getMultiaddrs()); - if (!this._config?.bootstrap) { for (const addr of this._config?.bootstrap_peers || []) { try { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 448447a6..86d4465b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,8 +170,8 @@ importers: specifier: ^11.0.6 version: 11.0.16 '@libp2p/circuit-relay-v2': - specifier: ^2.1.5 - version: 2.1.5 + specifier: ^3.1.3 + version: 3.1.6 '@libp2p/crypto': specifier: ^5.0.5 version: 5.0.8 @@ -1567,8 +1567,8 @@ packages: '@libp2p/bootstrap@11.0.16': resolution: {integrity: sha512-GmIkQuZwWFOnEBuUM0eRma/PjS0iCgc7Yl8X54QxqbmjB04DMqz2sGgmP+2gmiB38CIj1WGz4DTiTaECiyut2Q==} - '@libp2p/circuit-relay-v2@2.1.5': - resolution: {integrity: sha512-7uJicxChosVPcj7r9xmeI2Z318sgOk2VclagPWjTFCZSMdSHPtou8G4i0CJEoWAI+Afpxuz0h8aPb90MpVbWCA==} + '@libp2p/circuit-relay-v2@3.1.6': + resolution: {integrity: sha512-47ocamyjMlGM9HgVo2BZI/yUuSM03GugTu03KjS1Wx/mLDq3WSpUVk1qMS4v1ZpOwXTnKlk5e3sp/t9K5PHCjw==} '@libp2p/crypto@5.0.8': resolution: {integrity: sha512-3ZxuzqMvyLXhRnjT3sjvzCCW4zkO9UKgv75KfqExP3k1Yk/Zbb+oM2z7OgnDycvLGxnRZgGwizrgnWpZvXlDEA==} @@ -4384,8 +4384,8 @@ packages: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} - retimeable-signal@0.0.0: - resolution: {integrity: sha512-jxnBbSwD7khkZIf0cnD6j3BVawwhrbcT4y1WWWZq14l5Ds+z+csataLeBSRtKVqn5tjuT4WPCbMDJLKI2C/WUA==} + retimeable-signal@1.0.1: + resolution: {integrity: sha512-Cy26CYfbWnYu8HMoJeDhaMpW/EYFIbne3vMf6G9RSrOyWYXbPehja/BEdzpqmM84uy2bfBD7NPZhoQ4GZEtgvg==} retry@0.13.1: resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} @@ -6471,7 +6471,7 @@ snapshots: '@multiformats/mafmt': 12.1.6 '@multiformats/multiaddr': 12.3.4 - '@libp2p/circuit-relay-v2@2.1.5': + '@libp2p/circuit-relay-v2@3.1.6': dependencies: '@libp2p/crypto': 5.0.8 '@libp2p/interface': 2.3.0 @@ -6486,10 +6486,10 @@ snapshots: it-protobuf-stream: 1.1.5 it-stream-types: 2.0.2 multiformats: 13.3.1 + nanoid: 5.0.9 progress-events: 1.0.1 protons-runtime: 5.5.0 - race-signal: 1.1.0 - retimeable-signal: 0.0.0 + retimeable-signal: 1.0.1 uint8arraylist: 2.4.8 uint8arrays: 5.1.0 @@ -10032,7 +10032,7 @@ snapshots: onetime: 7.0.0 signal-exit: 4.1.0 - retimeable-signal@0.0.0: {} + retimeable-signal@1.0.1: {} retry@0.13.1: {}