peer

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: ISC Imports: 26 Imported by: 0

Documentation

Overview

this module handles the peer to peer network

server-side:

* upstream sending of block, transactions * listener for RPC requests e.g. retrieve old block

client-side

* connector to retrieve missing data from other listeners

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockHeight added in v0.6.8

func BlockHeight() uint64

return global block height

func FetchConnectors added in v0.3.30

func FetchConnectors() []*zmqutil.Connected

func Finalise

func Finalise() error

finialise - stop all background tasks

func GetCounts added in v0.7.0

func GetCounts() (uint64, uint64)

return connection counts:

incoming - total peers connectng to all listeners
outgoing - total outgoing connections

func Initialise

func Initialise(configuration *Configuration, version string) error

initialise peer backgrouds processes

func PublicKey added in v0.6.3

func PublicKey() []byte

return public key

Types

type Configuration added in v0.2.0

type Configuration struct {
	DynamicConnections bool         `libucl:"dynamic_connections" json:"dynamic_connections"`
	PreferIPv6         bool         `libucl:"prefer_ipv6" json:"prefer_ipv6"`
	Listen             []string     `libucl:"listen" json:"listen"`
	Announce           []string     `libucl:"announce" json:"announce"`
	PrivateKey         string       `libucl:"private_key" json:"private_key"`
	PublicKey          string       `libucl:"public_key" json:"public_key"`
	Connect            []Connection `libucl:"connect" json:"connect,omitempty"`
}

a block of configuration data this is read from a libucl configuration file

type Connection added in v0.2.0

type Connection struct {
	PublicKey string `libucl:"public_key" json:"public_key"`
	Address   string `libucl:"address" json:"address"`
}

hardwired connections this is read from a libucl configuration file

type PublishConfiguration added in v0.7.0

type PublishConfiguration struct {
	Broadcast  []string `libucl:"broadcast" json:"broadcast"`
	PrivateKey string   `libucl:"private_key" json:"private_key"`
	PublicKey  string   `libucl:"public_key" json:"public_key"`
}

Directories

Path Synopsis
maintain REQ/REP connection to clients this allow for push of blocks, transactions...
maintain REQ/REP connection to clients this allow for push of blocks, transactions...

Jump to

Keyboard shortcuts

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