From 0bdab0ee254e32d6dca0e5fe239d4ef16db41b87 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Fri, 17 Jun 2022 10:47:42 +0100 Subject: [PATCH] chore: update deps (#105) --- packages/libp2p-daemon-client/package.json | 6 +++--- packages/libp2p-daemon-server/package.json | 6 +++--- packages/libp2p-daemon-server/src/index.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/libp2p-daemon-client/package.json b/packages/libp2p-daemon-client/package.json index dc09d6be..6ac62576 100644 --- a/packages/libp2p-daemon-client/package.json +++ b/packages/libp2p-daemon-client/package.json @@ -135,18 +135,18 @@ "@libp2p/interface-peer-info": "^1.0.1", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.10", - "@libp2p/tcp": "^2.0.0", + "@libp2p/tcp": "^3.0.0", "@multiformats/multiaddr": "^10.1.8", "err-code": "^3.0.1", "it-stream-types": "^1.0.4", "multiformats": "^9.6.4" }, "devDependencies": { - "@libp2p/components": "^1.0.0", + "@libp2p/components": "^2.0.0", "@libp2p/daemon-server": "^2.0.0", "@libp2p/interface-compliance-tests": "^3.0.1", "@libp2p/interface-dht": "^1.0.0", - "@libp2p/interface-mocks": "^1.0.1", + "@libp2p/interface-mocks": "^2.0.1", "@libp2p/interface-peer-store": "^1.0.0", "@libp2p/interface-pubsub": "^1.0.1", "@libp2p/peer-id-factory": "^1.0.9", diff --git a/packages/libp2p-daemon-server/package.json b/packages/libp2p-daemon-server/package.json index 394b0420..2cfbf8d2 100644 --- a/packages/libp2p-daemon-server/package.json +++ b/packages/libp2p-daemon-server/package.json @@ -135,15 +135,15 @@ }, "dependencies": { "@libp2p/daemon-protocol": "^2.0.0", - "@libp2p/interface-connection": "^1.0.1", + "@libp2p/interface-connection": "^2.0.0", "@libp2p/interface-dht": "^1.0.0", "@libp2p/interface-peer-id": "^1.0.2", - "@libp2p/interface-registrar": "^1.0.0", + "@libp2p/interface-registrar": "^2.0.1", "@libp2p/interface-transport": "^1.0.0", "@libp2p/interfaces": "^3.0.2", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.10", - "@libp2p/tcp": "^2.0.0", + "@libp2p/tcp": "^3.0.0", "@multiformats/multiaddr": "^10.1.8", "it-drain": "^1.0.5", "it-length-prefixed": "^7.0.1", diff --git a/packages/libp2p-daemon-server/src/index.ts b/packages/libp2p-daemon-server/src/index.ts index b2184f83..201d5186 100644 --- a/packages/libp2p-daemon-server/src/index.ts +++ b/packages/libp2p-daemon-server/src/index.ts @@ -122,13 +122,13 @@ export class Server implements Libp2pServer { const peerId = peerIdFromBytes(peer) const connection = await this.libp2p.dial(peerId) - const { stream, protocol } = await connection.newStream(proto) + const stream = await connection.newStream(proto) return { streamInfo: { peer: peerId.toBytes(), addr: connection.remoteAddr.bytes, - proto: protocol + proto: stream.stat.protocol ?? '' }, connection: stream } @@ -157,11 +157,11 @@ export class Server implements Libp2pServer { await Promise.all( protocols.map(async (proto) => { // Connect the client socket with the libp2p connection - await this.libp2p.handle(proto, ({ connection, stream, protocol }) => { + await this.libp2p.handle(proto, ({ connection, stream }) => { const message = StreamInfo.encode({ peer: connection.remotePeer.toBytes(), addr: connection.remoteAddr.bytes, - proto: protocol + proto: stream.stat.protocol ?? '' }) const encodedMessage = lp.encode.single(message)