Documentation ¶
Overview ¶
Package ngp2p is the ngin p2p protocol implement based on libp2p
ngp2p uses libp2p(ipfs)'s dht for public peer discovery and mDNS for private, and uses pub-sub to work the broadcast net
the main peer-to-peer communication is based on Wired Protocol, which uses fast protobuf to encode and decode objects
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BootstrapNodes []multiaddr.Multiaddr
BootstrapNodes is a list of all bootstrap nodes
Functions ¶
This section is empty.
Types ¶
type LocalNode ¶
type LocalNode struct { host.Host // lib-p2p host P2PConfig P2PConfig *wired.Wired *broadcast.Broadcast // contains filtered or unexported fields }
LocalNode is the local host on p2p network
func InitLocalNode ¶
func InitLocalNode(chain *blockchain.Chain, config P2PConfig) *LocalNode
InitLocalNode creates a new node with its implemented protocols.
Click to show internal directories.
Click to hide internal directories.