p2p

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 18 Imported by: 0

Documentation

Overview

Package p2p provides the implementation for the p2p gossip and libp2p swarm membership used for a seed node, which is a non-relaying, non-client node only providing network metadata to new connections.

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	ListenAddresses:  []multiaddr.Multiaddr{},
	SeedAddresses:    []multiaddr.Multiaddr{},
	ConnectAddresses: []multiaddr.Multiaddr{},
}

Functions

func Base58Decode

func Base58Decode(key string) (priv crypto.PrivKey, err error)

func Base58Encode

func Base58Encode(priv crypto.PrivKey) (key string, err error)

func InitFlags

func InitFlags(cmd *cobra.Command)

func NewMultiAddr

func NewMultiAddr(addr string) (maddr multiaddr.Multiaddr)

func Run

func Run()

Run is the main entrypoint for the seed p2p service.

func Shutdown

func Shutdown() (err error)

func WhenReady

func WhenReady() chan bool

func WhenShutdown

func WhenShutdown() chan bool

func WhenStartFailed

func WhenStartFailed() chan error

Types

type Config

type Config struct {
	PrivKey crypto.PrivKey

	PublicAddress    multiaddr.Multiaddr
	SeedAddresses    []multiaddr.Multiaddr
	ConnectAddresses []multiaddr.Multiaddr
	ListenAddresses  []multiaddr.Multiaddr

	Params *cfg.Params
}

func (*Config) SetNetwork

func (c *Config) SetNetwork(network string)

Directories

Path Synopsis
Package metrics provides a simple logging update of the status of a seed node and its peer and connection counts.
Package metrics provides a simple logging update of the status of a seed node and its peer and connection counts.

Jump to

Keyboard shortcuts

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