Documentation ¶
Index ¶
- type Peer
- 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) GetID() common.PeerId
- func (this *Peer) GetPort() uint16
- func (this *Peer) GetRelay() bool
- func (this *Peer) GetServices() uint64
- func (this *Peer) GetSoftVersion() string
- 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) UpdateInfo(t time.Time, version uint32, services uint64, syncPort uint16, ...)
- type PeerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
Peer represent the node in p2p
func (*Peer) GetContactTime ¶
GetContactTime return peer`s latest contact time in Time struct
func (*Peer) GetHttpInfoPort ¶
GetHttpInfoPort return peer`s httpinfo port
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
type PeerInfo ¶ added in v1.10.0
type PeerInfo struct { Id common.PeerId Version uint32 Services uint64 Relay bool HttpInfoPort uint16 Port uint16 Height uint64 SoftVersion string Addr string }
PeerInfo provides the basic information of a peer
func NewPeerInfo ¶ added in v1.10.0
func (*PeerInfo) RemoteListenAddress ¶ added in v1.10.0
RemoteListen get remote service port
Click to show internal directories.
Click to hide internal directories.