http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MPL-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: 60c1a274a556ac9f9ed1cc9e50fdb5cf4e6c97d297106e385648c8306d4cb095 Version: 0.1.3-dev

Index

Constants

View Source
const (
	Head      plainStateId = "head"
	Genesis   plainStateId = "genesis"
	Finalized plainStateId = "finalized"
)

Variables

View Source
var (
	ErrorIncompleteData      = fmt.Errorf("incomplete data (206)")
	ErrorBadRequest          = fmt.Errorf("bad request (400)")
	ErrorNotFound            = fmt.Errorf("not found (404)")
	ErrorInternalServerError = fmt.Errorf("internal server error (500)")
	ErrorServiceUnavailable  = fmt.Errorf("service unavailable (503)")
)

Functions

func Marshal

func Marshal(obj interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, obj interface{}, trackUnusedKeys bool) error

Types

type AttesterDuty

type AttesterDuty struct {
	PubKey                  string `json:"pubkey"`
	ValidatorIndex          uint   `json:"validator_index"`
	Slot                    uint64 `json:"slot"`
	CommitteeIndex          uint64 `json:"committee_index"`
	CommitteeLength         uint64 `json:"committee_length"`
	CommitteeAtSlot         uint64 `json:"committees_at_slot"`
	ValidatorCommitteeIndex uint64 `json:"validator_committee_index"`
}

type BeaconCommitteeSubscription added in v0.1.1

type BeaconCommitteeSubscription struct {
	ValidatorIndex   uint64 `json:"validator_index"`
	Slot             uint64 `json:"slot"`
	CommitteeIndex   uint64 `json:"committee_index"`
	CommitteesAtSlot uint64 `json:"committee_at_slot"`
	IsAggregator     bool   `json:"is_aggregator"`
}

type BeaconEndpoint

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

func (*BeaconEndpoint) Genesis

func (b *BeaconEndpoint) Genesis() (*GenesisInfo, error)

func (*BeaconEndpoint) GetBlock added in v0.1.1

func (b *BeaconEndpoint) GetBlock(id BlockId, block consensus.BeaconBlock) (*Block, error)

func (*BeaconEndpoint) GetBlockAttestations added in v0.1.1

func (b *BeaconEndpoint) GetBlockAttestations(id BlockId) ([]*consensus.Attestation, error)

func (*BeaconEndpoint) GetBlockHeader added in v0.1.1

func (b *BeaconEndpoint) GetBlockHeader(id BlockId) (*BlockHeaderResponse, error)

func (*BeaconEndpoint) GetBlockRoot added in v0.1.1

func (b *BeaconEndpoint) GetBlockRoot(id BlockId) ([32]byte, error)

func (*BeaconEndpoint) GetFinalityCheckpoints added in v0.1.1

func (b *BeaconEndpoint) GetFinalityCheckpoints(id StateId) (*FinalizedCheckpoints, error)

func (*BeaconEndpoint) GetFork added in v0.1.1

func (b *BeaconEndpoint) GetFork(id StateId) (*consensus.Fork, error)

func (*BeaconEndpoint) GetRoot added in v0.1.1

func (b *BeaconEndpoint) GetRoot(id StateId) ([32]byte, error)

func (*BeaconEndpoint) GetValidatorByPubKey

func (b *BeaconEndpoint) GetValidatorByPubKey(pub string, id StateId) (*Validator, error)

func (*BeaconEndpoint) GetValidators added in v0.1.1

func (b *BeaconEndpoint) GetValidators(id StateId) ([]*Validator, error)

func (*BeaconEndpoint) PublishAttestations

func (b *BeaconEndpoint) PublishAttestations(data []*consensus.Attestation) error

func (*BeaconEndpoint) PublishSignedBlock

func (b *BeaconEndpoint) PublishSignedBlock(block consensus.SignedBeaconBlock) error

func (*BeaconEndpoint) SubmitCommitteeDuties

func (b *BeaconEndpoint) SubmitCommitteeDuties(duties []*consensus.SyncCommitteeMessage) error

type Block added in v0.1.1

type Block struct {
	Message   consensus.BeaconBlock
	Signature [96]byte
}

type BlockEvent added in v0.1.1

type BlockEvent struct {
	Slot                uint64   `json:"slot"`
	Block               [32]byte `json:"block"`
	ExecutionOptimistic bool     `json:"execution_optimistic"`
}

type BlockHeader added in v0.1.1

type BlockHeader struct {
	Message   *consensus.BeaconBlockHeader `json:"message"`
	Signature [96]byte                     `json:"signature"`
}

type BlockHeaderResponse added in v0.1.1

type BlockHeaderResponse struct {
	Root      [32]byte     `json:"root"`
	Canonical bool         `json:"canonical"`
	Header    *BlockHeader `json:"header"`
}

type BlockId added in v0.1.1

type BlockId interface {
	BlockID() string
}

type BuilderBid added in v0.1.1

type BuilderBid struct {
	Header *consensus.ExecutionPayloadHeader `json:"header"`
	Value  consensus.Uint256                 `json:"value" ssz-size:"32"`
	Pubkey [48]byte                          `json:"pubkey" ssz-size:"48"`
}

type BuilderEndpoint added in v0.1.1

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

func (*BuilderEndpoint) GetExecutionPayload added in v0.1.1

func (b *BuilderEndpoint) GetExecutionPayload(slot uint64, parentHash [32]byte, pubKey [48]byte) (*SignedBuilderBid, error)

func (*BuilderEndpoint) RegisterValidator added in v0.1.1

func (b *BuilderEndpoint) RegisterValidator(msg []*SignedValidatorRegistration) error

func (*BuilderEndpoint) Status added in v0.1.1

func (b *BuilderEndpoint) Status() (bool, error)

func (*BuilderEndpoint) SubmitBlindedBlock added in v0.1.1

type ChainReorgEvent added in v0.1.1

type ChainReorgEvent struct {
	Slot                uint64   `json:"slot"`
	Depth               uint64   `json:"depth"`
	OldHeadBlock        [32]byte `json:"old_head_block"`
	NewHeadBlock        [32]byte `json:"new_head_block"`
	OldHeadState        [32]byte `json:"old_head_state"`
	NewHeadState        [32]byte `json:"new_head_state"`
	Epoch               uint64   `json:"epoch"`
	ExecutionOptimistic bool     `json:"execution_optimistic"`
}

type Client

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

func New

func New(url string, opts ...ConfigOption) *Client

func (*Client) Beacon

func (c *Client) Beacon() *BeaconEndpoint

func (*Client) Builder added in v0.1.1

func (c *Client) Builder() *BuilderEndpoint

func (*Client) Config

func (c *Client) Config() *ConfigEndpoint

func (*Client) Events

func (c *Client) Events(ctx context.Context, topics []string, handler func(obj interface{})) error

func (*Client) Get

func (c *Client) Get(path string, out interface{}) error

func (*Client) Node

func (c *Client) Node() *NodeEndpoint

func (*Client) Post

func (c *Client) Post(path string, input interface{}, out interface{}) error

func (*Client) SetLogger

func (c *Client) SetLogger(logger *log.Logger)

func (*Client) Status added in v0.1.1

func (c *Client) Status(path string) (bool, error)

func (*Client) Validator

func (c *Client) Validator() *ValidatorEndpoint

type CommitteeSyncDuty

type CommitteeSyncDuty struct {
	PubKey                        string   `json:"pubkey"`
	ValidatorIndex                uint     `json:"validator_index"`
	ValidatorSyncCommitteeIndices []string `json:"validator_sync_committee_indices"`
}

type Config added in v0.1.1

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

type ConfigEndpoint

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

func (*ConfigEndpoint) DepositContract

func (c *ConfigEndpoint) DepositContract() (*DepositContract, error)

func (*ConfigEndpoint) ForkSchedule added in v0.1.1

func (c *ConfigEndpoint) ForkSchedule() ([]*consensus.Fork, error)

func (*ConfigEndpoint) Spec

func (c *ConfigEndpoint) Spec() (*consensus.Spec, error)

type ConfigOption added in v0.1.1

type ConfigOption func(*Config)

func WithLogger added in v0.1.1

func WithLogger(logger *log.Logger) ConfigOption

func WithUntrackedKeys added in v0.1.1

func WithUntrackedKeys() ConfigOption

type DepositContract

type DepositContract struct {
	ChainID uint64 `json:"chain_id"`
	Address string `json:"address"`
}

type FinalizedCheckpointEvent added in v0.1.1

type FinalizedCheckpointEvent struct {
	Block               [32]byte `json:"block"`
	State               [32]byte `json:"state"`
	Epoch               uint64   `json:"epoch"`
	ExecutionOptimistic bool     `json:"execution_optimistic"`
}

type FinalizedCheckpoints added in v0.1.1

type FinalizedCheckpoints struct {
	PreviousJustifiedCheckpoint *consensus.Checkpoint `json:"previous_justified"`
	CurrentJustifiedCheckpoint  *consensus.Checkpoint `json:"current_justified"`
	FinalizedCheckpoint         *consensus.Checkpoint `json:"finalized"`
}

type GenesisInfo added in v0.1.1

type GenesisInfo struct {
	Time uint64   `json:"genesis_time"`
	Root [32]byte `json:"genesis_validators_root"`
	Fork string   `json:"genesis_fork_version"`
}

type HeadEvent

type HeadEvent struct {
	Slot                      uint64   `json:"slot"`
	Block                     [32]byte `json:"block"`
	State                     [32]byte `json:"state"`
	EpochTransition           bool     `json:"epoch_transition"`
	CurrentDutyDependentRoot  [32]byte `json:"current_duty_dependent_root"`
	PreviousDutyDependentRoot [32]byte `json:"previous_duty_dependent_root"`
	ExecutionOptimistic       bool     `json:"execution_optimistic"`
}

type Identity

type Identity struct {
	PeerID             string            `json:"peer_id"`
	ENR                string            `json:"enr"`
	P2PAddresses       []string          `json:"p2p_addresses"`
	DiscoveryAddresses []string          `json:"discovery_addresses"`
	Metadata           *IdentityMetadata `json:"metadata"`
}

type IdentityMetadata added in v0.1.1

type IdentityMetadata struct {
	SeqNumber uint64 `json:"seq_number"`
	AttNets   string `json:"attnets"`
	SyncNets  string `json:"syncnets"`
}

type NodeEndpoint

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

func (*NodeEndpoint) GetPeer

func (n *NodeEndpoint) GetPeer(peerID string) (*Peer, error)

func (*NodeEndpoint) Health added in v0.1.1

func (n *NodeEndpoint) Health() (bool, error)

func (*NodeEndpoint) Identity

func (n *NodeEndpoint) Identity() (*Identity, error)

Identity returns the node network identity

func (*NodeEndpoint) PeerCount

func (n *NodeEndpoint) PeerCount() (*PeerCount, error)

func (*NodeEndpoint) Peers

func (n *NodeEndpoint) Peers() ([]*Peer, error)

func (*NodeEndpoint) Syncing

func (n *NodeEndpoint) Syncing() (*Syncing, error)

func (*NodeEndpoint) Version

func (n *NodeEndpoint) Version() (string, error)

type Peer

type Peer struct {
	PeerID              string `json:"peer_id"`
	Enr                 string `json:"enr"`
	LastSeendP2PAddress string `json:"last_seen_p2p_address"`
	State               string `json:"state"`
	Direction           string `json:"direction"`
}

type PeerCount

type PeerCount struct {
	Disconnected  uint64 `json:"disconnected"`
	Connecting    uint64 `json:"connecting"`
	Connected     uint64 `json:"connected"`
	Disconnecting uint64 `json:"disconnecting"`
}

type ProposalPreparation added in v0.1.1

type ProposalPreparation struct {
	ValidatorIndex uint64
	FeeRecipient   [20]byte
}

type ProposerDuty

type ProposerDuty struct {
	PubKey         string `json:"pubkey"`
	ValidatorIndex uint   `json:"validator_index"`
	Slot           uint64 `json:"slot"`
}

type RegisterValidatorRequest added in v0.1.1

type RegisterValidatorRequest struct {
	FeeRecipient [20]byte `json:"fee_recipient" ssz-size:"20"`
	GasLimit     uint64   `json:"gas_limit,string"`
	Timestamp    uint64   `json:"timestamp,string"`
	Pubkey       [48]byte `json:"pubkey" ssz-size:"48"`
}

func (*RegisterValidatorRequest) GetTree added in v0.1.1

func (r *RegisterValidatorRequest) GetTree() (*ssz.Node, error)

GetTree ssz hashes the RegisterValidatorRequest object

func (*RegisterValidatorRequest) HashTreeRoot added in v0.1.1

func (r *RegisterValidatorRequest) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the RegisterValidatorRequest object

func (*RegisterValidatorRequest) HashTreeRootWith added in v0.1.1

func (r *RegisterValidatorRequest) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the RegisterValidatorRequest object with a hasher

func (*RegisterValidatorRequest) MarshalSSZ added in v0.1.1

func (r *RegisterValidatorRequest) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the RegisterValidatorRequest object

func (*RegisterValidatorRequest) MarshalSSZTo added in v0.1.1

func (r *RegisterValidatorRequest) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the RegisterValidatorRequest object to a target array

func (*RegisterValidatorRequest) SizeSSZ added in v0.1.1

func (r *RegisterValidatorRequest) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the RegisterValidatorRequest object

func (*RegisterValidatorRequest) UnmarshalSSZ added in v0.1.1

func (r *RegisterValidatorRequest) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the RegisterValidatorRequest object

type SignedBuilderBid added in v0.1.1

type SignedBuilderBid struct {
	Message   *BuilderBid `json:"message"`
	Signature [96]byte    `json:"signature" ssz-size:"96"`
}

type SignedValidatorRegistration added in v0.1.1

type SignedValidatorRegistration struct {
	Message   *RegisterValidatorRequest `json:"message"`
	Signature [96]byte                  `json:"signature" ssz-size:"96"`
}

type Slot added in v0.1.1

type Slot uint64

func (Slot) BlockID added in v0.1.1

func (s Slot) BlockID() string

func (Slot) StateID added in v0.1.1

func (s Slot) StateID() string

type StateId added in v0.1.1

type StateId interface {
	StateID() string
}

type SyncCommitteeSubscription added in v0.1.1

type SyncCommitteeSubscription struct {
	ValidatorIndex       uint64   `json:"validator_index"`
	SyncCommitteeIndices []uint64 `json:"sync_committee_indices"`
	UntilEpoch           uint64   `json:"until_epoch"`
}

type Syncing

type Syncing struct {
	HeadSlot     uint64 `json:"head_slot"`
	SyncDistance string `json:"sync_distance"`
	IsSyncing    bool   `json:"is_syncing"`
	IsOptimistic bool   `json:"is_optimistic"`
}

type Validator

type Validator struct {
	Index     uint64             `json:"index"`
	Balance   uint64             `json:"balance"`
	Status    ValidatorStatus    `json:"status"`
	Validator *ValidatorMetadata `json:"validator"`
}

type ValidatorEndpoint

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

func (*ValidatorEndpoint) AggregateAttestation

func (v *ValidatorEndpoint) AggregateAttestation(slot uint64, root [32]byte) (*consensus.Attestation, error)

func (*ValidatorEndpoint) BeaconCommitteeSubscriptions added in v0.1.1

func (v *ValidatorEndpoint) BeaconCommitteeSubscriptions(subs []*BeaconCommitteeSubscription) error

func (*ValidatorEndpoint) GetAttesterDuties

func (v *ValidatorEndpoint) GetAttesterDuties(epoch uint64, indexes []string) ([]*AttesterDuty, error)

func (*ValidatorEndpoint) GetBlock

func (v *ValidatorEndpoint) GetBlock(out consensus.BeaconBlock, slot uint64, randao [96]byte) error

func (*ValidatorEndpoint) GetCommitteeSyncDuties

func (v *ValidatorEndpoint) GetCommitteeSyncDuties(epoch uint64, indexes []string) ([]*CommitteeSyncDuty, error)

func (*ValidatorEndpoint) GetProposerDuties

func (v *ValidatorEndpoint) GetProposerDuties(epoch uint64) ([]*ProposerDuty, error)

func (*ValidatorEndpoint) PrepareBeaconProposer added in v0.1.1

func (v *ValidatorEndpoint) PrepareBeaconProposer(input []*ProposalPreparation) error

func (*ValidatorEndpoint) PublishAggregateAndProof

func (v *ValidatorEndpoint) PublishAggregateAndProof(data []*consensus.SignedAggregateAndProof) error

func (*ValidatorEndpoint) RegisterValidator added in v0.1.1

func (v *ValidatorEndpoint) RegisterValidator(msg []*SignedValidatorRegistration) error

func (*ValidatorEndpoint) RequestAttestationData

func (v *ValidatorEndpoint) RequestAttestationData(slot uint64, committeeIndex uint64) (*consensus.AttestationData, error)

func (*ValidatorEndpoint) SubmitSignedContributionAndProof

func (v *ValidatorEndpoint) SubmitSignedContributionAndProof(signedContribution []*consensus.SignedContributionAndProof) error

func (*ValidatorEndpoint) SyncCommitteeContribution

func (v *ValidatorEndpoint) SyncCommitteeContribution(slot uint64, subCommitteeIndex uint64, root [32]byte) (*consensus.SyncCommitteeContribution, error)

produces a sync committee contribution

func (*ValidatorEndpoint) SyncCommitteeSubscriptions added in v0.1.1

func (v *ValidatorEndpoint) SyncCommitteeSubscriptions(subs []*SyncCommitteeSubscription) error

type ValidatorMetadata

type ValidatorMetadata struct {
	PubKey                     string `json:"pubkey"`
	WithdrawalCredentials      string `json:"withdrawal_credentials"`
	EffectiveBalance           uint64 `json:"effective_balance"`
	Slashed                    bool   `json:"slashed"`
	ActivationElegibilityEpoch uint64 `json:"activation_eligibility_epoch"`
	ActivationEpoch            uint64 `json:"activation_epoch"`
	ExitEpoch                  uint64 `json:"exit_epoch"`
	WithdrawableEpoch          uint64 `json:"withdrawable_epoch"`
}

type ValidatorStatus added in v0.1.1

type ValidatorStatus string
const (
	ValidatorStatusUnknown ValidatorStatus = "unknown"
	ValidatorStatusActive  ValidatorStatus = "active"
	ValidatorStatusPending ValidatorStatus = "pending"
	ValidatorStatusExited  ValidatorStatus = "exited"
)

Jump to

Keyboard shortcuts

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