Documentation ¶
Index ¶
- func EthCLAddrFlag(v *viper.Viper, f *pflag.FlagSet)
- func Flags(v *viper.Viper, f *pflag.FlagSet)
- func GetCLAddr(v *viper.Viper) string
- func InspectGetBlockRootResponse(resp *http.Response) (*beaconcommon.Root, error)
- func WithBeaconErrorUnlessOK() autorest.RespondDecorator
- type Client
- func (c *Client) GetAttestations(ctx context.Context) (beaconphase0.Attestations, error)
- func (c *Client) GetAttesterSlashings(ctx context.Context) (beaconphase0.AttesterSlashings, error)
- func (c *Client) GetBlock(ctx context.Context, blockID string) (*bellatrix.SignedBeaconBlock, error)
- func (c *Client) GetBlockAttestations(ctx context.Context, blockID string) (beaconphase0.Attestations, error)
- func (c *Client) GetBlockHeader(ctx context.Context, blockID string) (*types.BeaconBlockHeader, error)
- func (c *Client) GetBlockHeaders(ctx context.Context, slot *beaconcommon.Slot, parentRoot *beaconcommon.Root) ([]*types.BeaconBlockHeader, error)
- func (c *Client) GetBlockRoot(ctx context.Context, blockID string) (*beaconcommon.Root, error)
- func (c *Client) GetCommittees(ctx context.Context, stateID string, epoch *beaconcommon.Epoch, ...) ([]*types.Committee, error)
- func (c *Client) GetGenesis(ctx context.Context) (*types.Genesis, error)
- func (c *Client) GetNodeVersion(ctx context.Context) (string, error)
- func (c *Client) GetProposerSlashings(ctx context.Context) (beaconphase0.ProposerSlashings, error)
- func (c *Client) GetSpec(ctx context.Context) (*beaconcommon.Spec, error)
- func (c *Client) GetStateFinalityCheckpoints(ctx context.Context, stateID string) (*types.StateFinalityCheckpoints, error)
- func (c *Client) GetStateFork(ctx context.Context, stateID string) (*beaconcommon.Fork, error)
- func (c *Client) GetStateRoot(ctx context.Context, stateID string) (*beaconcommon.Root, error)
- func (c *Client) GetSyncCommittees(ctx context.Context, stateID string, epoch *beaconcommon.Epoch) (*types.SyncCommittees, error)
- func (c *Client) GetValidator(ctx context.Context, stateID, validatorID string) (*types.Validator, error)
- func (c *Client) GetValidatorBalances(ctx context.Context, stateID string, validatorIDs []string) ([]*types.ValidatorBalance, error)
- func (c *Client) GetValidators(ctx context.Context, stateID string, validatorIDs, statuses []string) ([]*types.Validator, error)
- func (c *Client) GetVoluntaryExits(ctx context.Context) (beaconphase0.VoluntaryExits, error)
- func (c *Client) Logger() logrus.FieldLogger
- func (c *Client) SetLogger(logger logrus.FieldLogger)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EthCLAddrFlag ¶ added in v0.3.1
EthCLAddrFlag register flag for Eth1 node to connect to
func InspectGetBlockRootResponse ¶
func InspectGetBlockRootResponse(resp *http.Response) (*beaconcommon.Root, error)
func WithBeaconErrorUnlessOK ¶
func WithBeaconErrorUnlessOK() autorest.RespondDecorator
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods to connect to an Ethereum 2.0 Beacon chain node
func NewClient ¶
NewClient creates a client connecting to an Ethereum 2.0 Beacon chain node at given addr
func NewClientFromClient ¶
func (*Client) GetAttestations ¶
func (c *Client) GetAttestations(ctx context.Context) (beaconphase0.Attestations, error)
GetAttestations returns attestations known by the node but not necessarily incorporated into any block.
func (*Client) GetAttesterSlashings ¶
func (c *Client) GetAttesterSlashings(ctx context.Context) (beaconphase0.AttesterSlashings, error)
GetAttesterSlashings returns attester slashings known by the node but not necessarily incorporated into any block.
func (*Client) GetBlock ¶
func (c *Client) GetBlock(ctx context.Context, blockID string) (*bellatrix.SignedBeaconBlock, error)
GetBlock returns block details for given block id.
func (*Client) GetBlockAttestations ¶
func (c *Client) GetBlockAttestations(ctx context.Context, blockID string) (beaconphase0.Attestations, error)
GetBlockAttestations returns attestations included in requested block with given blockID
func (*Client) GetBlockHeader ¶
func (c *Client) GetBlockHeader(ctx context.Context, blockID string) (*types.BeaconBlockHeader, error)
GetBlockHeader returns block header for given blockID
func (*Client) GetBlockHeaders ¶
func (c *Client) GetBlockHeaders(ctx context.Context, slot *beaconcommon.Slot, parentRoot *beaconcommon.Root) ([]*types.BeaconBlockHeader, error)
GetBlockHeaders return block headers Set slot and/or parentRoot to filter result (if nil no filter is applied)
func (*Client) GetBlockRoot ¶
GetBlockRoot returns hashTreeRoot of block
func (*Client) GetCommittees ¶
func (c *Client) GetCommittees(ctx context.Context, stateID string, epoch *beaconcommon.Epoch, index *beaconcommon.CommitteeIndex, slot *beaconcommon.Slot) ([]*types.Committee, error)
GetCommittees returns the committees for the given state. Set epoch and/or index and/or slot to filter result (if nil no filter is applied)
func (*Client) GetGenesis ¶
GetGenesis returns genesis block
func (*Client) GetNodeVersion ¶
GetNodeVersion returns node's version contains informations about the node processing the request
func (*Client) GetProposerSlashings ¶
func (c *Client) GetProposerSlashings(ctx context.Context) (beaconphase0.ProposerSlashings, error)
GetProposerSlashings returns proposer slashings known by the node but not necessarily incorporated into any block.
func (*Client) GetStateFinalityCheckpoints ¶
func (c *Client) GetStateFinalityCheckpoints(ctx context.Context, stateID string) (*types.StateFinalityCheckpoints, error)
GetStateFinalityCheckpoints returns finality checkpoints for state with given stateID In case finality is not yet achieved returns epoch 0 and ZERO_HASH as root.
func (*Client) GetStateFork ¶
GetStateFork returns Fork object for state with given stateID
func (*Client) GetStateRoot ¶
GetStateRoot returns State root for state with given stateID
func (*Client) GetSyncCommittees ¶
func (c *Client) GetSyncCommittees(ctx context.Context, stateID string, epoch *beaconcommon.Epoch) (*types.SyncCommittees, error)
GetSyncCommittees returns the sync committees for given stateID Set epoch to filter result (if nil no filter is applied)
func (*Client) GetValidator ¶
func (c *Client) GetValidator(ctx context.Context, stateID, validatorID string) (*types.Validator, error)
GetValidator returns validator specified by stateID and validatorID
func (*Client) GetValidatorBalances ¶
func (c *Client) GetValidatorBalances(ctx context.Context, stateID string, validatorIDs []string) ([]*types.ValidatorBalance, error)
GetValidatorBalances returns list of validator balances. Set validatorsIDs to filter validator result (if empty no filter is applied)
func (*Client) GetValidators ¶
func (c *Client) GetValidators(ctx context.Context, stateID string, validatorIDs, statuses []string) ([]*types.Validator, error)
GetValidators returns list of validators Set validatorsIDs and/or statuses to filter result (if empty no filter is applied)
func (*Client) GetVoluntaryExits ¶
func (c *Client) GetVoluntaryExits(ctx context.Context) (beaconphase0.VoluntaryExits, error)
GetVoluntaryExits returns voluntary exits known by the node but not necessarily incorporated into any block.
func (*Client) Logger ¶
func (c *Client) Logger() logrus.FieldLogger
func (*Client) SetLogger ¶
func (c *Client) SetLogger(logger logrus.FieldLogger)
type Config ¶
type Config struct { Address string HTTP *kilnhttp.ClientConfig }
func ConfigFromViper ¶ added in v0.3.1
func (*Config) SetDefault ¶
Source Files ¶
- client.go
- config.go
- flags.go
- get_attestations.go
- get_attester_slashings.go
- get_block.go
- get_block_attestations.go
- get_block_header.go
- get_block_headers.go
- get_block_root.go
- get_committees.go
- get_genesis.go
- get_node_version.go
- get_proposer_slashings.go
- get_spec.go
- get_state_finality_checkpoints.go
- get_state_fork.go
- get_state_root.go
- get_sync_committees.go
- get_validator.go
- get_validator_balances.go
- get_validators.go
- get_voluntary_exits.go
- handle_error.go