server

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogSkipper

func LogSkipper(c echo.Context) bool

LogSkipper implements the `middleware.Skipper` interface.

Types

type NewProverServerOpts

type NewProverServerOpts struct {
	ProverPrivateKey *ecdsa.PrivateKey
	MinProofFee      *big.Int
	MaxExpiry        time.Duration
	CapacityManager  *capacity.CapacityManager
	TaikoL1Address   common.Address
	Rpc              *rpc.Client
	Bond             *big.Int
	IsOracle         bool
}

NewProverServerOpts contains all configurations for creating a prover server instance.

type ProposeBlockResponse

type ProposeBlockResponse struct {
	SignedPayload []byte         `json:"signedPayload"`
	Prover        common.Address `json:"prover"`
}

ProposeBlockResponse represents the JSON response which will be returned by the ProposeBlock request handler.

type ProverServer

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

@host prover-api.test.taiko.xyz ProverServer represents a prover server instance.

func New

func New(opts *NewProverServerOpts) (*ProverServer, error)

New creates a new prover server instance.

func (*ProverServer) CreateAssignment

func (srv *ProverServer) CreateAssignment(c echo.Context) error

CreateAssignment handles a block proof assignment request, decides if this prover wants to handle this block, and if so, returns a signed payload the proposer can submit onchain.

@Summary		Try to accept a block proof assignment
@ID			   	create-assignment
@Accept			json
@Produce		json
@Success		200		{object} ProposeBlockResponse
@Failure		422		{string} string	"insufficient prover balance"
@Failure		422		{string} string	"proof fee too low"
@Failure		422		{string} string "expiry too long"
@Failure		422		{string} string "prover does not have capacity"
@Router			/assignment [post]

func (*ProverServer) GetStatus

func (srv *ProverServer) GetStatus(c echo.Context) error

GetStatus handles a query to the current prover server status.

@Summary		Get current prover server status
@ID			   	get-status
@Accept			json
@Produce		json
@Success		200	{object} Status
@Router			/status [get]

func (*ProverServer) Health

func (srv *ProverServer) Health(c echo.Context) error

Health endpoints for probes.

func (*ProverServer) Shutdown

func (srv *ProverServer) Shutdown(ctx context.Context) error

Shutdown shuts down the HTTP server.

func (*ProverServer) Start

func (srv *ProverServer) Start(address string) error

Start starts the HTTP server.

type Status

type Status struct {
	MinProofFee     uint64 `json:"minProofFee"`
	MaxExpiry       uint64 `json:"maxExpiry"`
	CurrentCapacity uint64 `json:"currentCapacity"`
}

Status represents the current prover server status.

Jump to

Keyboard shortcuts

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