Skip to content

Commit

Permalink
feat: add libp2p option for max ping connections
Browse files Browse the repository at this point in the history
  • Loading branch information
adklempner committed Apr 27, 2024
1 parent 86249df commit aa6d956
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/interfaces/src/libp2p.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export type CreateLibp2pOptions = Libp2pOptions & {
* @default false
*/
hideWebSocketInfo?: boolean;
pingMaxInboundStreams?: number;
};
4 changes: 3 additions & 1 deletion packages/sdk/src/utils/libp2p.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa6d956

Please sign in to comment.