beacon

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainInfo

type ChainInfo struct {
	Version                        uint64
	Validators                     []*ValidatorInfo
	GenesisValidatorsRoot          phase0.Root
	Epoch                          phase0.Epoch
	GenesisForkVersion             phase0.Version
	CurrentForkVersion             phase0.Version
	BLSToExecutionChangeDomainType phase0.DomainType
	VoluntaryExitDomainType        phase0.DomainType
}

func ObtainChainInfoFromNode

func ObtainChainInfoFromNode(ctx context.Context,
	consensusClient consensusclient.Service,
	chainTime chaintime.Service,
) (
	*ChainInfo,
	error,
)

ObtainChainInfoFromNode obtains the chain information from a node.

func (*ChainInfo) FetchValidatorInfo

func (c *ChainInfo) FetchValidatorInfo(ctx context.Context, id string) (*ValidatorInfo, error)

FetchValidatorInfo fetches validator info given a validator identifier.

func (*ChainInfo) MarshalJSON

func (c *ChainInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*ChainInfo) UnmarshalJSON

func (c *ChainInfo) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ValidatorInfo

type ValidatorInfo struct {
	Index                 phase0.ValidatorIndex
	Pubkey                phase0.BLSPubKey
	State                 apiv1.ValidatorState
	WithdrawalCredentials []byte
}

func (*ValidatorInfo) MarshalJSON

func (v *ValidatorInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*ValidatorInfo) String

func (v *ValidatorInfo) String() string

String implements the Stringer interface.

func (*ValidatorInfo) UnmarshalJSON

func (v *ValidatorInfo) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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