mirror of https://github.com/status-im/js-waku.git
Merge pull request #1987 from waku-org/feat/max-inbound-ping
feat: add libp2p option for max ping connections
This commit is contained in:
commit
bc98b4fb0d
|
@ -29,4 +29,5 @@ export type CreateLibp2pOptions = Libp2pOptions & {
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
hideWebSocketInfo?: boolean;
|
hideWebSocketInfo?: boolean;
|
||||||
|
pingMaxInboundStreams?: number;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,11 @@ import { wakuGossipSub } from "@waku/relay";
|
||||||
import { ensureShardingConfigured } from "@waku/utils";
|
import { ensureShardingConfigured } from "@waku/utils";
|
||||||
import { createLibp2p } from "libp2p";
|
import { createLibp2p } from "libp2p";
|
||||||
|
|
||||||
import { CreateWakuNodeOptions, DefaultUserAgent } from "../waku.js";
|
import {
|
||||||
|
CreateWakuNodeOptions,
|
||||||
|
DefaultPingMaxInboundStreams,
|
||||||
|
DefaultUserAgent
|
||||||
|
} from "../waku.js";
|
||||||
|
|
||||||
import { defaultPeerDiscoveries } from "./discovery.js";
|
import { defaultPeerDiscoveries } from "./discovery.js";
|
||||||
|
|
||||||
|
@ -70,7 +74,10 @@ export async function defaultLibp2p(
|
||||||
identify: identify({
|
identify: identify({
|
||||||
agentVersion: userAgent ?? DefaultUserAgent
|
agentVersion: userAgent ?? DefaultUserAgent
|
||||||
}),
|
}),
|
||||||
ping: ping(),
|
ping: ping({
|
||||||
|
maxInboundStreams:
|
||||||
|
options?.pingMaxInboundStreams ?? DefaultPingMaxInboundStreams
|
||||||
|
}),
|
||||||
...metadataService,
|
...metadataService,
|
||||||
...pubsubService,
|
...pubsubService,
|
||||||
...options?.services
|
...options?.services
|
||||||
|
|
|
@ -23,6 +23,7 @@ import { subscribeToContentTopic } from "./utils/content_topic.js";
|
||||||
export const DefaultPingKeepAliveValueSecs = 5 * 60;
|
export const DefaultPingKeepAliveValueSecs = 5 * 60;
|
||||||
export const DefaultRelayKeepAliveValueSecs = 5 * 60;
|
export const DefaultRelayKeepAliveValueSecs = 5 * 60;
|
||||||
export const DefaultUserAgent = "js-waku";
|
export const DefaultUserAgent = "js-waku";
|
||||||
|
export const DefaultPingMaxInboundStreams = 10;
|
||||||
|
|
||||||
const log = new Logger("waku");
|
const log = new Logger("waku");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue