pub trait Topology {
    fn addresses_of_peer(&mut self, peer: &PeerId) -> Vec<Multiaddr>;
    fn add_local_external_addrs<TIter>(&mut self, addrs: TIter)
    where
        TIter: Iterator<Item = Multiaddr>
; fn local_peer_id(&self) -> &PeerId; fn local_public_key(&self) -> &PublicKey; }
Expand description

Storage for the network topology.

The topology should also store information about the local node, including its public key, its PeerId, and the addresses it’s advertising.

Required Methods

Returns the addresses to try use to reach the given peer.

Note: Keep in mind that peer can be the local node.

Adds an address that other nodes can use to connect to our local node.

Note: Should later be returned when calling addresses_of_peer() with the PeerId of the local node.

Returns the PeerId of the local node.

Returns the public key of the local node.

Implementors