Establish a connection to a known peer by its full address.
If the connection is routed through a relay, the address must include the relay address.
The dialable address of the node to connect to
Create a new bi-directional byte stream on an open connection.
Allows for reusing an open connection for exchaning any kind of data, e.g. audio or video data.
The node ID of the connection to create a stream for
The name and version of the stream protocol
Disconnect from the peer.
The node ID to disconnect from
Return the node IDs of all currently connected peers.
Return the transport's actual dial addresses after startup.
Each string is a fully-qualified address that peers can use to connect, including the node's identity suffix where the transport requires it.
Use this to obtain the relay's dial address rather than constructing it from config.
Get the transport-level identifier of this node.
Is there an active connection to the provided node?
The node ID to check
Is the connection to the provided node a direct connection?
false means the connection is relayed.
The node ID of the connection to check
Register a handler for incoming streams on the given protocol.
The handler is called once per incoming stream, after the access check has passed. Can be called after transport construction.
The protocol identifier to handle
Called with the initiating peer's NodeId and the stream
Send an opaque application message to a peer. The peer must be connected and have been granted access.
The ID of the target node
The message to send to the node
Send opaque agent-info bytes to a peer. The peer must be connected and have been granted access.
The ID of the target node
The list of agents to send to the node
Shut down the transport and all underlying connections.
Interface that defines the methods a peerkit transport needs to implement