disable libp2p autodial (#1437)

This commit is contained in:
Danish Arora 2023-07-26 12:20:51 +05:30 committed by GitHub
parent d483644a4b
commit 96b111d07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -166,6 +166,7 @@ export class ConnectionManager {
async dropConnection(peerId: PeerId): Promise<void> {
try {
this.keepAliveManager.stop(peerId);
await this.libp2p.hangUp(peerId);
log(`Dropped connection with peer ${peerId.toString()}`);
} catch (error) {

View File

@ -164,6 +164,9 @@ export async function defaultLibp2p(
: {};
return createLibp2p({
connectionManager: {
minConnections: 1,
},
transports: [webSockets({ filter: filterAll })],
streamMuxers: [mplex()],
connectionEncryption: [noise()],