CreateNodeOptions: {
    autoStart?: boolean;
    bootstrapPeers?: string[];
    connectionManager?: Partial<ConnectionManagerOptions>;
    defaultBootstrap?: boolean;
    filter?: Partial<FilterProtocolOptions>;
    libp2p?: Partial<CreateLibp2pOptions>;
    lightPush?: Partial<LightPushProtocolOptions>;
    networkConfig?: NetworkConfig;
    numPeersToUse?: number;
    staticNoiseKey?: Uint8Array;
    store?: Partial<StoreProtocolOptions>;
    userAgent?: string;
}

Type declaration

  • Optional autoStart?: boolean

    Starts Waku node automatically upon creations. Calls @waku/sdk!WakuNode.start before returning @waku/sdk!WakuNode

    Default

    true
    
  • Optional bootstrapPeers?: string[]

    List of peers to use to bootstrap the node. Ignored if defaultBootstrap is set to true.

  • Optional connectionManager?: Partial<ConnectionManagerOptions>

    Configuration for connection manager. If not specified - default values are applied.

  • Optional defaultBootstrap?: boolean

    Use recommended bootstrap method to discovery and connect to new nodes.

  • Optional filter?: Partial<FilterProtocolOptions>

    Configuration for Filter protocol. If not specified - default values are applied.

  • Optional libp2p?: Partial<CreateLibp2pOptions>

    You can pass options to the Libp2p instance used by @waku/sdk!WakuNode using the libp2p property. This property is the same type as the one passed to Libp2p.create apart that we made the modules property optional and partial, allowing its omission and letting Waku set good defaults. Notes that some values are overridden by @waku/sdk!WakuNode to ensure it implements the Waku protocol.

  • Optional lightPush?: Partial<LightPushProtocolOptions>

    Options for the LightPush protocol. If not specified - default values are applied.

  • Optional networkConfig?: NetworkConfig

    Configuration for determining the network in use. Network configuration refers to the shards and clusters used in the network.

    If using Static Sharding: Cluster ID and shards are specified in the format: clusterId: number, shards: number[] The default value is configured for The Waku Network => clusterId: 0, shards: [0, 1, 2, 3, 4, 5, 6, 7] To learn more about the sharding specification, see Relay Sharding.

    If using Auto Sharding: Cluster ID and content topics are specified in the format: clusterId: number, contentTopics: string[] Content topics are used to determine the shards to be configured for the network. Cluster ID is optional, and defaults to The Waku Network's cluster ID => 0 To specify content topics, see Waku v2 Topic Usage Recommendations for details

    Default

    { clusterId: 1, shards: [0, 1, 2, 3, 4, 5, 6, 7] }
    
  • Optional numPeersToUse?: number

    Number of peers to connect to, for the usage of the protocol. This is used by Filter to retrieve messages.

    Default

    2.
    
  • Optional staticNoiseKey?: Uint8Array

    Byte array used as key for the noise protocol used for connection encryption by Libp2p.create This is only used for test purposes to not run out of entropy during CI runs.

  • Optional store?: Partial<StoreProtocolOptions>

    Options for the Store protocol. If not specified - default values are applied.

  • Optional userAgent?: string

    Set the user agent string to be used in identification of the node.

    Default

    "js-waku"