server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 65 Imported by: 32

Documentation

Index

Constants

View Source
const (
	ServiceName = "EVMIndexerService"

	NewBlockWaitTimeout = 60 * time.Second
)

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(
	rootCmd *cobra.Command,
	opts StartOptions,
	appExport types.AppExporter,
	addStartFlags types.ModuleInitFlags,
)

AddCommands adds server commands

func GenDocProvider

func GenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error)

GenDocProvider returns a function which returns the genesis doc from the genesis file.

func GetBlockGasLimit added in v0.7.0

func GetBlockGasLimit(appOpts servertypes.AppOptions, logger log.Logger) uint64

GetBlockGasLimit reads the genesis json file using AppGenesisFromFile to extract the consensus block gas limit before InitChain is called.

func GetCosmosPoolMaxTx added in v0.7.0

func GetCosmosPoolMaxTx(appOpts servertypes.AppOptions, logger log.Logger) int

func GetLegacyPoolConfig added in v0.7.0

func GetLegacyPoolConfig(appOpts servertypes.AppOptions, logger log.Logger) *legacypool.Config

GetLegacyPoolConfig reads the legacy pool configuration from appOpts and overrides default values with values from app.toml if they exist and are non-zero.

func GetMempoolCheckTxTimeout added in v0.7.0

func GetMempoolCheckTxTimeout(appOpts servertypes.AppOptions, logger log.Logger) time.Duration

func GetMempoolEnableTxTracker added in v0.7.0

func GetMempoolEnableTxTracker(appOpts servertypes.AppOptions) bool

GetMempoolEnableTxTracker reads whether per-tx lifecycle telemetry should be recorded by the mempool. Defaults to false when not set or appOpts is nil.

func GetMempoolInsertQueueSize added in v0.7.0

func GetMempoolInsertQueueSize(appOpts servertypes.AppOptions, logger log.Logger) int

func GetMinGasPrices added in v0.7.0

func GetMinGasPrices(appOpts servertypes.AppOptions, logger log.Logger) sdk.DecCoins

GetMinGasPrices reads the min gas prices from the app options, set from app.toml This is currently not used, but is kept in case this is useful for the mempool, in addition to the min tip flag

func GetMinTip added in v0.7.0

func GetMinTip(appOpts servertypes.AppOptions, logger log.Logger) *uint256.Int

GetMinTip reads the min tip from the app options, set from app.toml This field is also known as the minimum priority fee

func GetPendingTxProposalTimeout added in v0.7.0

func GetPendingTxProposalTimeout(appOpts servertypes.AppOptions, logger log.Logger) time.Duration

func Listen

func Listen(addr string, config *config.Config) (net.Listener, error)

Listen starts a net.Listener on the tcp network on the given address. If there is a specified MaxOpenConnections in the config, it will also set the limitListener.

func MountGRPCWebServices

func MountGRPCWebServices(
	router *mux.Router,
	grpcWeb *grpcweb.WrappedGrpcServer,
	grpcResources []string,
	logger log.Logger,
)

MountGRPCWebServices mounts gRPC-Web services on specific HTTP POST routes. Parameters: - router: The HTTP router instance to mount the routes on (using mux.Router). - grpcWeb: The wrapped gRPC-Web server that will handle incoming gRPC-Web and WebSocket requests. - grpcResources: A list of resource endpoints (URLs) that should be mounted for gRPC-Web POST requests. - logger: A logger instance used to log information about the mounted resources.

func NewIndexTxCmd

func NewIndexTxCmd() *cobra.Command

NewIndexTxCmd creates a new Cobra command to index historical Ethereum transactions.

func NewSlogFromCosmosLogger added in v0.7.0

func NewSlogFromCosmosLogger(logger sdk.Logger, levelStr string) (*slog.Logger, slog.Level)

NewSlogFromCosmosLogger wraps cosmos sdk logger to slog

func OpenIndexerDB

func OpenIndexerDB(rootDir string, backendType dbm.BackendType) (dbm.DB, error)

OpenIndexerDB opens the custom eth indexer db, using the same db backend as the main app

func ResolveMempoolConfig added in v0.7.0

func ResolveMempoolConfig(anteHandler sdk.AnteHandler, appOpts servertypes.AppOptions, logger log.Logger) *evmmempool.Config

ResolveMempoolConfig resolves the mempool configuration from the app options.

func SetEVMLogger added in v0.7.0

func SetEVMLogger(logger *slog.Logger, level slog.Level)

SetEVMLogger sets the default evm logger and the default slog logger

func StartCmd

func StartCmd(opts StartOptions) *cobra.Command

StartCmd runs the service passed in, either stand-alone or in-process with CometBFT.

func StartJSONRPC

func StartJSONRPC(
	ctx context.Context,
	srvCtx *server.Context,
	clientCtx client.Context,
	g *errgroup.Group,
	config *serverconfig.Config,
	indexer types.EVMTxIndexer,
	app AppWithPendingTxStream,
	mempool backend.Mempool,
) (*http.Server, error)

StartJSONRPC starts the JSON-RPC server

func ValidateReapBounds added in v0.7.0

func ValidateReapBounds(appOpts servertypes.AppOptions, blockGasLimit uint64) error

ValidateReapBounds errors when an admission cap exceeds the matching reap cap. A tx admitted via CheckTx that's larger than reap_max_bytes (or whose gas exceeds reap_max_gas) would wedge the head of the reap list. A zero reap cap means "no limit" on Comet's side — skip.

Types

type AppCreator added in v0.4.0

type AppCreator func(log.Logger, dbm.DB, types.AppOptions) Application

AppCreator is a function that allows us to lazily initialize an application implementing with AppWithPendingTxStream.

type AppWithPendingTxStream added in v0.4.0

type AppWithPendingTxStream interface {
	RegisterPendingTxListener(listener func(common.Hash))
}

type Application added in v0.4.0

type Application interface {
	types.Application
	AppWithPendingTxStream
	GetMempool() sdkmempool.ExtMempool
}

type DBOpener

type DBOpener func(opts types.AppOptions, rootDir string, backend dbm.BackendType) (dbm.DB, error)

DBOpener is a function to open `application.db`, potentially with customized options.

type EVMIndexerService

type EVMIndexerService struct {
	service.BaseService
	// contains filtered or unexported fields
}

EVMIndexerService indexes transactions for json-rpc service.

func NewEVMIndexerService

func NewEVMIndexerService(
	txIdxr servertypes.EVMTxIndexer,
	client rpcclient.Client,
) *EVMIndexerService

NewEVMIndexerService returns a new service instance.

func (*EVMIndexerService) OnStart

func (eis *EVMIndexerService) OnStart() error

OnStart implements service.Service by subscribing for new blocks and indexing them by events.

type StartOptions

type StartOptions struct {
	AppCreator      types.AppCreator
	DefaultNodeHome string
	DBOpener        DBOpener
}

StartOptions defines options that can be customized in `StartCmd`

func NewDefaultStartOptions

func NewDefaultStartOptions(appCreator AppCreator, defaultNodeHome string) StartOptions

NewDefaultStartOptions use the default db opener provided in tm-db.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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