network

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package network defines objects that we'll use for understanding which network we are observing

Index

Constants

View Source
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

View Source
var Ethereum = EVMNetwork{Name: EthereumName, ChainID: 1}
View Source
var Goerli = EVMNetwork{Name: GoerliName, ChainID: 5}
View Source
var HeimdallAmoy = TendermintNetwork{Name: HeimdallAmoyName, ChainID: "heimdall-80002"}
View Source
var HeimdallMainnet = TendermintNetwork{Name: HeimdallMainnetName, ChainID: "heimdall-137"}
View Source
var HeimdallMumbai = TendermintNetwork{Name: HeimdallMumbaiName, ChainID: "heimdall-80001"}
View Source
var PolygonAmoy = EVMNetwork{Name: PolygonAmoyName, ChainID: 80002}
View Source
var PolygonMainnet = EVMNetwork{Name: PolygonMainnetName, ChainID: 137}
View Source
var PolygonMumbai = EVMNetwork{Name: PolygonMumbaiName, ChainID: 80001}
View Source
var Sepolia = EVMNetwork{Name: SepoliaName, ChainID: 11155111}
View Source
var ZkEVMBali = EVMNetwork{Name: ZkEVMBaliName, ChainID: 2440}
View Source
var ZkEVMCardona = EVMNetwork{Name: ZkEVMCardonaName, ChainID: 2442}
View Source
var ZkEVMMainnet = EVMNetwork{Name: ZkEVMMainnetName, ChainID: 1101}
View Source
var ZkEVMTestnet = EVMNetwork{Name: ZkEVMTestnetName, ChainID: 1442}

Functions

This section is empty.

Types

type EVMNetwork

type EVMNetwork struct {
	Name    string
	ChainID uint64
}

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

func GetNetworkByName(name string) (Network, error)

GetNetworkByName is a convenience method to convert a name like "Ethereum" into a Network object.

type TendermintNetwork

type TendermintNetwork struct {
	Name    string
	ChainID string
}

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.

Jump to

Keyboard shortcuts

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