Skip to content

Commit

Permalink
Some mild updates to help with initial connections and connection sta…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
islathehut committed Jan 2, 2025
1 parent 0c55d5c commit fc51152
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/backend/src/nest/libp2p/libp2p.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { gossipsub } from '@chainsafe/libp2p-gossipsub'
import { noise, pureJsCrypto } from '@chainsafe/libp2p-noise'
import { plaintext } from '@libp2p/plaintext'
import { yamux } from '@chainsafe/libp2p-yamux'

import { identify, identifyPush } from '@libp2p/identify'
import { PeerId, Stream, type Libp2p } from '@libp2p/interface'
import { Stream, type Libp2p } from '@libp2p/interface'
import { kadDHT } from '@libp2p/kad-dht'
import { keychain } from '@libp2p/keychain'
import { peerIdFromString } from '@libp2p/peer-id'
Expand Down Expand Up @@ -303,7 +302,7 @@ export class Libp2pService extends EventEmitter {
pubsub: gossipsub({
// neccessary to run a single peer
allowPublishToZeroTopicPeers: true,
fallbackToFloodsub: true,
fallbackToFloodsub: false,
emitSelf: true,
debugName: params.peerId.peerId.toString(),
doPX: true,
Expand All @@ -314,6 +313,7 @@ export class Libp2pService extends EventEmitter {
dht: kadDHT({
allowQueryWithZeroPeers: true,
clientMode: false,
initialQuerySelfInterval: 500,
}),
},
})
Expand Down

0 comments on commit fc51152

Please sign in to comment.