Documentation ¶
Overview ¶
Package netconf provides the configuration of an Omni network, an instance of the Omni cross chain protocol.
Index ¶
- Constants
- func BindFlag(flags *pflag.FlagSet, netConf *string)
- func ConsensusChainIDStr2Uint64(id string) (uint64, error)
- func Save(network Network, path string) error
- type Chain
- type FinalizationStrat
- type ID
- type Network
- func (n Network) Chain(id uint64) (Chain, bool)
- func (n Network) ChainIDs() []uint64
- func (n Network) ChainName(id uint64) string
- func (n Network) ChainNamesByIDs() map[uint64]string
- func (n Network) EVMChains() []Chain
- func (n Network) EthereumChain() (Chain, bool)
- func (n Network) OmniConsensusChain() (Chain, bool)
- func (n Network) OmniEVMChain() (Chain, bool)
- func (n Network) Validate() error
- type Static
Constants ¶
const ( StratFinalized = FinalizationStrat(ethclient.HeadFinalized) StratLatest = FinalizationStrat(ethclient.HeadLatest) )
Variables ¶
This section is empty.
Functions ¶
func ConsensusChainIDStr2Uint64 ¶
ConsensusChainIDStr2Uint64 parses the uint suffix from the provided a consensus chain ID string.
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 AuthRPCURL string // RPC URL of the chain with JWT authentication enabled PortalAddress common.Address // Address of the omni portal contract on the chain DeployHeight uint64 // Height that the portal contracts were deployed IsOmniEVM bool // Whether this is the Omni EVM chain IsOmniConsensus bool // Whether this is the Omni consensus chain IsEthereum bool // Whether this is the ethereum layer1 chain BlockPeriod time.Duration // Block period of the chain FinalizationStrat FinalizationStrat // Finalization strategy of the chain AVSContractAddr common.Address // Address of Omni AVS contracts for the chain }
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) MarshalJSON ¶ added in v0.1.0
MarshalJSON implements the json.Marshaler interface.
func (*Chain) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON implements the json.Unmarshaler interface.
type FinalizationStrat ¶ added in v0.1.0
type FinalizationStrat string
FinalizationStrat defines the finalization strategy of a chain. This is mostly ethclient.HeadFinalized, but some chains may not support it, like zkEVM chains which would need a much more involved strategy.
func (FinalizationStrat) Verify ¶ added in v0.1.0
func (h FinalizationStrat) Verify() error
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" // Testnet is the Omni public testnet. Testnet ID = "testnet" // 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 (Network) Chain ¶
Chain returns the chain config for the given ID 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) EVMChains ¶
EVMChains returns all evm chains in the network. It excludes the omni consensus chain.
func (Network) EthereumChain ¶
EthereumChain returns the Eth 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.
type Static ¶
type Static struct {
OmniExecutionChainID uint64
}
Static defines static config and data for a network.
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.