Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const NodeIDBits = 512
View Source
const Version = 4
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PrivateKey *ecdsa.PrivateKey AnnounceAddr *net.UDPAddr NodeDBPath string NetRestrict *netutil.Netlist Bootnodes []*Node Unhandled chan<- ReadPacket }
type Node ¶
func MustParseNode ¶
func NewNode ¶
Example ¶
id := MustHexID("1dd9d65c4552b5eb43d5ad55a2ee3f56c6cbc1c64a5c8d659f51fcd51bace24351232b8d7821617d2b29b54b81cdefb9b3e9c37d7fd5f63270bcc9e1a6f6a439") n1 := NewNode(id, net.ParseIP("2001:db8:3c4d:15::abcd:ef12"), 52150, 30303) fmt.Println("n1:", n1) fmt.Println("n1.Incomplete() ->", n1.Incomplete()) n2 := NewNode(id, nil, 0, 0) fmt.Println("n2:", n2) fmt.Println("n2.Incomplete() ->", n2.Incomplete())
Output:
func (*Node) Incomplete ¶
func (*Node) MarshalText ¶
func (*Node) UnmarshalText ¶
type NodeID ¶
type NodeID [NodeIDBits / 8]byte
func MustBytesID ¶
func (NodeID) MarshalText ¶
func (NodeID) TerminalString ¶
func (*NodeID) UnmarshalText ¶
type ReadPacket ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) ReadRandomNodes ¶
Click to show internal directories.
Click to hide internal directories.