Documentation ¶
Overview ¶
Package p2p provides an network interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P2P ¶
type P2P interface { Start() Halt() Connect(addr string) error GetID() uint64 GetVersion() uint32 GetPort() uint16 GetCert() string SetAddr(string) GetAddr() string GetHttpInfoPort() uint16 GetRelay() bool GetHeight() uint64 GetTime() int64 GetServices() uint64 GetNeighbors() []*peer.Peer GetNeighborAddrs() []common.PeerAddr GetConnectionCnt() uint32 GetNp() *peer.NbrPeers GetPeer(uint64) *peer.Peer SetHeight(uint64) IsPeerEstablished(p *peer.Peer) bool Send(p *peer.Peer, msg types.Message) error GetMsgChan() chan *types.MsgPayload GetPeerFromAddr(addr string) *peer.Peer AddOutConnectingList(addr string) (added bool) GetOutConnRecordLen() int RemoveFromConnectingList(addr string) RemoveFromOutConnRecord(addr string) RemoveFromInConnRecord(addr string) AddPeerAddress(addr string, p *peer.Peer) GetOutConnectingListLen() (count uint) RemovePeerAddress(addr string) AddNbrNode(*peer.Peer) DelNbrNode(id uint64) (*peer.Peer, bool) NodeEstablished(uint64) bool Xmit(msg types.Message) SetOwnAddress(addr string) IsOwnAddress(addr string) bool IsAddrFromConnecting(addr string) bool }
P2P represent the net interface of p2p package
Click to show internal directories.
Click to hide internal directories.