Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P2P ¶
type P2P struct {
// Represents the host context layer
Ctx context.Context
// Represents the libp2p host
Host host.Host
// Represents the DHT routing table
KadDHT *dht.IpfsDHT
// Represents the peer discovery service
Discovery *discoveryRouting.RoutingDiscovery
// Represents the PubSub Handler
PubSub *pubsub.PubSub
// contains filtered or unexported fields
}
func (*P2P) AdvertiseConnect ¶
func (p2p *P2P) AdvertiseConnect()
A method of P2P to connect to service peers. This method uses the Advertise() functionality of the Peer Discovery Service to advertise the service and then disovers all peers advertising the same. The peer discovery is handled by a go-routine that will read from a channel of peer address information until the peer channel closes
func (*P2P) AnnounceConnect ¶
func (p2p *P2P) AnnounceConnect()
A method of P2P to connect to service peers. This method uses the Provide() functionality of the Kademlia DHT directly to announce the ability to provide the service and then disovers all peers that provide the same. The peer discovery is handled by a go-routine that will read from a channel of peer address information until the peer channel closes