diff --git a/package-lock.json b/package-lock.json index 88f0acc..93ed2d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@libp2p/identify": "3.0.18", "@libp2p/keychain": "5.0.14", "@libp2p/logger": "5.1.8", + "@libp2p/ping": "2.0.18", "@libp2p/tcp": "10.0.19", "@libp2p/webrtc": "5.1.0", "@libp2p/websockets": "9.1.5", @@ -15595,6 +15596,7 @@ "resolved": "http://94.130.170.209:4873/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "license": "MIT", + "peer": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -24877,6 +24879,7 @@ "resolved": "http://94.130.170.209:4873/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "license": "ISC", + "peer": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" diff --git a/package.json b/package.json index dbe86fd..bf4c405 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@libp2p/identify": "3.0.18", "@libp2p/keychain": "5.0.14", "@libp2p/logger": "5.1.8", + "@libp2p/ping": "2.0.18", "@libp2p/tcp": "10.0.19", "@libp2p/webrtc": "5.1.0", "@libp2p/websockets": "9.1.5", diff --git a/src/adapters/ipfs/ipfs.js b/src/adapters/ipfs/ipfs.js index a0aafec..17c9237 100644 --- a/src/adapters/ipfs/ipfs.js +++ b/src/adapters/ipfs/ipfs.js @@ -31,6 +31,7 @@ import { keychain } from '@libp2p/keychain' import { unixfs } from '@helia/unixfs' import { generateKeyPairFromSeed } from '@libp2p/crypto/keys' import crypto from 'crypto' +import { ping } from '@libp2p/ping' // Local libraries import config from '../../../config/index.js' @@ -126,7 +127,8 @@ class IpfsAdapter { // Configure services const services = { identify: identify(), - pubsub: gossipsub({ allowPublishToZeroTopicPeers: true }) + pubsub: gossipsub({ allowPublishToZeroTopicPeers: true }), + ping: ping() } if (this.config.isCircuitRelay) { console.log('Helia (IPFS) node IS configured as Circuit Relay') @@ -167,7 +169,8 @@ class IpfsAdapter { '/ip4/127.0.0.1/tcp/0', `/ip4/0.0.0.0/tcp/${this.config.ipfsTcpPort}`, `/ip4/0.0.0.0/tcp/${this.config.ipfsWsPort}/ws`, - '/webrtc' + '/webrtc', + '/p2p-circuit' ] }, transports,