feat: add libp2p option for max ping connections

This commit is contained in:
Arseniy Klempner 2024-04-26 17:19:22 -07:00
parent 0ffce07924
commit ea43068848
No known key found for this signature in database
GPG Key ID: 51653F18863BD24B
2 changed files with 4 additions and 1 deletions

View File

@ -29,4 +29,5 @@ export type CreateLibp2pOptions = Libp2pOptions & {
* @default false
*/
hideWebSocketInfo?: boolean;
pingMaxInboundStreams?: number;
};

View File

@ -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