Documentation
¶
Index ¶
- Constants
- func AddCommands(rootCmd *cobra.Command, opts StartOptions, appExport types.AppExporter, ...)
- func GenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error)
- 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 OpenIndexerDB(rootDir string, backendType dbm.BackendType) (dbm.DB, error)
- 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 CustomSlogHandler
- 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 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 OpenIndexerDB ¶
OpenIndexerDB opens the custom eth indexer db, using the same db backend as the main app
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 cosmosevmtypes.EVMTxIndexer, app AppWithPendingTxStream, ) (*http.Server, error)
StartJSONRPC starts the JSON-RPC server
Types ¶
type AppCreator ¶ added in v0.4.0
type AppCreator func(log.Logger, dbm.DB, io.Writer, 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 SetClientCtx(clientCtx client.Context) }
type CustomSlogHandler ¶ added in v0.3.0
type CustomSlogHandler struct {
// contains filtered or unexported fields
}
CustomSlogHandler bridges Geth's slog logs to the existing Cosmos SDK logger.
func (*CustomSlogHandler) Enabled ¶ added in v0.3.0
Enabled determines if the handler should log a given level.
func (*CustomSlogHandler) Handle ¶ added in v0.3.0
Handle processes slog records and forwards them to your Cosmos SDK logger.
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 cosmosevmtypes.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.