Update libp2p, multiaddr & peer-id libraries (#60)

This commit is contained in:
folex 2021-08-18 20:13:40 +03:00 committed by GitHub
parent 0b91712964
commit f67ca787a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 865 additions and 2239 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@ bundle/
node_modules/
jspm_packages/
/dist/
.idea

3072
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,14 +26,14 @@
"cids": "0.8.1",
"it-length-prefixed": "3.0.1",
"it-pipe": "1.1.0",
"libp2p": "0.30.10",
"libp2p-crypto": "0.19.0",
"libp2p-mplex": "0.10.2",
"libp2p-noise": "2.0.5",
"libp2p-websockets": "0.15.3",
"libp2p": "0.32.3",
"libp2p-crypto": "0.19.7",
"libp2p-mplex": "0.10.4",
"@chainsafe/libp2p-noise": "4.0.0",
"libp2p-websockets": "0.16.1",
"loglevel": "1.7.0",
"multiaddr": "8.1.2",
"peer-id": "0.14.3",
"multiaddr": "10.0.0",
"peer-id": "0.15.3",
"uuid": "8.3.0"
},
"devDependencies": {

View File

@ -1,5 +1,5 @@
import log from 'loglevel';
import Multiaddr from 'multiaddr';
import { Multiaddr } from 'multiaddr';
import PeerId, { isPeerId } from 'peer-id';
import { CallServiceHandler } from './internal/CallServiceHandler';

View File

@ -1,5 +1,5 @@
import { checkConnection, createClient, FluenceClient } from '../../FluenceClient';
import Multiaddr from 'multiaddr';
import { Multiaddr } from 'multiaddr';
import { nodes } from '../connection';
import { RequestFlowBuilder } from '../../internal/RequestFlowBuilder';
import log from 'loglevel';

View File

@ -1,6 +1,6 @@
import { FluenceConnection } from '../../internal/FluenceConnection';
import Peer from 'libp2p';
import Multiaddr = require('multiaddr');
import { Multiaddr } from 'multiaddr';
import { generatePeerId } from '../../internal/peerIdUtils';
describe('Ws Transport', () => {

View File

@ -15,7 +15,7 @@
*/
import * as PeerId from 'peer-id';
import Multiaddr from 'multiaddr';
import { Multiaddr } from 'multiaddr';
import { FluenceConnection, FluenceConnectionOptions } from './FluenceConnection';
import { PeerIdB58 } from './commonTypes';
@ -123,7 +123,7 @@ export class ClientImpl implements FluenceClient {
}
async connect(multiaddr: string | Multiaddr, options?: FluenceConnectionOptions): Promise<void> {
multiaddr = Multiaddr(multiaddr);
multiaddr = new Multiaddr(multiaddr);
const nodePeerId = multiaddr.getPeerId();
if (!nodePeerId) {

View File

@ -21,9 +21,9 @@ import { decode, encode } from 'it-length-prefixed';
import pipe from 'it-pipe';
import * as log from 'loglevel';
import { logParticle, parseParticle, Particle, toPayload } from './particle';
import { NOISE } from 'libp2p-noise';
import { NOISE } from '@chainsafe/libp2p-noise';
import PeerId from 'peer-id';
import Multiaddr from 'multiaddr';
import { Multiaddr } from 'multiaddr';
import { all as allow_all } from 'libp2p-websockets/src/filters';
export const PROTOCOL_NAME = '/fluence/faas/1.0.0';
@ -105,7 +105,7 @@ export class FluenceConnection {
},
},
dialer: {
timeout: options?.dialTimeout,
dialTimeout: options?.dialTimeout,
},
});
}