Documentation
¶
Index ¶
- func NewBoostRPCServer(opts BoostRPCServerOptions) (*http.Server, error)
- func NewHTTPServer(ctx context.Context, log logrus.Ext1FieldLogger, rpcSrv *gethRpc.Server, ...) *http.Server
- func NewRPCServer(namespace string, backend interface{}, authenticated bool) (*gethRpc.Server, error)
- type BlindedBeaconBlock
- type BlindedBeaconBlockBodyPartial
- type BoostRPCServerOptions
- type BoostService
- func (m *BoostService) GetHeaderV1(ctx context.Context, blockHash *string) (*GetHeaderResponse, error)
- func (m *BoostService) GetPayloadV1(ctx context.Context, block string) (*ExecutionPayloadV1, error)
- func (m *BoostService) SetFeeRecipientV1(ctx context.Context, message SetFeeRecipientMessage, ...) (*bool, error)
- type Error
- type ExecutionPayloadHeaderOnlyBlockHash
- type ExecutionPayloadHeaderV1
- type ExecutionPayloadV1
- type GetHeaderResponse
- type GetHeaderResponseMessage
- type SetFeeRecipientMessage
- type SignedBlindedBeaconBlock
- type Timeout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBoostRPCServer ¶
func NewBoostRPCServer(opts BoostRPCServerOptions) (*http.Server, error)
NewBoostRPCServer creates a new boost server
Types ¶
type BlindedBeaconBlock ¶
type BlindedBeaconBlock struct {
Slot string `json:"slot"`
ProposerIndex string `json:"proposer_index"`
ParentRoot string `json:"parent_root"`
StateRoot string `json:"state_root"`
Body json.RawMessage `json:"body"`
}
BlindedBeaconBlock forked from https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#beaconblock
type BlindedBeaconBlockBodyPartial ¶
type BlindedBeaconBlockBodyPartial struct {
ExecutionPayload ExecutionPayloadHeaderOnlyBlockHash `json:"execution_payload_header"`
ExecutionPayloadCamel ExecutionPayloadHeaderOnlyBlockHash `json:"executionPayloadHeader"`
}
BlindedBeaconBlockBodyPartial a partial block body only containing a payload, in both snake_case and camelCase
type BoostRPCServerOptions ¶
type BoostRPCServerOptions struct {
ListenAddr string
RelayURLs []string
Cors []string
Log *logrus.Entry
GetHeaderTimeout time.Duration // maximum wait time for a relay response to getHeaderV1
UserRequestTimeout Timeout
}
BoostRPCServerOptions contains the router configuration for NewRouter
type BoostService ¶
type BoostService struct {
// contains filtered or unexported fields
}
BoostService TODO
func (*BoostService) GetHeaderV1 ¶
func (m *BoostService) GetHeaderV1(ctx context.Context, blockHash *string) (*GetHeaderResponse, error)
GetHeaderV1 TODO
func (*BoostService) GetPayloadV1 ¶
func (m *BoostService) GetPayloadV1(ctx context.Context, block string) (*ExecutionPayloadV1, error)
GetPayloadV1 TODO
func (*BoostService) SetFeeRecipientV1 ¶
func (m *BoostService) SetFeeRecipientV1(ctx context.Context, message SetFeeRecipientMessage, publicKey, signature string) (*bool, error)
SetFeeRecipientV1 - returns true if at least one relay returns true
type ExecutionPayloadHeaderOnlyBlockHash ¶
type ExecutionPayloadHeaderOnlyBlockHash struct {
BlockHash string `json:"block_hash"`
BlockHashCamel string `json:"blockHash"`
}
ExecutionPayloadHeaderOnlyBlockHash an execution payload with only a block hash, used for BlindedBeaconBlockBodyPartial
type ExecutionPayloadHeaderV1 ¶
type ExecutionPayloadHeaderV1 struct {
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"`
StateRoot common.Hash `json:"stateRoot" gencodec:"required"`
ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"`
LogsBloom []byte `json:"logsBloom" gencodec:"required"`
PrevRandao common.Hash `json:"prevRandao" gencodec:"required"`
BlockNumber uint64 `json:"blockNumber" gencodec:"required"`
GasLimit uint64 `json:"gasLimit" gencodec:"required"`
GasUsed uint64 `json:"gasUsed" gencodec:"required"`
Timestamp uint64 `json:"timestamp" gencodec:"required"`
ExtraData []byte `json:"extraData" gencodec:"required"`
BaseFeePerGas *big.Int `json:"baseFeePerGas" gencodec:"required"`
BlockHash common.Hash `json:"blockHash" gencodec:"required"`
TransactionsRoot common.Hash `json:"transactionsRoot" gencodec:"required"`
}
ExecutionPayloadHeaderV1 as defined in https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#executionpayloadheaderv1
func (ExecutionPayloadHeaderV1) MarshalJSON ¶
func (e ExecutionPayloadHeaderV1) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*ExecutionPayloadHeaderV1) UnmarshalJSON ¶
func (e *ExecutionPayloadHeaderV1) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type ExecutionPayloadV1 ¶
type ExecutionPayloadV1 struct {
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"`
StateRoot common.Hash `json:"stateRoot" gencodec:"required"`
ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"`
LogsBloom []byte `json:"logsBloom" gencodec:"required"`
PrevRandao common.Hash `json:"prevRandao" gencodec:"required"`
BlockNumber uint64 `json:"blockNumber" gencodec:"required"`
GasLimit uint64 `json:"gasLimit" gencodec:"required"`
GasUsed uint64 `json:"gasUsed" gencodec:"required"`
Timestamp uint64 `json:"timestamp" gencodec:"required"`
ExtraData []byte `json:"extraData" gencodec:"required"`
BaseFeePerGas *big.Int `json:"baseFeePerGas" gencodec:"required"`
BlockHash common.Hash `json:"blockHash" gencodec:"required"`
Transactions *[]string `json:"transactions" gencodec:"required"`
}
ExecutionPayloadV1 as defined in https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#executionpayloadv1
func (ExecutionPayloadV1) MarshalJSON ¶
func (e ExecutionPayloadV1) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*ExecutionPayloadV1) UnmarshalJSON ¶
func (e *ExecutionPayloadV1) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type GetHeaderResponse ¶
type GetHeaderResponse struct {
Message GetHeaderResponseMessage `json:"message" gencodec:"required"`
PublicKey []byte `json:"publicKey" gencodec:"required"`
Signature []byte `json:"signature" gencodec:"required"`
}
GetHeaderResponse as defined in https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#response-1
func (GetHeaderResponse) MarshalJSON ¶
func (g GetHeaderResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*GetHeaderResponse) UnmarshalJSON ¶
func (g *GetHeaderResponse) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type GetHeaderResponseMessage ¶
type GetHeaderResponseMessage struct {
Header ExecutionPayloadHeaderV1 `json:"header" gencodec:"required"`
Value *big.Int `json:"value" gencodec:"required"`
}
GetHeaderResponseMessage as defined in https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#response-1
func (GetHeaderResponseMessage) MarshalJSON ¶
func (g GetHeaderResponseMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*GetHeaderResponseMessage) UnmarshalJSON ¶
func (g *GetHeaderResponseMessage) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type SetFeeRecipientMessage ¶
type SetFeeRecipientMessage struct {
FeeRecipient string `json:"feeRecipient"`
Timestamp string `json:"timestamp"`
}
SetFeeRecipientMessage as defined in https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#request
type SignedBlindedBeaconBlock ¶
type SignedBlindedBeaconBlock struct {
Message *BlindedBeaconBlock `json:"message"`
Signature string `json:"signature"`
}
SignedBlindedBeaconBlock forked from https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#signedbeaconblockheader
type Timeout ¶
type Timeout struct {
Read time.Duration // Timeout for body reads. None if 0.
ReadHeader time.Duration // Timeout for header reads. None if 0.
Write time.Duration // Timeout for writes. None if 0.
Idle time.Duration // Timeout to disconnect idle client connections. None if 0.
}
Timeout is used to configure the RPC server timeouts for user requests