Documentation ¶
Overview ¶
Package announce - network announcements
The DNS TXT record format is a set of space separated key=value pairs
Key Value ======= ========= bitmark v3 a Public IP addresses as IPv4;[IPv6] c Peer-To-Peer port number (decimal) r RPC port number (decimal) f SHA3 fingerprint of the certificate used by RPC connection for TLS verification (hex) p Public key of the P2P connection for ZeroMQ encryption (hex)
Index ¶
- Constants
- func AddPeer(publicKey []byte, listeners []byte, timestamp uint64) bool
- func AddRPC(fingerprint []byte, rpcs []byte, timestamp uint64) bool
- func Finalise() error
- func GetNext(publicKey []byte) ([]byte, []byte, time.Time, error)
- func GetRandom(publicKey []byte) ([]byte, []byte, time.Time, error)
- func Initialise(nodesDomain, peerFile string) error
- func SendRegistration(client zmqutil.Client, fn string) error
- func SetPeer(publicKey []byte, listeners []byte) error
- func SetRPC(fingerprint fingerprintType, rpcs []byte) error
- type PeerItem
- type PeerList
- type RPCEntry
Constants ¶
const ( TypeRPC = iota TypePeer = iota )
type of listener
Variables ¶
This section is empty.
Functions ¶
func AddPeer ¶
AddPeer - add a peer announcement to the in-memory tree returns:
true if this was a new/updated entry false if the update was within the limits (to prevent continuous relaying)
func AddRPC ¶ added in v0.2.0
AddRPC - add an remote RPC listener returns:
true if this was a new/updated entry false if the update was within the limits (to prevent continuous relaying)
func GetNext ¶ added in v0.2.0
GetNext - fetch the data for the next node in the ring for a given public key
func GetRandom ¶ added in v0.8.1
GetRandom - fetch the data for a random node in the ring not matching a given public key
func Initialise ¶
Initialise - set up the announcement system pass a fully qualified domain for root node list or empty string for no root nodes
func SendRegistration ¶ added in v0.2.0
SendRegistration - send a peer registration request to a client channel
Types ¶
type PeerItem ¶ added in v0.5.7
PeerItem is the basic structure for backup and restore peers
func NewPeerItem ¶ added in v0.5.7
func NewPeerItem(peer *peerEntry) *PeerItem
NewPeerItem is to create a PeerItem from peerEntry
func (PeerItem) MarshalText ¶ added in v0.5.7
MarshalText is the json marshal function for PeerItem
func (*PeerItem) UnmarshalText ¶ added in v0.5.7
UnmarshalText is the json unmarshal function for PeerItem
type RPCEntry ¶ added in v0.2.0
type RPCEntry struct { Fingerprint fingerprintType `json:"fingerprint"` Connections []*util.Connection `json:"connections"` }
RPCEntry type of returned data