Documentation
¶
Overview ¶
Package network defines objects that we'll use for understanding which network we are observing
Index ¶
Constants ¶
const ( PolygonMainnetName = "Polygon Mainnet" PolygonMumbaiName = "Polygon Mumbai" PolygonAmoyName = "Polygon Amoy" HeimdallMainnetName = "Heimdall Mainnet" HeimdallMumbaiName = "Heimdall Mumbai" HeimdallAmoyName = "Heimdall Amoy" ZkEVMMainnetName = "zkEVM Mainnet" ZkEVMTestnetName = "zkEVM Testnet" ZkEVMCardonaName = "zkEVM Cardona" ZkEVMBaliName = "zkEVM Bali" EthereumName = "Ethereum" SepoliaName = "Sepolia" GoerliName = "Goerli" )
Variables ¶
var Ethereum = EVMNetwork{Name: EthereumName, ChainID: 1}
var Goerli = EVMNetwork{Name: GoerliName, ChainID: 5}
var HeimdallAmoy = TendermintNetwork{Name: HeimdallAmoyName, ChainID: "heimdall-80002"}
var HeimdallMainnet = TendermintNetwork{Name: HeimdallMainnetName, ChainID: "heimdall-137"}
var HeimdallMumbai = TendermintNetwork{Name: HeimdallMumbaiName, ChainID: "heimdall-80001"}
var KnownNetworks = []Network{ &PolygonMainnet, &PolygonMumbai, &PolygonAmoy, &HeimdallMainnet, &HeimdallMumbai, &HeimdallAmoy, &ZkEVMMainnet, &ZkEVMTestnet, &ZkEVMCardona, &ZkEVMBali, &Ethereum, &Sepolia, &Goerli, }
var PolygonAmoy = EVMNetwork{Name: PolygonAmoyName, ChainID: 80002}
var PolygonMainnet = EVMNetwork{Name: PolygonMainnetName, ChainID: 137}
var PolygonMumbai = EVMNetwork{Name: PolygonMumbaiName, ChainID: 80001}
var Sepolia = EVMNetwork{Name: SepoliaName, ChainID: 11155111}
var ZkEVMBali = EVMNetwork{Name: ZkEVMBaliName, ChainID: 2440}
var ZkEVMCardona = EVMNetwork{Name: ZkEVMCardonaName, ChainID: 2442}
var ZkEVMMainnet = EVMNetwork{Name: ZkEVMMainnetName, ChainID: 1101}
var ZkEVMTestnet = EVMNetwork{Name: ZkEVMTestnetName, ChainID: 1442}
Functions ¶
This section is empty.
Types ¶
type EVMNetwork ¶
EVMNetwork is a specific type of network that is assumed to generally follow the norms of an Ethereum based network.
func (*EVMNetwork) GetChainID ¶
func (n *EVMNetwork) GetChainID() uint64
GetChainID should return the configured chain id for the network.
func (*EVMNetwork) GetName ¶
func (n *EVMNetwork) GetName() string
GetName returns the name that we've set for the network. It doesn't have to be canonical in anyway. Just something to match configs.
type Network ¶
type Network interface {
GetName() string
}
Network is the interface that we need to identify a network.
func GetNetworkByName ¶
GetNetworkByName is a convenience method to convert a name like "Ethereum" into a Network object.
type TendermintNetwork ¶
TendermintNetwork is close to an EVMNetwork but generally the chain ID is a string and there won't be typical JSON RPC provers.
func (*TendermintNetwork) GetChainID ¶
func (n *TendermintNetwork) GetChainID() string
GetChainID will return the chain id for the network.
func (*TendermintNetwork) GetName ¶
func (n *TendermintNetwork) GetName() string
GetName will return the configured name for this network.