Documentation
    Preparing search index...

    Class PeerkitNodeBuilder

    Builds a PeerkitNode.

    networkAccessHandler and messageHandler are required; everything else is optional and can be supplied via the fluent setters before calling build.

    const node = await new PeerkitNodeBuilder({
    agentKeyStore,
    networkAccessHandler: async () => true,
    messageHandler: async (fromAgent, data) => { ... },
    })
    .withId("node1")
    .withBootstrapRelays([relayAddress])
    .build();
    Index

    Constructors

    Properties

    addresses?: string[]
    agentKeyStore: IAgentKeyStore
    agentsReceivedObserver?: (agentIds: string[]) => void
    agentStore?: IAgentStore
    bootstrapRelays: string[] = []
    connectedToRelayObserver?: (address: string) => void
    iceServerUrls?: string[]
    id?: string
    messageHandler: AppMessageHandler
    networkAccessBytes?: NetworkAccessBytes
    networkAccessHandler: NetworkAccessHandler
    nodeTransportFactory?: PeerkitNodeTransportFactory
    peerConnectedObserver?: (fromAgent: string) => void
    peerDisconnectedObserver?: (fromAgent: string) => void

    Methods

    • Parameters

      • addresses: string[]

      Returns this

    • Parameters

      • fn: (agentIds: string[]) => void

      Returns this

    • Parameters

      • relays: string[]

      Returns this

    • Parameters

      • urls: string[]

      Returns this

    • Parameters

      • id: string

      Returns this

    • Parameters

      • fn: (fromAgent: string) => void

      Returns this

    • Parameters

      • fn: (fromAgent: string) => void

      Returns this

    • Parameters

      • fn: (address: string) => void

      Returns this