Documentation ¶
Index ¶
- type NbrPeers
- func (this *NbrPeers) AddNbrNode(p *Peer)
- func (this *NbrPeers) Broadcast(msg types.Message)
- func (this *NbrPeers) DelNbrNode(id uint64) (*Peer, bool)
- func (this *NbrPeers) GetNbrNodeCnt() uint32
- func (this *NbrPeers) GetNeighborAddrs() []common.PeerAddr
- func (this *NbrPeers) GetNeighborHeights() map[uint64]uint64
- func (this *NbrPeers) GetNeighbors() []*Peer
- func (this *NbrPeers) GetPeer(id uint64) *Peer
- func (this *NbrPeers) Init()
- func (this *NbrPeers) NodeEstablished(id uint64) bool
- func (this *NbrPeers) NodeExisted(uid uint64) bool
- type Peer
- func (this *Peer) AttachChan(msgchan chan *types.MsgPayload)
- func (this *Peer) Close()
- func (this *Peer) DumpInfo()
- func (this *Peer) GetAddr() string
- func (this *Peer) GetAddr16() ([16]byte, error)
- func (this *Peer) GetContactTime() time.Time
- func (this *Peer) GetHeight() uint64
- func (this *Peer) GetHttpInfoPort() uint16
- func (this *Peer) GetHttpInfoState() bool
- func (this *Peer) GetID() uint64
- func (this *Peer) GetPort() uint16
- func (this *Peer) GetRelay() bool
- func (this *Peer) GetServices() uint64
- func (this *Peer) GetSoftVersion() string
- func (this *Peer) GetState() uint32
- func (this *Peer) GetTimeStamp() int64
- func (this *Peer) GetVersion() uint32
- func (this *Peer) Send(msg types.Message) error
- func (this *Peer) SendRaw(msgType string, msgPayload []byte) error
- func (this *Peer) SetHeight(height uint64)
- func (this *Peer) SetHttpInfoPort(port uint16)
- func (this *Peer) SetHttpInfoState(httpInfo bool)
- func (this *Peer) SetState(state uint32)
- func (this *Peer) UpdateInfo(t time.Time, version uint32, services uint64, syncPort uint16, nonce uint64, ...)
- type PeerCom
- func (this *PeerCom) GetHeight() uint64
- func (this *PeerCom) GetHttpInfoPort() uint16
- func (this *PeerCom) GetID() uint64
- func (this *PeerCom) GetPort() uint16
- func (this *PeerCom) GetRelay() bool
- func (this *PeerCom) GetServices() uint64
- func (this *PeerCom) GetSoftVersion() string
- func (this *PeerCom) GetVersion() uint32
- func (this *PeerCom) SetHeight(height uint64)
- func (this *PeerCom) SetHttpInfoPort(port uint16)
- func (this *PeerCom) SetID(id uint64)
- func (this *PeerCom) SetPort(port uint16)
- func (this *PeerCom) SetRelay(relay bool)
- func (this *PeerCom) SetServices(services uint64)
- func (this *PeerCom) SetSoftVersion(softVer string)
- func (this *PeerCom) SetVersion(version uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NbrPeers ¶
NbrPeers: The neigbor list
func (*NbrPeers) AddNbrNode ¶
AddNbrNode add peer to nbr list
func (*NbrPeers) DelNbrNode ¶
DelNbrNode delete peer from nbr list
func (*NbrPeers) GetNbrNodeCnt ¶
GetNbrNodeCnt return count of establish peers in nbrlist
func (*NbrPeers) GetNeighborAddrs ¶
GetNeighborAddrs return all establish peer address
func (*NbrPeers) GetNeighborHeights ¶
GetNeighborHeights return the id-height map of nbr peers
func (*NbrPeers) GetNeighbors ¶
GetNeighbors return all establish peers in nbr list
func (*NbrPeers) NodeEstablished ¶
NodeEstablished whether peer established according to id
func (*NbrPeers) NodeExisted ¶
NodeExisted return when peer in nbr list
type Peer ¶
Peer represent the node in p2p
func (*Peer) AttachChan ¶ added in v1.6.2
func (this *Peer) AttachChan(msgchan chan *types.MsgPayload)
AttachChan set msg chan to sync link
func (*Peer) GetContactTime ¶
GetContactTime return peer`s latest contact time in Time struct
func (*Peer) GetHttpInfoPort ¶
GetHttpInfoPort return peer`s httpinfo port
func (*Peer) GetHttpInfoState ¶
GetHttpInfoState return peer`s httpinfo state
func (*Peer) GetServices ¶
GetServices return peer`s service state
func (*Peer) GetSoftVersion ¶ added in v1.6.0
func (*Peer) GetTimeStamp ¶
GetTimeStamp return peer`s latest contact time in ticks
func (*Peer) SetHttpInfoPort ¶
SetHttpInfoPort set peer`s httpinfo port
func (*Peer) SetHttpInfoState ¶
SetHttpInfoState set peer`s httpinfo state
type PeerCom ¶
type PeerCom struct {
// contains filtered or unexported fields
}
PeerCom provides the basic information of a peer
func (*PeerCom) GetHttpInfoPort ¶
GetHttpInfoPort returns a peer's http info port
func (*PeerCom) GetServices ¶
GetServices returns a peer's services
func (*PeerCom) GetSoftVersion ¶ added in v1.6.0
GetSoftVersion return a peer's software version
func (*PeerCom) GetVersion ¶
GetVersion returns a peer's version
func (*PeerCom) SetHttpInfoPort ¶
SetHttpInfoPort sets a peer's http info port
func (*PeerCom) SetServices ¶
SetServices sets a peer's services
func (*PeerCom) SetSoftVersion ¶ added in v1.6.0
SetSoftVersion sets a peers's software version
func (*PeerCom) SetVersion ¶
SetVersion sets a peer's version