announce

package
v0.15.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: ISC Imports: 16 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(publicKey []byte, listeners []byte, timestamp uint64) bool

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

func AddRPC(fin []byte, listeners []byte, timestamp uint64) bool

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 FetchRPCs added in v0.2.0

func FetchRPCs(start uint64, count int) ([]rpc.Entry, uint64, error)

FetchRPCs - fetch some records

func Finalise

func Finalise() error

Finalise - stop all background tasks

func GetNext added in v0.2.0

func GetNext(publicKey []byte) ([]byte, []byte, time.Time, error)

GetNext - fetch the data for the next node in the ring for a given public key

func GetRandom added in v0.8.1

func GetRandom(publicKey []byte) ([]byte, []byte, time.Time, error)

GetRandom - fetch the data for a random node in the ring not matching a given public key

func Initialise

func Initialise(domainName, cacheDirectory string, f func(string) ([]string, error)) error

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

func SendRegistration(client zmqutil.Client, fn string) error

SendRegistration - send a peer registration request to a client channel

func SetRPC added in v0.2.0

func SetRPC(fin fingerprint.Fingerprint, listeners []byte) error

SetRPC - set this node's rpc announcement data

func SetSelf added in v0.13.0

func SetSelf(publicKey []byte, listeners []byte) error

SetPeer - called by the peering initialisation to set up this node's announcement data

Types

type Announce added in v0.13.0

type Announce interface {
	// Set - set this node's rpc announcement data
	Set(fingerprint.Fingerprint, []byte) error

	// Fetch- fetch some records
	Fetch(uint64, int) ([]rpc.Entry, uint64, error)
}

func Get added in v0.13.0

func Get() Announce

Get - return Announce interface

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL