Update libp2p-related packages versions. Fix 'stream reset' error. (#123)

This commit is contained in:
Pavel 2022-01-27 16:05:20 +03:00 committed by GitHub
parent d9ee6e2cb5
commit 48caa02d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 608 additions and 487 deletions

1031
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,22 +19,22 @@
"copy-avm-public": "dist/tools/copyAvmPublic.js"
},
"dependencies": {
"@chainsafe/libp2p-noise": "4.0.0",
"@fluencelabs/avm-runner-background": "0.1.2",
"@chainsafe/libp2p-noise": "^4.1.1",
"@fluencelabs/avm": "0.20.0",
"@fluencelabs/avm-runner-background": "0.1.2",
"@fluencelabs/avm-runner-interface": "^0.2.0",
"async": "3.2.0",
"bs58": "4.0.1",
"cids": "0.8.1",
"it-length-prefixed": "3.0.1",
"it-pipe": "1.1.0",
"libp2p": "0.32.3",
"libp2p-crypto": "0.19.7",
"libp2p-mplex": "0.10.4",
"libp2p-websockets": "0.16.1",
"libp2p": "=0.33.0",
"libp2p-crypto": "=0.20.0",
"libp2p-mplex": "=0.10.2",
"libp2p-websockets": "^0.16.2",
"loglevel": "1.7.0",
"multiaddr": "10.0.0",
"peer-id": "0.15.3",
"multiaddr": "^10.0.1",
"peer-id": "=0.15.4",
"rxjs": "^7.3.0",
"ts-pattern": "^3.3.3",
"uuid": "8.3.0"

View File

@ -82,6 +82,7 @@ export class FluenceConnection {
res._lib2p2Peer.handle([PROTOCOL_NAME], async ({ connection, stream }) => {
pipe(stream.source, decode(), async (source: AsyncIterable<string>) => {
try {
for await (const msg of source) {
try {
const particle = Particle.fromString(msg);
@ -90,6 +91,9 @@ export class FluenceConnection {
log.error('error on handling a new incoming message: ' + e);
}
}
} catch (e) {
log.debug('connection closed: ' + e);
}
});
});