netconf

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package netconf provides the configuration of an Story network, an instance of the Story cross chain protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlag

func BindFlag(flags *pflag.FlagSet, network *ID)

BindFlag binds the network identifier flag.

func IsAny

func IsAny(id ID, targets ...ID) bool

IsAny returns true if the `ID` matches any of the provided targets.

Types

type Chain

type Chain struct {
	ID   uint64 // Chain ID asa per https://chainlist.org
	Name string // Chain name as per https://chainlist.org
	// RPCURL            string            // RPC URL of the chain
	BlockPeriod time.Duration // Block period of the chain
}

Chain defines the configuration of an execution chain that supports the Story cross chain protocol. This is most supported EVMs, but also the Story EVM, and the Story Consensus chain.

type Deployment

type Deployment struct {
	ChainID uint64
	Address common.Address
}

type ID

type ID string

ID is a network identifier.

const (
	// Iliad is the official Story Protocol public testnet.
	Iliad ID = "iliad"

	// Used for local network testing.
	Local ID = "local"

	// Odyssey is the official Story Protocol public testnet.
	Odyssey ID = "odyssey"
)

func All

func All() []ID

All returns all the supported network IDs.

func (ID) Static

func (i ID) Static() Static

Static returns the static config and data for the network.

func (ID) String

func (i ID) String() string

func (ID) Verify

func (i ID) Verify() error

func (ID) Version

func (i ID) Version() string

type Network

type Network struct {
	ID     ID      `json:"name"`   // ID of the network. e.g. "simnet", "testnet", "staging", "mainnet"
	Chains []Chain `json:"chains"` // Chains that are part of the network
}

Network defines a deployment of the Story cross chain protocol. It spans an story chain (both execution and consensus) and a set of supported EVMs.

func (Network) Chain

func (n Network) Chain(id uint64) (Chain, bool)

Chain returns the chain config for the given ID or false if it does not exist.

func (Network) Validate

func (n Network) Validate() error

Validate returns an error if the configuration is invalid.

type Static

type Static struct {
	Version               string
	StoryExecutionChainID uint64
	MaxValidators         uint32
	ConsensusGenesisJSON  []byte
	ConsensusSeedTXT      []byte
	ExecutionGenesisJSON  []byte
	ExecutionSeedTXT      []byte
}

Static defines static config and data for a network.

func (Static) ConsensusSeeds

func (s Static) ConsensusSeeds() []string

func (Static) StoryConsensusChainIDStr

func (Static) StoryConsensusChainIDStr() string

StoryConsensusChainIDStr returns the chain ID string for the Story consensus client.

Jump to

Keyboard shortcuts

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