Documentation ¶
Overview ¶
Package overlay spec outline
spin up host/peer that will be a part of the overlay network
spin up host/peer that will connect to public dht to perform rendezvous
perform rendezvous on the namespace of the overlay dht 'name', i.e. 'cat-pics-0001'
if there are any peers in the namespace,
send a 'request' to them for their associated peer address, i.e. thethe peer/host connected to the overlay dht
hand the responded address to the peer associated with the current peer
the associated peer will then perform a bootstrapping to the provided address
future optimizations:
only require the last n peers to stay in the public dht network providing the rendezvous service
if the number of peers in the overlay network drop below n, spin the public peer up and start rendezvous again
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { RendezvousString string BootstrapPeers addrList ListenAddresses addrList OverlayListenAddresses addrList ProtocolID string }
Config provides the configuration required to start the overlay nodes
type Coordinator ¶
type Coordinator struct { *Identity Config PublicPeer, OverlayPeer host.Host PublicDHT, OverlayDHT *dht.IpfsDHT // contains filtered or unexported fields }
Coordinator represents a Peer that connects to the Public DHT, a Peer that connects to an overlay DHT and the communication communication channels in between those peers.
func NewCoordinator ¶
func NewCoordinator(ctx context.Context, config Config) (*Coordinator, error)
NewCoordinator is a constructor for the Coordinator type.
type Identity ¶
Identity is the private keys of the two peers.
func LoadIdentity ¶
LoadIdentity loads a json config from a path.