Documentation ¶
Overview ¶
Package netconf provides the configuration of an Omni network, an instance of the Omni cross chain protocol.
Index ¶
- func BindFlag(flags *pflag.FlagSet, network *ID)
- func ChainNamer(network ID) func(uint64) string
- func ChainVersionNamer(network ID) func(version xchain.ChainVersion) string
- func ConsensusChainIDStr2Uint64(id string) (uint64, error)
- func IsAny(id ID, targets ...ID) bool
- func IsEthereumChain(network ID, chainID uint64) bool
- func IsOmniConsensus(network ID, chainID uint64) bool
- func IsOmniExecution(network ID, chainID uint64) bool
- func MetadataByID(network ID, chainID uint64) evmchain.Metadata
- func SetEphemeralGenesis(network ID, execution, consensus []byte) error
- type Chain
- type Deployment
- type ID
- type Network
- func (n Network) Chain(id uint64) (Chain, bool)
- func (n Network) ChainByName(name string) (Chain, bool)
- func (n Network) ChainIDs() []uint64
- func (n Network) ChainName(id uint64) string
- func (n Network) ChainNamesByIDs() map[uint64]string
- func (n Network) ChainVersionName(chainVer xchain.ChainVersion) string
- func (n Network) ChainVersionNames() map[xchain.ChainVersion]string
- func (n Network) ChainVersionsTo(dstChainID uint64) []xchain.ChainVersion
- func (n Network) EVMChains() []Chain
- func (n Network) EVMStreams() []xchain.StreamID
- func (n Network) EthereumChain() (Chain, bool)
- func (n Network) OmniConsensusChain() (Chain, bool)
- func (n Network) OmniEVMChain() (Chain, bool)
- func (n Network) StreamName(stream xchain.StreamID) string
- func (n Network) StreamsBetween(srcChainID uint64, dstChainID uint64) []xchain.StreamID
- func (n Network) StreamsFrom(srcChainID uint64) []xchain.StreamID
- func (n Network) StreamsTo(dstChainID uint64) []xchain.StreamID
- func (n Network) Verify() error
- type Static
- func (s Static) ConsensusArchives() []string
- func (s Static) ConsensusRPC() string
- func (s Static) ConsensusSeeds() []string
- func (s Static) ExecutionRPC() string
- func (s Static) ExecutionSeeds() []string
- func (s Static) OmniConsensusChain() Chain
- func (s Static) OmniConsensusChainIDStr() string
- func (s Static) OmniConsensusChainIDUint64() uint64
- func (s Static) OmniExecutionChainName() string
- func (s Static) PortalDeployment(chainID uint64) (Deployment, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainNamer ¶
func ChainVersionNamer ¶
func ChainVersionNamer(network ID) func(version xchain.ChainVersion) string
func ConsensusChainIDStr2Uint64 ¶
ConsensusChainIDStr2Uint64 parses the uint suffix from the provided a consensus chain ID string.
func IsEthereumChain ¶
IsEthereumChain returns true if the chainID is the EthereumChainID for the given network.
func IsOmniConsensus ¶
IsOmniConsensus returns true if provided chainID is the omni consensus chain for the network.
func IsOmniExecution ¶
IsOmniExecution returns true if provided chainID is the omni execution chain for the network.
func SetEphemeralGenesis ¶
SetEphemeralGenesis sets the ephemeral genesis files.
Types ¶
type Chain ¶
type Chain struct { ID uint64 // Chain ID asa per https://chainlist.org Name string // Chain name as per https://chainlist.org PortalAddress common.Address // Address of the omni portal contract on the chain DeployHeight uint64 // Height that the portal contracts were deployed BlockPeriod time.Duration // Block period of the chain Shards []xchain.ShardID // Supported xmsg shards AttestInterval uint64 // Attest to every Nth block, even if empty. }
Chain defines the configuration of an execution chain that supports the Omni cross chain protocol. This is most supported Rollup EVMs, but also the Omni EVM, and the Omni Consensus chain.
func (Chain) ChainVersions ¶
func (c Chain) ChainVersions() []xchain.ChainVersion
ChainVersions returns the uniq set of chain versions supported by the chain. This is inferred from the supported shards.
func (Chain) ConfLevels ¶
ConfLevels returns the uniq set of confirmation levels supported by the chain. This is inferred from the supported shards.
func (Chain) ShardsUint64 ¶
type Deployment ¶
type ID ¶
type ID string
ID is a network identifier.
const ( // Simnet is a simulated network for very simple testing of individual binaries. // It is a single binary with mocked clients (no networking). Simnet ID = "simnet" // Single binary with mocked clients (no network) // Devnet is the most basic single-machine deployment of the Omni cross chain protocol. // It uses docker compose to setup a network with multi containers. // E.g. 2 geth nodes, 4 halo validators, a relayer, and 2 anvil rollups. Devnet ID = "devnet" // Staging is the Omni team's internal staging network, similar to a internal testnet. // It connects to real public rollup testnets (e.g. Arbitrum testnet). // It is deployed to GCP using terraform. // E.g. 1 Erigon, 1 Geth, 4 halo validators, 2 halo sentries, 1 relayer. Staging ID = "staging" // Omega is a Omni public testnet. Omega ID = "omega" // Mainnet is the Omni public mainnet. Mainnet ID = "mainnet" )
func (ID) IsEphemeral ¶
IsEphemeral returns true if the network is short-lived, therefore ephemeral.
func (ID) IsProtected ¶
IsProtected returns true if the network is long-lived, therefore protected.
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 Omni cross chain protocol. It spans an omni chain (both execution and consensus) and a set of supported rollup EVMs.
func AwaitOnConsensusChain ¶
func AwaitOnConsensusChain(ctx context.Context, netID ID, cprov cchain.Provider, expected []string) (Network, error)
AwaitOnConsensusChain blocks and returns network configuration as soon as it can be loaded from the Consensus Chain's registry.
func AwaitOnExecutionChain ¶
func AwaitOnExecutionChain(ctx context.Context, netID ID, portalRegistry *bindings.PortalRegistry, expected []string) (Network, error)
AwaitOnExecutionChain blocks and returns network configuration as soon as it can be loaded from the EVM Execution Chain's registry. It only returns an error if the context is canceled.
func SimnetNetwork ¶
func SimnetNetwork() Network
SimnetNetwork defines the simnet network configuration. Simnet is the only statically defined network, all others are dynamically defined in manifests.
func (Network) Chain ¶
Chain returns the chain config for the given ID or false if it does not exist.
func (Network) ChainByName ¶
ChainByName returns the chain config for the given name or false if it does not exist.
func (Network) ChainIDs ¶
ChainIDs returns the all chain IDs in the network. This is a convenience method.
func (Network) ChainName ¶
ChainName returns the chain name for the given ID or an empty string if it does not exist.
func (Network) ChainNamesByIDs ¶
ChainNamesByIDs returns the all chain IDs and names in the network. This is a convenience method.
func (Network) ChainVersionName ¶
func (n Network) ChainVersionName(chainVer xchain.ChainVersion) string
ChainVersionName returns the chain version name for the given ID or an empty string if it does not exist.
func (Network) ChainVersionNames ¶
func (n Network) ChainVersionNames() map[xchain.ChainVersion]string
ChainVersionNames returns the all chain version names in the network. This is a convenience method.
func (Network) ChainVersionsTo ¶
func (n Network) ChainVersionsTo(dstChainID uint64) []xchain.ChainVersion
ChainVersionsTo returns the all chain versions submitted to the provided destination chain.
func (Network) EVMChains ¶
EVMChains returns all evm chains in the network. It excludes the omni consensus chain.
func (Network) EVMStreams ¶
EVMStreams returns the all streams between EVM chains.
func (Network) EthereumChain ¶
EthereumChain returns the ethereum Layer1 chain config or false if it does not exist.
func (Network) OmniConsensusChain ¶
OmniConsensusChain returns the Omni consensus chain config or false if it does not exist.
func (Network) OmniEVMChain ¶
OmniEVMChain returns the Omni execution chain config or false if it does not exist.
func (Network) StreamName ¶
StreamName returns the stream name for the given stream ID.
func (Network) StreamsBetween ¶
StreamsBetween returns the all streams between the provided source and destination chain.
func (Network) StreamsFrom ¶
StreamsFrom returns the all streams from the provided source chain.
type Static ¶
type Static struct { Network ID OmniExecutionChainID uint64 AVSContractAddress common.Address TokenAddress common.Address L1BridgeAddress common.Address Portals []Deployment MaxValidators uint32 ConsensusGenesisJSON []byte ConsensusSeedTXT []byte ConsensusArchiveTXT []byte ExecutionGenesisJSON []byte ExecutionSeedTXT []byte }
Static defines static config and data for a network.
func (Static) ConsensusArchives ¶
func (Static) ConsensusRPC ¶
func (Static) ConsensusSeeds ¶
func (Static) ExecutionRPC ¶
func (Static) ExecutionSeeds ¶
func (Static) OmniConsensusChain ¶
OmniConsensusChain returns the omni consensus Chain struct.
func (Static) OmniConsensusChainIDStr ¶
OmniConsensusChainIDStr returns the chain ID string for the Omni consensus chain. It is calculated as "omni-<OmniConsensusChainIDUint64>".
func (Static) OmniConsensusChainIDUint64 ¶
OmniConsensusChainIDUint64 returns the chain ID uint64 for the Omni consensus chain. It is calculated as 1_000_000 + OmniExecutionChainID.
func (Static) OmniExecutionChainName ¶
OmniExecutionChainName returns the name of the Omni execution chain.
func (Static) PortalDeployment ¶
func (s Static) PortalDeployment(chainID uint64) (Deployment, bool)
PortalDeployment returns the portal deployment for the given chainID. If there is none, it returns an empty deployment.