Documentation
¶
Index ¶
Constants ¶
View Source
const (
IPPortLen = net.IPv6len + wrappers.ShortLen
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClaimedIPPort ¶
type ClaimedIPPort struct {
// The peer's certificate.
Cert *staking.Certificate
// The peer's claimed IP and port.
IPPort IPPort
// The time the peer claimed to own this IP and port.
Timestamp uint64
// [Cert]'s signature over the IPPort and timestamp.
// This is used in the networking library to ensure that this IPPort was
// actually claimed by the peer in question, and not by a malicious peer
// trying to get us to dial bogus IPPorts.
Signature []byte
// NodeID derived from the peer certificate.
NodeID ids.NodeID
// GossipID derived from the nodeID and timestamp.
GossipID ids.ID
}
A self contained proof that a peer is claiming ownership of an IPPort at a given time.
func NewClaimedIPPort ¶ added in v1.10.18
func NewClaimedIPPort( cert *staking.Certificate, ipPort IPPort, timestamp uint64, signature []byte, ) *ClaimedIPPort
func (*ClaimedIPPort) Size ¶ added in v1.10.18
func (i *ClaimedIPPort) Size() int
Returns the approximate size of the binary representation of this ClaimedIPPort.
type DynamicIPPort ¶
type DynamicIPPort interface {
// Returns the IP + port pair.
IPPort() IPPort
// Changes the IP.
SetIP(ip net.IP)
}
An IPPort that can change. Safe for use by multiple goroutines.
func NewDynamicIPPort ¶
func NewDynamicIPPort(ip net.IP, port uint16) DynamicIPPort
type IPDesc ¶ added in v1.10.3
type IPDesc IPPort
func (IPDesc) MarshalJSON ¶ added in v1.10.3
func (*IPDesc) UnmarshalJSON ¶ added in v1.10.3
Click to show internal directories.
Click to hide internal directories.