diff --git a/packages/interfaces/src/libp2p.ts b/packages/interfaces/src/libp2p.ts index 522b96cf5e..51905fa7a4 100644 --- a/packages/interfaces/src/libp2p.ts +++ b/packages/interfaces/src/libp2p.ts @@ -29,4 +29,5 @@ export type CreateLibp2pOptions = Libp2pOptions & { * @default false */ hideWebSocketInfo?: boolean; + pingMaxInboundStreams?: number; }; diff --git a/packages/sdk/src/utils/libp2p.ts b/packages/sdk/src/utils/libp2p.ts index 4cc31f702d..68414eb47e 100644 --- a/packages/sdk/src/utils/libp2p.ts +++ b/packages/sdk/src/utils/libp2p.ts @@ -70,7 +70,9 @@ export async function defaultLibp2p( identify: identify({ agentVersion: userAgent ?? DefaultUserAgent }), - ping: ping(), + ping: ping({ + maxInboundStreams: options?.pingMaxInboundStreams ?? 10 + }), ...metadataService, ...pubsubService, ...options?.services