Documentation ¶
Index ¶
- type P2PNode
- func (p *P2PNode) BanPeer(peer p2p.PeerID)
- func (p *P2PNode) Broadcast(location common.Location, data interface{}) error
- func (p *P2PNode) Connect(pi peer.AddrInfo) error
- func (p *P2PNode) GetBlockHashByNumber(number *big.Int, location common.Location) *common.Hash
- func (p *P2PNode) GetBootPeers() []peer.AddrInfo
- func (p *P2PNode) GetHeader(hash common.Hash, location common.Location) *types.WorkObject
- func (p *P2PNode) GetHostBackend() host.Host
- func (p *P2PNode) GetPeerManager() peerManager.PeerManager
- func (p *P2PNode) GetRequestManager() requestManager.RequestManager
- func (p *P2PNode) GetTrieNode(hash common.Hash, location common.Location) *trie.TrieNodeResponse
- func (p *P2PNode) GetWorkObject(hash common.Hash, location common.Location) *types.WorkObject
- func (p *P2PNode) MarkLatentPeer(peer p2p.PeerID, topic string)
- func (p *P2PNode) MarkLivelyPeer(peer p2p.PeerID, topic string)
- func (p *P2PNode) NewStream(peerID peer.ID) (network.Stream, error)
- func (p *P2PNode) ProtectPeer(peer p2p.PeerID)
- func (p *P2PNode) Request(location common.Location, requestData interface{}, ...) chan interface{}
- func (p *P2PNode) SetConsensusBackend(be quai.ConsensusAPI)
- func (p *P2PNode) Start() error
- func (p *P2PNode) Stop() error
- func (p *P2PNode) Subscribe(location common.Location, datatype interface{}) error
- func (p *P2PNode) UnprotectPeer(peer p2p.PeerID)
- func (p *P2PNode) Unsubscribe(location common.Location, datatype interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P2PNode ¶
type P2PNode struct {
// contains filtered or unexported fields
}
P2PNode represents a libp2p node
func NewNode ¶
Returns a new libp2p node. The node is created with the given context and options passed as arguments.
func (*P2PNode) GetBlockHashByNumber ¶
func (*P2PNode) GetBootPeers ¶
Returns the list of bootpeers
func (*P2PNode) GetHostBackend ¶
func (*P2PNode) GetPeerManager ¶
func (p *P2PNode) GetPeerManager() peerManager.PeerManager
func (*P2PNode) GetRequestManager ¶
func (p *P2PNode) GetRequestManager() requestManager.RequestManager
func (*P2PNode) GetTrieNode ¶
func (*P2PNode) GetWorkObject ¶
Search for a block in the node's cache, or query the consensus backend if it's not found in cache. Returns nil if the block is not found.
func (*P2PNode) ProtectPeer ¶
func (*P2PNode) Request ¶
func (p *P2PNode) Request(location common.Location, requestData interface{}, responseDataType interface{}) chan interface{}
Request a data from the network for the specified slice
func (*P2PNode) SetConsensusBackend ¶
func (p *P2PNode) SetConsensusBackend(be quai.ConsensusAPI)
func (*P2PNode) UnprotectPeer ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.