Documentation ¶
Overview ¶
Package eth2util contains packages and logic relating to eth2 functionality. Note these packages may not import other business logic packages like dkg, core, cluster.
Index ¶
- Constants
- Variables
- func ForkVersionToChainID(forkVersion []byte) (int64, error)
- func ForkVersionToNetwork(forkVersion []byte) (string, error)
- func NetworkToForkVersion(name string) (string, error)
- func NetworkToForkVersionBytes(name string) ([]byte, error)
- func SlotHashRoot(slot eth2p0.Slot) ([32]byte, error)
- func ValidNetwork(name string) bool
- type Network
- type SignedEpoch
Constants ¶
const Prater = "prater"
Variables ¶
var ( Mainnet = Network{ ChainID: 1, Name: "mainnet", ForkVersionHex: "0x00000000", } Goerli = Network{ ChainID: 5, Name: "goerli", ForkVersionHex: "0x00001020", } Gnosis = Network{ ChainID: 100, Name: "gnosis", ForkVersionHex: "0x00000064", } Sepolia = Network{ ChainID: 11155111, Name: "sepolia", ForkVersionHex: "0x90000069", } Ropsten = Network{ ChainID: 3, Name: "ropsten", ForkVersionHex: "0x80000069", } )
Functions ¶
func ForkVersionToChainID ¶ added in v0.11.0
ForkVersionToChainID returns the chainID corresponding to the provided fork version.
func ForkVersionToNetwork ¶ added in v0.11.0
ForkVersionToNetwork returns the network name corresponding to the provided fork version.
func NetworkToForkVersion ¶ added in v0.11.0
NetworkToForkVersion returns the fork version in hex (0x prefixed) corresponding to the network name.
func NetworkToForkVersionBytes ¶ added in v0.11.0
NetworkToForkVersionBytes returns the fork version bytes corresponding to the network name.
func SlotHashRoot ¶ added in v0.10.1
SlotHashRoot returns the ssz hash root of the slot.
func ValidNetwork ¶ added in v0.11.0
ValidNetwork returns true if the provided network name is a valid one.
Types ¶
type Network ¶ added in v0.11.0
type Network struct { // ChainID represents chainID of the network. ChainID int64 // Name represents name of the network. Name string // ForkVersionHex represents fork version of the network in hex. ForkVersionHex string }
Network contains information about an Ethereum network.
type SignedEpoch ¶ added in v0.10.0
type SignedEpoch struct { Epoch eth2p0.Epoch Signature eth2p0.BLSSignature }
SignedEpoch represents signature of corresponding epoch.
func (SignedEpoch) GetTree ¶ added in v0.10.0
func (s SignedEpoch) GetTree() (*ssz.Node, error)
GetTree ssz hashes the SignedEpoch object.
func (SignedEpoch) HashTreeRoot ¶ added in v0.10.0
func (s SignedEpoch) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the SignedEpoch object.
func (SignedEpoch) HashTreeRootWith ¶ added in v0.10.0
func (s SignedEpoch) HashTreeRootWith(hh ssz.HashWalker) error
HashTreeRootWith ssz hashes the epoch from SignedEpoch.
func (SignedEpoch) MarshalJSON ¶ added in v0.10.0
func (s SignedEpoch) MarshalJSON() ([]byte, error)
func (*SignedEpoch) UnmarshalJSON ¶ added in v0.10.0
func (s *SignedEpoch) UnmarshalJSON(b []byte) error
Directories ¶
Path | Synopsis |
---|---|
Package deposit provides functions to create deposit data files.
|
Package deposit provides functions to create deposit data files. |
Package keystore provides functions to store and load private keys to/from EIP 2335 (https://eips.ethereum.org/EIPS/eip-2335) compatible keystore files.
|
Package keystore provides functions to store and load private keys to/from EIP 2335 (https://eips.ethereum.org/EIPS/eip-2335) compatible keystore files. |