Documentation
¶
Index ¶
- Constants
- func AddCommands(rootCmd *cobra.Command, opts StartOptions, appExport types.AppExporter, ...)
- func GenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error)
- func GetBlockGasLimit(appOpts servertypes.AppOptions, logger log.Logger) uint64
- func GetCosmosPoolMaxTx(appOpts servertypes.AppOptions, logger log.Logger) int
- func GetLegacyPoolConfig(appOpts servertypes.AppOptions, logger log.Logger) *legacypool.Config
- func GetMempoolCheckTxTimeout(appOpts servertypes.AppOptions, logger log.Logger) time.Duration
- func GetMempoolInsertQueueSize(appOpts servertypes.AppOptions, logger log.Logger) int
- func GetMinGasPrices(appOpts servertypes.AppOptions, logger log.Logger) sdk.DecCoins
- func GetMinTip(appOpts servertypes.AppOptions, logger log.Logger) *uint256.Int
- func GetPendingTxProposalTimeout(appOpts servertypes.AppOptions, logger log.Logger) time.Duration
- func Listen(addr string, config *config.Config) (net.Listener, error)
- func MountGRPCWebServices(router *mux.Router, grpcWeb *grpcweb.WrappedGrpcServer, grpcResources []string, ...)
- func NewIndexTxCmd() *cobra.Command
- func NewSlogFromCosmosLogger(logger sdk.Logger, levelStr string) (*slog.Logger, slog.Level)
- func OpenIndexerDB(rootDir string, backendType dbm.BackendType) (dbm.DB, error)
- func ResolveMempoolConfig(anteHandler sdk.AnteHandler, appOpts servertypes.AppOptions, logger log.Logger) *evmmempool.Config
- func SetEVMLogger(logger *slog.Logger, level slog.Level)
- func StartCmd(opts StartOptions) *cobra.Command
- func StartJSONRPC(ctx context.Context, srvCtx *server.Context, clientCtx client.Context, ...) (*http.Server, error)
- type AppCreator
- type AppWithPendingTxStream
- type Application
- type DBOpener
- type EVMIndexerService
- type StartOptions
Constants ¶
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 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 ¶
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 ¶
NewIndexTxCmd creates a new Cobra command to index historical Ethereum transactions.
func NewSlogFromCosmosLogger ¶ added in v0.7.0
NewSlogFromCosmosLogger wraps cosmos sdk logger to slog
func OpenIndexerDB ¶
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
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
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 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.