http

package
v0.0.0-...-3966bb1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheKeyUniqueProposers   = "unique-proposers"
	CacheKeyUniqueProvers     = "unique-provers"
	CacheKeyStats             = "stats"
	CacheKeyPOSStats          = "pos-stats"
	CacheKeyCurrentProvers    = "current-provers"
	CacheKeyTotalTransactions = "total-transactions"
)
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 GetCountByAddressAndEventNameResp

type GetCountByAddressAndEventNameResp struct {
	Count int `json:"count"`
}

GetCountByAddressAndEventName

 returns count of events by user address and event name

		@Summary		Get count of events by user address and event name
		@ID			   	get-charts-by-task
	    @Param			address	query		string		true	"address to query"
	    @Param			event	query		string		true	"event name to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} GetCountByAddressAndEventNameResp
		@Router			/eventByAddress [get]

type NewServerOpts

type NewServerOpts struct {
	Echo             *echo.Echo
	EventRepo        eventindexer.EventRepository
	NFTBalanceRepo   eventindexer.NFTBalanceRepository
	ERC20BalanceRepo eventindexer.ERC20BalanceRepository
	ChartRepo        eventindexer.ChartRepository
	EthClient        *ethclient.Client
	CorsOrigins      []string
}

func (NewServerOpts) Validate

func (opts NewServerOpts) Validate() error

type Server

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

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

func NewServer

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

func (*Server) GetAssignedBlocksByProverAddress

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

GetAssignedBlocksByProverAddress

 returns the assigned blocks for a given prover address.

		@Summary		Get assigned blocks by prover address
		@ID			   	get-assigned-blocks-by-prover-address
	    @Param			address	query		string		true	"address to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/assignedBlocks [get]

func (*Server) GetBlockProposedBy

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

GetBlockProposedBy

 returns events by address and name of the event

		@Summary		Get block proposed by
		@ID			   	get-block-proposed-by
	    @Param			blockID	query		string		true	"blockID to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} []eventindexer.Event
		@Router			/blockProposedBy [get]

func (*Server) GetBlockProvenBy

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

GetBlockProvenBy

 returns events by address and name of the event

		@Summary		Get block proven by
		@ID			   	get-block-proven-by
	    @Param			blockID	query		string		true	"blockID to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} []eventindexer.Event
		@Router			/blockProvenBy [get]

func (*Server) GetByAddressAndEventName

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

GetByAddressAndEventName

 returns events by address and name of the event

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

func (*Server) GetChartByTask

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

GetChartByTask

 returns time series data for displaying charts

		@Summary		Get time series data for displaying charts
		@ID			   	get-charts-by-task
	    @Param			task	query		string		true	"task to query"
	    @Param			start	query		string		true	"start date"
	    @Param			end	query		string		true	"end date"
		@Accept			json
		@Produce		json
		@Success		200	{object} eventindexer.ChartResponse
		@Router			/chart/chartByTask [get]

func (*Server) GetCountByAddressAndEventName

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

func (*Server) GetERC20BalancesByAddressAndChainID

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

GetERC20BalancesByAddressAndChainID

 returns erc20 balances by address and chain ID

		@Summary		Get erc20 balances by address and chain ID
		@ID			   	get-erc20-balances-by-address-and-chain-id
	    @Param			address	query		string		true	"address to query"
	    @Param			chainID	query		string		true	"chainID to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/erc20sByAddress [get]

func (*Server) GetNFTBalancesByAddressAndChainID

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

GetNFTBalancesByAddressAndChainID

 returns nft balances by address and chain ID

		@Summary		Get nft balances by address and chain ID
		@ID			   	get-nft-balances-by-address-and-chain-id
	    @Param			address	query		string		true	"address to query"
	    @Param			chainID	query		string		true	"chainID to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/nftsByAddress [get]

func (*Server) GetUniqueProposers

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

GetUniqueProposers

 returns all unique proposers

		@Summary		Get unique proposers
		@ID			   	get-unique-proposers
		@Accept			json
		@Produce		json
		@Success		200	{object} uniqueProposersResp
		@Router			/uniqueProposers [get]

func (*Server) GetUniqueProvers

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

GetUniqueProvers

 returns all unique provers

		@Summary		Get unique provers
		@ID			   	get-unique-provers
		@Accept			json
		@Produce		json
		@Success		200	{object} uniqueProversResp
		@Router			/uniqueProvers [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

func (*Server) UserBridged

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

func (*Server) UserProposedBlock

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

func (*Server) UserProvedBlock

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

Jump to

Keyboard shortcuts

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