Documentation
¶
Index ¶
- Constants
- Variables
- func NewMetrics(reg prometheus.Registerer) *metrics
- type API
- type Boost
- type BoostService
- type CommitmentResponse
- type Config
- type DefaultBoost
- type DefaultService
- type IDResponse
- type Metadata
- type SearcherConnection
- type SuperPayload
- type Transaction
- type VersionResponse
- type Worker
Constants ¶
View Source
const ( // proposer endpoints PathStatus = "/primev/v0/status" PathSubmitBlock = "/primev/v1/builder/blocks" // searcher endpoints PathSearcherConnect = "/ws" )
Router paths
View Source
const (
KeySearcherAddress key = iota
)
View Source
const (
Version = "0.0.1"
)
Variables ¶
View Source
var (
ErrBlockUnprocessable = errors.New("V001: block unprocessable")
)
View Source
var (
ErrParamNotFound = errors.New("not found")
)
Functions ¶
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *metrics
Types ¶
type API ¶
type API struct {
Service BoostService
Worker *Worker
Rollup rollup.Rollup
Log log.Logger
BuilderToken string
MetricsEnabled bool
InclusionList bool
// contains filtered or unexported fields
}
func (*API) ConnectedSearcher ¶
func (a *API) ConnectedSearcher(w http.ResponseWriter, r *http.Request)
connectSearcher is the handler to connect a searcher to the builder for the websocket execution hints TODO(@ckartik): Move the handling of searcher connection to service layer
GET /ws?token=abcd where "abcd" is the authentication token of the searcher The handler authenticates based on the following criteria: 1. The token is valid 2. The searcher behind the token has active subscription 3. The searcher behind the token is not already connected
type Boost ¶
type Boost interface {
SubmitBlock(context.Context, *capella.SubmitBlockRequest, time.Time) error
GetWorkChannel() chan SuperPayload
}
type BoostService ¶
type CommitmentResponse ¶
type CommitmentResponse struct {
Commitment string `json:"commitment"`
}
type DefaultBoost ¶
type DefaultBoost struct {
// contains filtered or unexported fields
}
func NewBoost ¶
func NewBoost(config Config) (*DefaultBoost, error)
NewGateway new auction gateway service
func (*DefaultBoost) GetWorkChannel ¶
func (rs *DefaultBoost) GetWorkChannel() chan SuperPayload
func (*DefaultBoost) Log ¶
func (rs *DefaultBoost) Log() log.Logger
func (*DefaultBoost) SubmitBlock ¶
func (as *DefaultBoost) SubmitBlock(ctx context.Context, msg *capella.SubmitBlockRequest, now time.Time) (err error)
type DefaultService ¶
type DefaultService struct {
Log log.Logger
Config Config
Boost
// contains filtered or unexported fields
}
func (*DefaultService) Ready ¶
func (s *DefaultService) Ready() <-chan struct{}
type IDResponse ¶
type IDResponse struct {
ID string `json:"id"`
}
type Metadata ¶
type Metadata struct {
Builder string `json:"builder"`
Number int64 `json:"number"`
BlockHash string `json:"blockHash"`
Timestamp string `json:"timestamp"`
BaseFee uint32 `json:"baseFee"`
Transactions Transaction `json:"standard_transactions"`
ClientTransactions []string `json:"personal_transactions,omitempty"`
SentTimestamp time.Time `json:"sent_timestamp"` // Timestamp of block sent to the searcher
RecTimestamp time.Time `json:"rec_timestamp"` // Timestamp of block received by the builder instance
}
type SearcherConnection ¶
type SearcherConnection struct {
Conn *websocket.Conn
WorkChannel chan SuperPayload
}
type SuperPayload ¶
type Transaction ¶
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version"`
}
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) GetHeartbeat ¶
Click to show internal directories.
Click to hide internal directories.