Documentation ¶
Overview ¶
Package api contains the API webserver for the proposer and block-builder APIs
Index ¶
- Variables
- func BuilderSubmitBlockRequestToSignedBuilderBid(req *types.BuilderSubmitBlockRequest, sk *bls.SecretKey, ...) (*types.SignedBuilderBid, error)
- func VerifyBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest) error
- type BidTraceJSON
- type BidTraceWithTimestampJSON
- type BlockSimulationRateLimiter
- type HTTPErrorResp
- type RelayAPI
- type RelayAPIOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequestClosed = errors.New("request context closed") ErrSimulationFailed = errors.New("simulation failed") )
View Source
var ( ErrMissingLogOpt = errors.New("log parameter is nil") ErrMissingBeaconClientOpt = errors.New("beacon-client is nil") ErrMissingDatastoreOpt = errors.New("proposer datastore is nil") ErrRelayPubkeyMismatch = errors.New("relay pubkey does not match existing one") ErrRegistrationWorkersAlreadyStarted = errors.New("validator registration workers already started") ErrServerAlreadyStarted = errors.New("server was already started") ErrBuilderAPIWithoutSecretKey = errors.New("cannot start builder API without secret key") )
View Source
var ( ErrMissingRequest = errors.New("req is nil") ErrMissingSecretKey = errors.New("secret key is nil") )
View Source
var ( ErrBlockHashMismatch = errors.New("blockHash mismatch") ErrParentHashMismatch = errors.New("parentHash mismatch") )
View Source
var NilResponse = struct{}{}
View Source
var VersionBellatrix types.VersionString = "bellatrix"
View Source
var ZeroU256 = types.IntToU256(0)
Functions ¶
func VerifyBuilderBlockSubmission ¶
func VerifyBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest) error
Types ¶
type BidTraceJSON ¶
type BidTraceJSON struct { Slot uint64 `json:"slot,string"` ParentHash string `json:"parent_hash"` BlockHash string `json:"block_hash"` BuilderPubkey string `json:"builder_pubkey"` ProposerPubkey string `json:"proposer_pubkey"` ProposerFeeRecipient string `json:"proposer_fee_recipient"` GasLimit uint64 `json:"gas_limit,string"` GasUsed uint64 `json:"gas_used,string"` Value string `json:"value"` }
type BidTraceWithTimestampJSON ¶ added in v0.5.1
type BidTraceWithTimestampJSON struct { BidTraceJSON Timestamp int64 `json:"timestamp,omitempty"` }
type BlockSimulationRateLimiter ¶
type BlockSimulationRateLimiter struct {
// contains filtered or unexported fields
}
func NewBlockSimulationRateLimiter ¶
func NewBlockSimulationRateLimiter(blockSimURL string) *BlockSimulationRateLimiter
type HTTPErrorResp ¶
type RelayAPI ¶
type RelayAPI struct {
// contains filtered or unexported fields
}
RelayAPI represents a single Relay instance
func NewRelayAPI ¶
func NewRelayAPI(opts RelayAPIOpts) (*RelayAPI, error)
NewRelayAPI creates a new service. if builders is nil, allow any builder
func (*RelayAPI) RespondError ¶
func (api *RelayAPI) RespondError(w http.ResponseWriter, code int, message string)
func (*RelayAPI) StartServer ¶
StartServer starts the HTTP server for this instance
type RelayAPIOpts ¶
type RelayAPIOpts struct { Log *logrus.Entry ListenAddr string BlockSimURL string BeaconClient beaconclient.IMultiBeaconClient Datastore *datastore.Datastore Redis *datastore.RedisCache DB database.IDatabaseService SecretKey *bls.SecretKey // used to sign bids (getHeader responses) // Network specific variables EthNetDetails common.EthNetworkDetails // APIs to enable ProposerAPI bool BlockBuilderAPI bool DataAPI bool PprofAPI bool }
RelayAPIOpts contains the options for a relay
Click to show internal directories.
Click to hide internal directories.