autopeering

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0, BSD-2-Clause Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const PluginName = "Autopeering"

PluginName is the name of the autopeering plugin.

Variables

View Source
var Parameters = &ParametersDefinition{}

Parameters contains the configuration parameters of the autopeering plugin.

Functions

func BindAddress added in v0.2.0

func BindAddress() string

BindAddress returns the string form of the autopeering bind address.

func Plugin added in v0.2.0

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func Selection

func Selection() *selection.Protocol

Selection returns the neighbor selection instance.

Types

type NetConnMetric added in v0.2.0

type NetConnMetric struct {
	*net.UDPConn
	// contains filtered or unexported fields
}

NetConnMetric is a wrapper of a UDPConn that keeps track of RX and TX bytes.

var (
	// Conn contains the network connection.
	Conn *NetConnMetric
)

func (*NetConnMetric) RXBytes added in v0.2.0

func (nc *NetConnMetric) RXBytes() uint64

RXBytes returns the RX bytes.

func (*NetConnMetric) ReadFromUDP added in v0.2.0

func (nc *NetConnMetric) ReadFromUDP(b []byte) (int, *net.UDPAddr, error)

ReadFromUDP acts like ReadFrom but returns a UDPAddr.

func (*NetConnMetric) TXBytes added in v0.2.0

func (nc *NetConnMetric) TXBytes() uint64

TXBytes returns the TX bytes.

func (*NetConnMetric) WriteToUDP added in v0.2.0

func (nc *NetConnMetric) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)

WriteToUDP acts like WriteTo but takes a UDPAddr.

type ParametersDefinition added in v0.7.4

type ParametersDefinition struct {
	// Mana defines the config flag of mana in the autopeering.
	Mana bool `default:"true" usage:"enable/disable mana in the autopeering"`

	// R defines the config flag of R.
	R int `default:"40" usage:"R parameter"`

	// Ro defines the config flag of Ro.
	Ro float64 `default:"2.0" usage:"Ro parameter"`

	EnableGossipIntegration bool `default:"true" usage:"enable/disable autopeering for gossip layer"`
}

ParametersDefinition contains the definition of configuration parameters used by the autopeering plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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