Function zebra_network::connect_isolated

source ·
pub fn connect_isolated<PeerTransport>(
    network: &Network,
    data_stream: PeerTransport,
    user_agent: String,
) -> impl Future<Output = Result<Client, BoxError>>
where PeerTransport: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Expand description

Creates a Zcash peer connection using the provided data stream. This connection is completely isolated from all other node state.

The connection pool returned by init should be used for all requests that don’t require isolated state or use of an existing TCP connection. However, this low-level API is useful for custom network crawlers or Tor connections.

In addition to being completely isolated from all other node state, this function also aims to be minimally distinguishable from other clients.

SECURITY TODO: check if the timestamp field can be zeroed, to remove another distinguisher (#3300)

Note that this function does not implement any timeout behavior, so callers may want to layer it with a timeout as appropriate for their application.

§Inputs

  • network: the Zcash Network used for this connection.

  • data_stream: an existing data stream. This can be a non-anonymised TCP connection, or a Tor client arti_client::DataStream.

  • user_agent: a valid BIP14 user-agent, e.g., the empty string.