mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-05 02:10:18 +00:00
Update libp2p, multiaddr & peer-id libraries (#60)
This commit is contained in:
parent
0b91712964
commit
f67ca787a7
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,3 +14,5 @@ bundle/
|
|||||||
node_modules/
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
/dist/
|
/dist/
|
||||||
|
|
||||||
|
.idea
|
||||||
|
3072
package-lock.json
generated
3072
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -26,14 +26,14 @@
|
|||||||
"cids": "0.8.1",
|
"cids": "0.8.1",
|
||||||
"it-length-prefixed": "3.0.1",
|
"it-length-prefixed": "3.0.1",
|
||||||
"it-pipe": "1.1.0",
|
"it-pipe": "1.1.0",
|
||||||
"libp2p": "0.30.10",
|
"libp2p": "0.32.3",
|
||||||
"libp2p-crypto": "0.19.0",
|
"libp2p-crypto": "0.19.7",
|
||||||
"libp2p-mplex": "0.10.2",
|
"libp2p-mplex": "0.10.4",
|
||||||
"libp2p-noise": "2.0.5",
|
"@chainsafe/libp2p-noise": "4.0.0",
|
||||||
"libp2p-websockets": "0.15.3",
|
"libp2p-websockets": "0.16.1",
|
||||||
"loglevel": "1.7.0",
|
"loglevel": "1.7.0",
|
||||||
"multiaddr": "8.1.2",
|
"multiaddr": "10.0.0",
|
||||||
"peer-id": "0.14.3",
|
"peer-id": "0.15.3",
|
||||||
"uuid": "8.3.0"
|
"uuid": "8.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
import Multiaddr from 'multiaddr';
|
import { Multiaddr } from 'multiaddr';
|
||||||
import PeerId, { isPeerId } from 'peer-id';
|
import PeerId, { isPeerId } from 'peer-id';
|
||||||
|
|
||||||
import { CallServiceHandler } from './internal/CallServiceHandler';
|
import { CallServiceHandler } from './internal/CallServiceHandler';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { checkConnection, createClient, FluenceClient } from '../../FluenceClient';
|
import { checkConnection, createClient, FluenceClient } from '../../FluenceClient';
|
||||||
import Multiaddr from 'multiaddr';
|
import { Multiaddr } from 'multiaddr';
|
||||||
import { nodes } from '../connection';
|
import { nodes } from '../connection';
|
||||||
import { RequestFlowBuilder } from '../../internal/RequestFlowBuilder';
|
import { RequestFlowBuilder } from '../../internal/RequestFlowBuilder';
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { FluenceConnection } from '../../internal/FluenceConnection';
|
import { FluenceConnection } from '../../internal/FluenceConnection';
|
||||||
import Peer from 'libp2p';
|
import Peer from 'libp2p';
|
||||||
import Multiaddr = require('multiaddr');
|
import { Multiaddr } from 'multiaddr';
|
||||||
import { generatePeerId } from '../../internal/peerIdUtils';
|
import { generatePeerId } from '../../internal/peerIdUtils';
|
||||||
|
|
||||||
describe('Ws Transport', () => {
|
describe('Ws Transport', () => {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as PeerId from 'peer-id';
|
import * as PeerId from 'peer-id';
|
||||||
import Multiaddr from 'multiaddr';
|
import { Multiaddr } from 'multiaddr';
|
||||||
import { FluenceConnection, FluenceConnectionOptions } from './FluenceConnection';
|
import { FluenceConnection, FluenceConnectionOptions } from './FluenceConnection';
|
||||||
|
|
||||||
import { PeerIdB58 } from './commonTypes';
|
import { PeerIdB58 } from './commonTypes';
|
||||||
@ -123,7 +123,7 @@ export class ClientImpl implements FluenceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async connect(multiaddr: string | Multiaddr, options?: FluenceConnectionOptions): Promise<void> {
|
async connect(multiaddr: string | Multiaddr, options?: FluenceConnectionOptions): Promise<void> {
|
||||||
multiaddr = Multiaddr(multiaddr);
|
multiaddr = new Multiaddr(multiaddr);
|
||||||
|
|
||||||
const nodePeerId = multiaddr.getPeerId();
|
const nodePeerId = multiaddr.getPeerId();
|
||||||
if (!nodePeerId) {
|
if (!nodePeerId) {
|
||||||
|
@ -21,9 +21,9 @@ import { decode, encode } from 'it-length-prefixed';
|
|||||||
import pipe from 'it-pipe';
|
import pipe from 'it-pipe';
|
||||||
import * as log from 'loglevel';
|
import * as log from 'loglevel';
|
||||||
import { logParticle, parseParticle, Particle, toPayload } from './particle';
|
import { logParticle, parseParticle, Particle, toPayload } from './particle';
|
||||||
import { NOISE } from 'libp2p-noise';
|
import { NOISE } from '@chainsafe/libp2p-noise';
|
||||||
import PeerId from 'peer-id';
|
import PeerId from 'peer-id';
|
||||||
import Multiaddr from 'multiaddr';
|
import { Multiaddr } from 'multiaddr';
|
||||||
import { all as allow_all } from 'libp2p-websockets/src/filters';
|
import { all as allow_all } from 'libp2p-websockets/src/filters';
|
||||||
|
|
||||||
export const PROTOCOL_NAME = '/fluence/faas/1.0.0';
|
export const PROTOCOL_NAME = '/fluence/faas/1.0.0';
|
||||||
@ -105,7 +105,7 @@ export class FluenceConnection {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
dialer: {
|
dialer: {
|
||||||
timeout: options?.dialTimeout,
|
dialTimeout: options?.dialTimeout,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user