Documentation ¶
Index ¶
- Constants
- type BeaconBlockResponse
- type Client
- func (c *Client) Close() error
- func (c *Client) ExitValidator(validatorIndex, epoch uint64, signature types.ValidatorSignature) error
- func (c *Client) GetBeaconHead() (beacon.BeaconHead, error)
- func (c *Client) GetClientType() beacon.BeaconClientType
- func (c *Client) GetDomainData(domainType []byte, epoch uint64) ([]byte, error)
- func (c *Client) GetEth1DataForEth2Block(blockId string) (beacon.Eth1Data, error)
- func (c *Client) GetEth2Config() (beacon.Eth2Config, error)
- func (c *Client) GetEth2DepositContract() (beacon.Eth2DepositContract, error)
- func (c *Client) GetSyncStatus() (beacon.SyncStatus, error)
- func (c *Client) GetValidatorIndex(pubkey types.ValidatorPubkey) (uint64, error)
- func (c *Client) GetValidatorStatus(pubkey types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)
- func (c *Client) GetValidatorStatuses(pubkeys []types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (map[types.ValidatorPubkey]beacon.ValidatorStatus, error)
- type Eth2ConfigResponse
- type Eth2DepositContractResponse
- type FinalityCheckpointsResponse
- type ForkResponse
- type GenesisResponse
- type SyncStatusResponse
- type Validator
- type ValidatorsResponse
- type VoluntaryExitMessage
- type VoluntaryExitRequest
Constants ¶
View Source
const ( RequestUrlFormat = "%s%s" RequestContentType = "application/json" RequestSyncStatusPath = "/eth/v1/node/syncing" RequestEth2ConfigPath = "/eth/v1/config/spec" RequestEth2DepositContractMethod = "/eth/v1/config/deposit_contract" RequestGenesisPath = "/eth/v1/beacon/genesis" RequestFinalityCheckpointsPath = "/eth/v1/beacon/states/%s/finality_checkpoints" RequestForkPath = "/eth/v1/beacon/states/%s/fork" RequestValidatorsPath = "/eth/v1/beacon/states/%s/validators" RequestVoluntaryExitPath = "/eth/v1/beacon/pool/voluntary_exits" RequestBeaconBlockPath = "/eth/v1/beacon/blocks/%s" MaxRequestValidatorsCount = 600 )
Config
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconBlockResponse ¶
type BeaconBlockResponse struct {
Data struct {
Message struct {
Body struct {
Eth1Data struct {
DepositRoot byteArray `json:"deposit_root"`
DepositCount uinteger `json:"deposit_count"`
BlockHash byteArray `json:"block_hash"`
} `json:"eth1_data"`
} `json:"body"`
} `json:"message"`
} `json:"data"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Nimbus client
func (*Client) ExitValidator ¶
func (c *Client) ExitValidator(validatorIndex, epoch uint64, signature types.ValidatorSignature) error
Perform a voluntary exit on a validator
func (*Client) GetBeaconHead ¶
func (c *Client) GetBeaconHead() (beacon.BeaconHead, error)
Get the beacon head
func (*Client) GetClientType ¶
func (c *Client) GetClientType() beacon.BeaconClientType
Get the beacon client type
func (*Client) GetDomainData ¶
Get domain data for a domain type at a given epoch
func (*Client) GetEth1DataForEth2Block ¶
Get the ETH1 data for the target beacon block
func (*Client) GetEth2Config ¶
func (c *Client) GetEth2Config() (beacon.Eth2Config, error)
Get the eth2 config
func (*Client) GetEth2DepositContract ¶
func (c *Client) GetEth2DepositContract() (beacon.Eth2DepositContract, error)
Get the eth2 deposit contract info
func (*Client) GetSyncStatus ¶
func (c *Client) GetSyncStatus() (beacon.SyncStatus, error)
Get the node's sync status
func (*Client) GetValidatorIndex ¶
func (c *Client) GetValidatorIndex(pubkey types.ValidatorPubkey) (uint64, error)
Get a validator's index
func (*Client) GetValidatorStatus ¶
func (c *Client) GetValidatorStatus(pubkey types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)
Get a validator's status
func (*Client) GetValidatorStatuses ¶
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 {
Data struct {
SecondsPerSlot uinteger `json:"SECONDS_PER_SLOT"`
SlotsPerEpoch uinteger `json:"SLOTS_PER_EPOCH"`
} `json:"data"`
}
type FinalityCheckpointsResponse ¶
type FinalityCheckpointsResponse struct {
Data struct {
PreviousJustified struct {
Epoch uinteger `json:"epoch"`
} `json:"previous_justified"`
CurrentJustified struct {
Epoch uinteger `json:"epoch"`
} `json:"current_justified"`
Finalized struct {
Epoch uinteger `json:"epoch"`
} `json:"finalized"`
} `json:"data"`
}
type ForkResponse ¶
type ForkResponse struct {
Data struct {
PreviousVersion byteArray `json:"previous_version"`
CurrentVersion byteArray `json:"current_version"`
Epoch uinteger `json:"epoch"`
}
}
type GenesisResponse ¶
type GenesisResponse struct {
Data struct {
GenesisTime uinteger `json:"genesis_time"`
GenesisForkVersion byteArray `json:"genesis_fork_version"`
GenesisValidatorsRoot byteArray `json:"genesis_validators_root"`
} `json:"data"`
}
type SyncStatusResponse ¶
type SyncStatusResponse struct { Data struct { IsSyncing bool `json:"is_syncing"` HeadSlot uinteger `json:"head_slot"` SyncDistance uinteger `json:"sync_distance"` } `json:"data"` }
Response types
type Validator ¶
type Validator struct { Index uinteger `json:"index"` Balance uinteger `json:"balance"` //Status string `json:"status"` Validator struct { Pubkey byteArray `json:"pubkey"` WithdrawalCredentials byteArray `json:"withdrawal_credentials"` EffectiveBalance uinteger `json:"effective_balance"` Slashed bool `json:"slashed"` ActivationEligibilityEpoch uinteger `json:"activation_eligibility_epoch"` ActivationEpoch uinteger `json:"activation_epoch"` ExitEpoch uinteger `json:"exit_epoch"` WithdrawableEpoch uinteger `json:"withdrawable_epoch"` } `json:"validator"` }
type ValidatorsResponse ¶ added in v1.1.0
type ValidatorsResponse struct {
Data []Validator `json:"data"`
}
type VoluntaryExitMessage ¶
type VoluntaryExitMessage struct { Epoch uinteger `json:"epoch"` ValidatorIndex uinteger `json:"validator_index"` }
type VoluntaryExitRequest ¶
type VoluntaryExitRequest struct { Message VoluntaryExitMessage `json:"message"` Signature byteArray `json:"signature"` }
Request types
Click to show internal directories.
Click to hide internal directories.