cfg

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: 4 Imported by: 0

Documentation

Overview

Package cfg contains settings for the various network modes and seeds for those networks.

Index

Constants

View Source
const (
	// MainNet is the identifier string for the main production network.
	MainNet = "mainnet"
	// TestNet is the identifier string for the test network.
	TestNet = "testnet"
	// SimNet is the identifier string for simulation networks.
	SimNet = "simnet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {

	// Name defines a human-readable identifier for the network
	Name string

	// Net is a uint32 magic byte identifier for the network
	Net node.Swarm

	// DefaultPort is the default port for p2p listening
	DefaultPort string

	// DNSSeedAddresses is a list of DNS hostnames used to bootstrap a new node on the network
	DNSSeedAddresses []*SeedAddress
}

Params is the specification for an indranet swarm (mainnet, testnet, etc).

func SelectNetworkParams added in v0.1.13

func SelectNetworkParams(network string) *Params

SelectNetworkParams returns the network parameters associated with the network name.

func (*Params) GetSeedsMultiAddrStrings added in v0.1.16

func (p *Params) GetSeedsMultiAddrStrings() (seeds []string)

GetSeedsMultiAddrStrings returns the seeds multiaddrs as encoded strings.

func (*Params) ParseSeedMultiAddresses

func (p *Params) ParseSeedMultiAddresses() (addresses []multiaddr.Multiaddr, err error)

ParseSeedMultiAddresses returns the addresses of the seeds as a slice of multiaddr.Multiaddr.

type SeedAddress added in v0.1.13

type SeedAddress struct {

	// ID is the p2p identifier (peer identity key).
	ID string

	// DNSAddress is the hostname of the seed node
	DNSAddress string
}

SeedAddress is a form of the key and network address for seeds on a network.

func NewSeedAddress

func NewSeedAddress(dns string, id string) *SeedAddress

NewSeedAddress creates a new seed from a network address and seed public key in base58 encoding.

Jump to

Keyboard shortcuts

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