File tree Expand file tree Collapse file tree 9 files changed +19
-4
lines changed
js-libp2p-example-auto-tls
js-libp2p-example-discovery-mechanisms
js-libp2p-example-peer-and-content-routing Expand file tree Collapse file tree 9 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ routing table and perform queries:
253253 import { identify, identifyPush } from '@libp2p/identify'
254254+ import { kadDHT, removePrivateAddressesMapper } from '@libp2p/kad-dht'
255255 import { keychain } from '@libp2p/keychain'
256+ + import { ping } from '@libp2p/ping'
256257+ import { tcp } from '@libp2p/tcp'
257258 import { uPnPNAT } from '@libp2p/upnp-nat'
258259```
@@ -282,6 +283,7 @@ routing table and perform queries:
282283+ }),
283284 upnp: uPnPNAT(),
284285 identify: identify(),
286+ + ping: ping(),
285287```
286288
287289If you are running on your own network which has better support for varied
Original file line number Diff line number Diff line change 2525 "@libp2p/identify" : " ^3.0.13" ,
2626 "@libp2p/kad-dht" : " ^14.1.4" ,
2727 "@libp2p/keychain" : " ^5.0.11" ,
28+ "@libp2p/ping" : " ^2.0.27" ,
2829 "@libp2p/upnp-nat" : " ^3.0.1" ,
2930 "@libp2p/websockets" : " ^9.1.0" ,
3031 "@multiformats/multiaddr-matcher" : " ^1.6.0" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { loadOrCreateSelfKey } from '@libp2p/config'
1111import { identify , identifyPush } from '@libp2p/identify'
1212import { kadDHT , removePrivateAddressesMapper } from '@libp2p/kad-dht'
1313import { keychain } from '@libp2p/keychain'
14+ import { ping } from '@libp2p/ping'
1415import { tcp } from '@libp2p/tcp'
1516import { uPnPNAT } from '@libp2p/upnp-nat'
1617import { webSockets } from '@libp2p/websockets'
@@ -46,6 +47,7 @@ const libp2p = await createLibp2p({
4647 // needed to run KAD-DHT and to be contacted by libp2p.direct
4748 identify : identify ( ) ,
4849 identifyPush : identifyPush ( ) ,
50+ ping : ping ( ) ,
4951
5052 // used to securely store the certificate for use after a restart
5153 keychain : keychain ( ) ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { yamux } from '@chainsafe/libp2p-yamux'
55import { bootstrap } from '@libp2p/bootstrap'
66import { identify } from '@libp2p/identify'
77import { kadDHT , removePublicAddressesMapper } from '@libp2p/kad-dht'
8+ import { ping } from '@libp2p/ping'
89import { tcp } from '@libp2p/tcp'
910import { createLibp2p } from 'libp2p'
1011import bootstrappers from './bootstrappers.js'
@@ -27,7 +28,8 @@ const node = await createLibp2p({
2728 peerInfoMapper : removePublicAddressesMapper ,
2829 clientMode : false
2930 } ) ,
30- identify : identify ( )
31+ identify : identify ( ) ,
32+ ping : ping ( )
3133 }
3234} )
3335
Original file line number Diff line number Diff line change 2424 "@libp2p/identify" : " ^3.0.0" ,
2525 "@libp2p/kad-dht" : " ^14.0.0" ,
2626 "@libp2p/mdns" : " ^11.0.0" ,
27+ "@libp2p/ping" : " ^2.0.27" ,
2728 "@libp2p/pubsub-peer-discovery" : " ^11.0.0" ,
2829 "@libp2p/tcp" : " ^10.0.0" ,
2930 "libp2p" : " ^2.0.0"
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { noise } from '@chainsafe/libp2p-noise'
44import { yamux } from '@chainsafe/libp2p-yamux'
55import { identify , identifyPush } from '@libp2p/identify'
66import { kadDHT , removePublicAddressesMapper } from '@libp2p/kad-dht'
7+ import { ping } from '@libp2p/ping'
78import { tcp } from '@libp2p/tcp'
89import { createLibp2p } from 'libp2p'
910
@@ -23,7 +24,8 @@ const createNode = async () => {
2324 clientMode : false
2425 } ) ,
2526 identify : identify ( ) ,
26- identifyPush : identifyPush ( )
27+ identifyPush : identifyPush ( ) ,
28+ ping : ping ( )
2729 }
2830 } )
2931
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { noise } from '@chainsafe/libp2p-noise'
44import { yamux } from '@chainsafe/libp2p-yamux'
55import { identify , identifyPush } from '@libp2p/identify'
66import { kadDHT , removePublicAddressesMapper } from '@libp2p/kad-dht'
7+ import { ping } from '@libp2p/ping'
78import { tcp } from '@libp2p/tcp'
89import all from 'it-all'
910import { createLibp2p } from 'libp2p'
@@ -24,7 +25,8 @@ const createNode = async () => {
2425 clientMode : false
2526 } ) ,
2627 identify : identify ( ) ,
27- identifyPush : identifyPush ( )
28+ identifyPush : identifyPush ( ) ,
29+ ping : ping ( )
2830 }
2931 } )
3032
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { noise } from '@chainsafe/libp2p-noise'
2222import { yamux } from ' @chainsafe/libp2p-yamux'
2323import { identify , identifyPush } from ' @libp2p/identify'
2424import { kadDHT , removePublicAddressesMapper } from ' @libp2p/kad-dht'
25+ import { ping } from ' @libp2p/ping'
2526import { tcp } from ' @libp2p/tcp'
2627import { createLibp2p } from ' libp2p'
2728
@@ -41,7 +42,8 @@ const createNode = async () => {
4142 clientMode: false
4243 }),
4344 identify: identify (),
44- identifyPush: identifyPush ()
45+ identifyPush: identifyPush (),
46+ ping: ping ()
4547 }
4648 })
4749
Original file line number Diff line number Diff line change 2121 "@chainsafe/libp2p-yamux" : " ^7.0.0" ,
2222 "@libp2p/identify" : " ^3.0.1" ,
2323 "@libp2p/kad-dht" : " ^14.0.0" ,
24+ "@libp2p/ping" : " ^2.0.27" ,
2425 "@libp2p/tcp" : " ^10.0.0" ,
2526 "it-all" : " ^3.0.2" ,
2627 "libp2p" : " ^2.0.0" ,
You can’t perform that action at this time.
0 commit comments