Documentation
¶
Overview ¶
package client is responsible for easily interacting with the protobuf API in Go. It contains wrappers for all the rpc methods that accept standard go-ethereum objects.
Index ¶
- func TxToProto(tx *types.Transaction) (*eth.Transaction, error)
- type Attestation
- type AttestationData
- type AttesterSlashing
- type BeaconBlock
- type BeaconBlockBody
- type BeaconBlockHeader
- type Checkpoint
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) SendRawTransaction(ctx context.Context, rawTx []byte) (string, int64, error)
- func (c *Client) SendRawTransactionSequence(ctx context.Context, rawTransactions ...[]byte) ([]string, int64, error)
- func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) (string, int64, error)
- func (c *Client) SendTransactionSequence(ctx context.Context, transactions ...*types.Transaction) ([]string, int64, error)
- func (c *Client) SubscribeNewBeaconBlocks(ch chan<- *BeaconBlock) error
- func (c *Client) SubscribeNewExecutionPayloadHeaders(ch chan<- *ExecutionPayloadHeader) error
- func (c *Client) SubscribeNewExecutionPayloads(ch chan<- *ExecutionPayload) error
- func (c *Client) SubscribeNewTxs(filter *filter.Filter, ch chan<- *Transaction) error
- type Deposit
- type DepositData
- type Eth1Data
- type ExecutionChange
- type ExecutionChangeMessage
- type ExecutionPayload
- type ExecutionPayloadHeader
- type IndexedAttestation
- type ProposerSlashing
- type SignedBeaconBlockHeader
- type SyncAggregate
- type Transaction
- type VoluntaryExit
- type VoluntaryExitMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TxToProto ¶
func TxToProto(tx *types.Transaction) (*eth.Transaction, error)
TxToProto converts a go-ethereum transaction to a protobuf transaction.
Types ¶
type Attestation ¶ added in v1.6.0
type Attestation struct { AggregationBits common.Hash Data *AttestationData Signature common.Hash }
type AttestationData ¶ added in v1.6.0
type AttestationData struct { Slot uint64 Index uint64 BeaconBlockRoot common.Hash Source *Checkpoint Target *Checkpoint }
type AttesterSlashing ¶ added in v1.6.0
type AttesterSlashing struct { Attestation1 *IndexedAttestation Attestation2 *IndexedAttestation }
type BeaconBlock ¶ added in v1.6.0
type BeaconBlock struct { Slot uint64 ProposerIndex uint64 ParentRoot common.Hash StateRoot common.Hash Body *BeaconBlockBody }
func ProtoToBeaconBlock ¶ added in v1.6.0
func ProtoToBeaconBlock(block *eth.CompactBeaconBlock) *BeaconBlock
type BeaconBlockBody ¶ added in v1.6.0
type BeaconBlockBody struct { RandaoReveal common.Hash Eth1Data *Eth1Data Graffiti common.Hash ProposerSlashingsList []ProposerSlashing AttesterSlashingsList []AttesterSlashing AttestationsList []Attestation DepositsList []Deposit VoluntaryExitsList []VoluntaryExit SyncAggregate *SyncAggregate BlsToExecutionChangesList []ExecutionChange }
type BeaconBlockHeader ¶ added in v1.6.0
type Checkpoint ¶ added in v1.6.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Close ¶
Close closes all the streams and then the underlying connection. IMPORTANT: you should call this to ensure correct API accounting.
func (*Client) Connect ¶
Connects sets up the gRPC channel and creates the stub. It blocks until connected or the given context expires. Always use a context with timeout.
func (*Client) SendRawTransaction ¶
func (*Client) SendRawTransactionSequence ¶ added in v1.5.0
func (*Client) SendTransaction ¶
SendTransaction sends the (signed) transaction to Fibernet and returns the hash and a timestamp (us). It blocks until the transaction was sent.
func (*Client) SendTransactionSequence ¶ added in v1.5.0
func (*Client) SubscribeNewBeaconBlocks ¶ added in v1.6.0
func (c *Client) SubscribeNewBeaconBlocks(ch chan<- *BeaconBlock) error
func (*Client) SubscribeNewExecutionPayloadHeaders ¶ added in v1.6.0
func (c *Client) SubscribeNewExecutionPayloadHeaders(ch chan<- *ExecutionPayloadHeader) error
func (*Client) SubscribeNewExecutionPayloads ¶ added in v1.6.0
func (c *Client) SubscribeNewExecutionPayloads(ch chan<- *ExecutionPayload) error
func (*Client) SubscribeNewTxs ¶
func (c *Client) SubscribeNewTxs(filter *filter.Filter, ch chan<- *Transaction) error
SubscribeNewTxs subscribes to new transactions, and sends transactions on the given channel according to the filter. This function blocks and should be called in a goroutine. If there's an error receiving the new message it will close the channel and return the error.
type Deposit ¶ added in v1.6.0
type Deposit struct { ProofList []common.Hash Data *DepositData }
type DepositData ¶ added in v1.6.0
type ExecutionChange ¶ added in v1.6.0
type ExecutionChange struct { Message *ExecutionChangeMessage Signature common.Hash }
type ExecutionChangeMessage ¶ added in v1.6.0
type ExecutionPayload ¶ added in v1.6.0
type ExecutionPayload struct { Header *ExecutionPayloadHeader Transactions []*Transaction }
func ProtoToBlock ¶ added in v1.5.0
func ProtoToBlock(proto *eth.ExecutionPayload) *ExecutionPayload
type ExecutionPayloadHeader ¶ added in v1.6.0
type ExecutionPayloadHeader struct { Number uint64 Hash common.Hash ParentHash common.Hash PrevRandao common.Hash StateRoot common.Hash ReceiptRoot common.Hash FeeRecipient common.Address ExtraData []byte GasLimit uint64 GasUsed uint64 Timestamp uint64 LogsBloom types.Bloom BaseFeePerGas *big.Int }
func ProtoToHeader ¶ added in v1.5.0
func ProtoToHeader(proto *eth.ExecutionPayloadHeader) *ExecutionPayloadHeader
type IndexedAttestation ¶ added in v1.6.0
type IndexedAttestation struct { AttestingIndicesList []uint64 Data *AttestationData Signature common.Hash }
type ProposerSlashing ¶ added in v1.6.0
type ProposerSlashing struct { Header1 *SignedBeaconBlockHeader Header2 *SignedBeaconBlockHeader }
type SignedBeaconBlockHeader ¶ added in v1.6.0
type SignedBeaconBlockHeader struct { Message *BeaconBlockHeader Signature common.Hash }
type SyncAggregate ¶ added in v1.6.0
type Transaction ¶ added in v1.2.5
type Transaction struct { ChainID uint32 To *common.Address From common.Address Gas uint64 GasPrice *big.Int Hash common.Hash Input []byte Value *big.Int Nonce uint64 Type uint32 MaxFee *big.Int PriorityFee *big.Int V uint64 R []byte S []byte AccessList types.AccessList }
func ProtoToTx ¶
func ProtoToTx(proto *eth.Transaction) *Transaction
ProtoToTx converts a protobuf transaction to a go-ethereum transaction.
func (*Transaction) ToNative ¶ added in v1.2.5
func (tx *Transaction) ToNative() *types.Transaction
type VoluntaryExit ¶ added in v1.6.0
type VoluntaryExit struct { Message *VoluntaryExitMessage Signature common.Hash }