http

package
v0.3.1-0...-684a909 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Layer1 layer = iota
	Layer2 layer = iota
)

Variables

View Source
var (
	ErrNoHTTPFramework = errors.Validation.NewWithKeyAndDetail(
		"ERR_NO_HTTP_ENGINE",
		"HTTP framework required",
	)
	ErrNoRewarder = errors.Validation.NewWithKeyAndDetail(
		"ERR_NO_REWARDER",
		"Rewarder is required",
	)
)

Functions

func LogSkipper

func LogSkipper(c echo.Context) bool

Types

type DataStruct

type DataStruct struct {
	Raw     Raw     `json:"Raw"`
	Stats   Stats   `json:"Stats"`
	Message Message `json:"Message"`
	MsgHash string  `json:"MsgHash"`
}

type FeeType

type FeeType uint64
var (
	Eth                FeeType = 900000
	ERC20NotDeployed   FeeType = 1650000
	ERC20Deployed      FeeType = 1000000
	ERC721NotDeployed  FeeType = 2500000
	ERC721Deployed     FeeType = 1500000
	ERC1155NotDeployed FeeType = 2650000
	ERC1155Deployed    FeeType = 1850000
)

gas limits

func (FeeType) String

func (f FeeType) String() string

type JSONData

type JSONData struct {
	Raw Raw `json:"Raw"`
}

type Message

type Message struct {
	Id          int    `json:"Id"`
	To          string `json:"To"`
	Fee         int64  `json:"Fee"`
	Data        string `json:"Data"`
	From        string `json:"From"`
	Value       int64  `json:"Value"`
	GasLimit    int    `json:"GasLimit"`
	SrcOwner    string `json:"SrcOwner"`
	DestOwner   string `json:"DestOwner"`
	SrcChainId  int    `json:"SrcChainId"`
	DestChainId int    `json:"DestChainId"`
}

type NewServerOpts

type NewServerOpts struct {
	Echo                    *echo.Echo
	EventRepo               relayer.EventRepository
	CorsOrigins             []string
	SrcEthClient            ethClient
	DestEthClient           ethClient
	ProcessingFeeMultiplier float64
	TaikoL2                 *taikol2.TaikoL2
}

func (NewServerOpts) Validate

func (opts NewServerOpts) Validate() error

type Raw

type Raw struct {
	Data             string   `json:"data"`
	Topics           []string `json:"topics"`
	Address          string   `json:"address"`
	Removed          bool     `json:"removed"`
	LogIndex         string   `json:"logIndex"`
	BlockHash        string   `json:"blockHash"`
	BlockNumber      string   `json:"blockNumber"`
	TransactionHash  string   `json:"transactionHash"`
	TransactionIndex string   `json:"transactionIndex"`
}

type Server

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

@host relayer.hekla.taiko.xyz Server represents an relayer http server instance.

func NewServer

func NewServer(opts NewServerOpts) (*Server, error)

func (*Server) GetBlockInfo

func (srv *Server) GetBlockInfo(c echo.Context) error

getBlockInfoResponse

 returns block info for the chains

		@Summary		Get block info
		@ID			   	get-block-info
		@Accept			json
		@Produce		json
		@Success		200	{object} getBlockInfoResponse
		@Router			/blockInfo [get]

func (*Server) GetEventsByAddress

func (srv *Server) GetEventsByAddress(c echo.Context) error

GetEventsByAddress

 returns events by address

		@Summary		Get events by address
		@ID			   	get-events-by-address
	    @Param			address	query		string		true	"address to query"
	    @Param			msgHash	query		string		false	"msgHash to query"
	    @Param			chainID	query		string		false	"chainID to query"
	    @Param			eventType	query		string		false	"eventType to query"
	    @Param			event	query		string		false	"event to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/events [get]

func (*Server) GetRecommendedProcessingFees

func (srv *Server) GetRecommendedProcessingFees(c echo.Context) error

GetRecommendedProcessingFees

 returns block info for the chains

		@Summary		Get block info
		@ID			   	get-block-info
		@Accept			json
		@Produce		json
		@Success		200	{object} getBlockInfoResponse
		@Router			/blockInfo [get]

func (*Server) Health

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

Health endpoints for probes

func (*Server) ServeHTTP

func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the `http.Handler` interface which serves HTTP requests

func (*Server) Shutdown

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

Shutdown shuts down the HTTP server

func (*Server) Start

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

Start starts the HTTP server

type Stats

type Stats struct {
	ProofSize        int `json:"ProofSize"`
	NumCacheOps      int `json:"NumCacheOps"`
	GasUsedInFeeCalc int `json:"GasUsedInFeeCalc"`
}

Jump to

Keyboard shortcuts

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