Documentation
¶
Overview ¶
Package p2p provides p2p connectivity for chestnut.
Package p2p provides a native implementation of the p2p network protocol.
Package p2p provides p2p connectivity for chestnut.
Package p2p provides p2p connectivity for chestnut.
Index ¶
- Constants
- func Ping(ctx context.Context, h host.Host, p peer.ID) <-chan Result
- type Node
- func (node *Node) AddPeers(ctx context.Context, peers []peer.AddrInfo) int
- func (node *Node) Bootstrap(ctx context.Context, config cli.Config) error
- func (node *Node) ConnectPeers(ctx context.Context, peerok chan struct{}, maxpeers int, config cli.Config) error
- func (node *Node) FindPeers(ctx context.Context, RendezvousString string) ([]peer.AddrInfo, error)
- func (node *Node) PeersProtocol() *map[string][]string
- type NodeInfo
- type PSPing
- type PingResult
- type PingService
- type Result
Constants ¶
View Source
const ( PingSize = 32 PingID = "/chestnut/ping/1.0.0" )
View Source
const ProtocolPrefix = "/chestnut"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct { PeerID peer.ID Host host.Host NetworkName string Pubsub *pubsub.PubSub Ddht *dual.DHT Info *NodeInfo RoutingDiscovery *discovery.RoutingDiscovery }
func (*Node) ConnectPeers ¶
func (*Node) PeersProtocol ¶
PeerProtocols returns the protocols supported by the peer.
type NodeInfo ¶
type NodeInfo struct {
NATType network.Reachability
}
type PSPing ¶
type PSPing struct { Topic *pubsub.Topic Subscription *pubsub.Subscription PeerId peer.ID // contains filtered or unexported fields }
func NewPSPingService ¶
func (*PSPing) EnablePing ¶
type PingResult ¶
type PingService ¶
func NewPingService ¶
func NewPingService(h host.Host) *PingService
func (*PingService) PingHandler ¶
func (ps *PingService) PingHandler(s network.Stream)
Click to show internal directories.
Click to hide internal directories.