api

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ecrecover

func Ecrecover(header *types.Header) ([]byte, error)

Ecrecover recovers the block signer given the block header.

func GetJSON

func GetJSON(url string, target any) error

func Signers

func Signers(n network.Network) (map[string]*Validator, error)

Signers maps the validator signer to the validator.

Types

type Validator

type Validator struct {
	ID          uint64 `json:"ID"`
	Signer      string `json:"signer"`
	StartEpoch  uint64 `json:"startEpoch"`
	EndEpoch    uint64 `json:"endEpoch"`
	Nonce       uint64 `json:"nonce"`
	Power       uint64 `json:"power"`
	PubKey      string `json:"pubKey"`
	LastUpdated string `json:"last_updated"`
	Jailed      bool   `json:"jailed"`
	Accum       int64  `json:"accum"`
}

func Validators

func Validators(n network.Network) ([]*Validator, error)

Validators queries the Heimdall API for the validator set. The validator set is cached based on the refreshInterval.

type ValidatorSet

type ValidatorSet struct {
	Height string `json:"height"`
	Result struct {
		Validators []*Validator `json:"validators"`
		Proposer   *Validator   `json:"proposer"`
	} `json:"result"`
}

type ValidatorsCache

type ValidatorsCache struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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