lighthouse

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestUrlFormat   = "%s://%s%s"
	RequestProtocol    = "http"
	RequestContentType = "application/json"

	RequestSyncStatusPath = "/node/syncing"
	RequestEth2ConfigPath = "/spec"
	RequestBeaconHeadPath = "/beacon/head"
	RequestValidatorsPath = "/beacon/validators"

	RequestSlotsPerEpochPath   = "/spec/slots_per_epoch"
	RequestGenesisTimePath     = "/beacon/genesis_time"
	RequestBeaconStateRootPath = "/beacon/state_root"
)

Config

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconHeadResponse

type BeaconHeadResponse struct {
	Slot                  uint64 `json:"slot"`
	FinalizedSlot         uint64 `json:"finalized_slot"`
	JustifiedSlot         uint64 `json:"justified_slot"`
	PreviousJustifiedSlot uint64 `json:"previous_justified_slot"`
}

type Client

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

Lighthouse client

func NewClient

func NewClient(providerAddress string) *Client

Create new lighthouse client

func (*Client) Close

func (c *Client) Close()

Close the client connection

func (*Client) GetBeaconHead

func (c *Client) GetBeaconHead() (beacon.BeaconHead, error)

Get the beacon head

func (*Client) GetEth2Config

func (c *Client) GetEth2Config() (beacon.Eth2Config, error)

Get the eth2 config

func (*Client) GetSyncStatus

func (c *Client) GetSyncStatus() (beacon.SyncStatus, error)

Get the node's sync status

func (*Client) GetValidatorStatus

func (c *Client) GetValidatorStatus(pubkey types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)

Get a validator's status

func (*Client) GetValidatorStatuses added in v0.0.4

func (c *Client) GetValidatorStatuses(pubkeys []types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (map[types.ValidatorPubkey]beacon.ValidatorStatus, error)

Get multiple validators' statuses

type Eth2ConfigResponse

type Eth2ConfigResponse struct {
	GenesisForkVersion  byteArray `json:"genesis_fork_version"`
	DomainDeposit       uint64    `json:"domain_deposit"`
	DomainVoluntaryExit uint64    `json:"domain_voluntary_exit"`
	GenesisSlot         uint64    `json:"genesis_slot"`
	MillisecondsPerSlot uint64    `json:"milliseconds_per_slot"`
}

type SyncStatusResponse

type SyncStatusResponse struct {
	IsSyncing bool `json:"is_syncing"`
}

Response types

type ValidatorResponse

type ValidatorResponse struct {
	Balance   uint64 `json:"balance"`
	Validator struct {
		Pubkey                     byteArray `json:"pubkey"`
		WithdrawalCredentials      byteArray `json:"withdrawal_credentials"`
		EffectiveBalance           uint64    `json:"effective_balance"`
		Slashed                    bool      `json:"slashed"`
		ActivationEligibilityEpoch uint64    `json:"activation_eligibility_epoch"`
		ActivationEpoch            uint64    `json:"activation_epoch"`
		ExitEpoch                  uint64    `json:"exit_epoch"`
		WithdrawableEpoch          uint64    `json:"withdrawable_epoch"`
	} `json:"validator"`
}

type ValidatorsRequest

type ValidatorsRequest struct {
	StateRoot string   `json:"state_root,omitempty"`
	Pubkeys   []string `json:"pubkeys"`
}

Request types

Jump to

Keyboard shortcuts

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