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) GetValidatorProposerDuties(indices []uint64, epoch uint64) (map[uint64]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)
- func (c *Client) GetValidatorSyncDuties(indices []uint64, epoch uint64) (map[uint64]bool, error)
- type Eth2ConfigResponse
- type Eth2DepositContractResponse
- type FinalityCheckpointsResponse
- type ForkResponse
- type GenesisResponse
- type ProposerDutiesResponse
- type ProposerDuty
- type SyncDutiesResponse
- type SyncDuty
- 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" RequestValidatorSyncDuties = "/eth/v1/validator/duties/sync/%s" RequestValidatorProposerDuties = "/eth/v1/validator/duties/proposer/%s" MaxRequestValidatorsCount = 600 )
Config
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconBlockResponse ¶ added in v1.1.0
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
}
Prysm client
func (*Client) ExitValidator ¶ added in v0.0.6
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 ¶ added in v1.0.0
func (c *Client) GetClientType() beacon.BeaconClientType
Get the beacon client type
func (*Client) GetDomainData ¶ added in v0.0.6
Get domain data for a domain type at a given epoch
func (*Client) GetEth1DataForEth2Block ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v0.0.6
func (c *Client) GetValidatorIndex(pubkey types.ValidatorPubkey) (uint64, error)
Get a validator's index
func (*Client) GetValidatorProposerDuties ¶ added in v1.2.0
func (c *Client) GetValidatorProposerDuties(indices []uint64, epoch uint64) (map[uint64]uint64, error)
Sums proposer duties per validators for a given epoch
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 ¶ added in v1.1.0
type Eth2ConfigResponse struct {
Data struct {
SecondsPerSlot uinteger `json:"SECONDS_PER_SLOT"`
SlotsPerEpoch uinteger `json:"SLOTS_PER_EPOCH"`
EpochsPerSyncCommitteePeriod uinteger `json:"EPOCHS_PER_SYNC_COMMITTEE_PERIOD"`
} `json:"data"`
}
type Eth2DepositContractResponse ¶ added in v1.1.0
type FinalityCheckpointsResponse ¶ added in v1.1.0
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 ¶ added in v1.1.0
type ForkResponse struct {
Data struct {
PreviousVersion byteArray `json:"previous_version"`
CurrentVersion byteArray `json:"current_version"`
Epoch uinteger `json:"epoch"`
}
}
type GenesisResponse ¶ added in v1.1.0
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 ProposerDutiesResponse ¶ added in v1.2.0
type ProposerDutiesResponse struct {
Data []ProposerDuty `json:"data"`
}
type ProposerDuty ¶ added in v1.2.0
type ProposerDuty struct {
ValidatorIndex uinteger `json:"validator_index"`
}
type SyncDutiesResponse ¶ added in v1.2.0
type SyncDutiesResponse struct {
Data []SyncDuty `json:"data"`
}
type SyncDuty ¶ added in v1.2.0
type SyncDuty struct { Pubkey byteArray `json:"pubkey"` ValidatorIndex uinteger `json:"validator_index"` SyncCommitteeIndices []uinteger `json:"validator_sync_committee_indices"` }
type SyncStatusResponse ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
type VoluntaryExitMessage struct { Epoch uinteger `json:"epoch"` ValidatorIndex uinteger `json:"validator_index"` }
type VoluntaryExitRequest ¶ added in v1.1.0
type VoluntaryExitRequest struct { Message VoluntaryExitMessage `json:"message"` Signature byteArray `json:"signature"` }
Request types
Click to show internal directories.
Click to hide internal directories.