peer

package
v0.12.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: ISC Imports: 30 Imported by: 2

Documentation

Overview

Package peer - 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

BlockHeight - return global block height

func FetchConnectors added in v0.3.30

func FetchConnectors() []*zmqutil.Connected

FetchConnectors - obtain a list of all connector clients

func Finalise

func Finalise() error

Finalise - stop all background tasks

func GetCounts added in v0.7.0

func GetCounts() (uint64, uint64)

GetCounts - return connection counts:

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

func Initialise

func Initialise(configuration *Configuration, version string, fastsync bool) error

Initialise - setup peer background processes

func PublicKey added in v0.6.3

func PublicKey() []byte

PublicKey - return public key

Types

type Configuration added in v0.2.0

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

Configuration - a block of configuration data this is read from the configuration file

type Connection added in v0.2.0

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

Connection - hardwired connections this is read from the configuration file

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package upstream - maintain REQ/REP connection to clients this allow for push of blocks, transactions...
Package upstream - 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