Documentation
    Preparing search index...

    React Native-specific options accepted by createNode, on top of the platform-agnostic NodeOptions.

    Hierarchy (View Summary)

    Index

    Properties

    addrs?: string[]

    Listening addresses.

    Defaults to defaultNodeListenAddrs.

    agentsReceivedCallback: AgentsReceivedCallback

    Called when agent-info bytes have been received from a peer.

    bootstrapRelays?: string[]

    Relay multiaddrs to dial at startup. Required on mobile — without an active relay reservation the peer is unreachable. The transport invokes NodeOptions.connectedToRelayCallback once the dialable circuit address has been received.

    connectedToRelayCallback?: ConnectedToRelayCallback

    Called when the bootstrap connection to a relay is complete.

    connectionGater?: ConnectionGater

    Overrides libp2p's connection gater.

    On React Native libp2p applies its browser gater, which refuses to dial insecure WebSocket (/ws) relays and private/LAN addresses. A production deployment behind a secure wss relay never hits this, but development and demo setups that target a cleartext relay or LAN peers must supply a gater that permits those dials (e.g. { denyDialMultiaddr: async () => false }).

    Left undefined, libp2p keeps its secure-by-default browser gater.

    handshakeTimeoutMs?: number

    Timeout in milliseconds for the outbound access handshake response. Defaults to 10_000 ms.

    iceServerUrls?: string[]

    List of ICE server URLs needed for establishing direct connections.

    id?: string

    Optional human-readable identifier attached to log records.

    messageHandler: MessageHandler

    Handler for incoming application messages.

    networkAccessBytes?: NetworkAccessBytes

    Network access bytes sent in handshake responses (and outbound handshakes for nodes).

    Defaults to new Uint8Array([0]) — an empty array breaks the counter-handshake because .send() would be a no-op.

    networkAccessHandler: NetworkAccessHandler

    Handler invoked for every incoming access handshake. Returns true to grant access, false to deny. Denials are sticky for the session.

    peerConnectedCallback: PeerConnectedCallback

    Called when an inbound peer completes the access handshake. Fire-and-forget.

    peerDisconnectedCallback?: PeerDisconnectedCallback

    Called when a peer disconnects. Fire-and-forget.