server

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: LGPL-3.0 Imports: 59 Imported by: 0

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 ConnectCometBftWS

func ConnectCometBftWS(cometRPCAddr, cometEndpoint string, logger log.Logger) *cmtjrpcclient.WSClient

func GenDocProvider added in v0.0.3

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

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

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 NewIndexTxCmd

func NewIndexTxCmd() *cobra.Command

func OpenIndexerDB

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

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 *server.Context,
	clientCtx client.Context,
	cometRPCAddr,
	cometEndpoint string,
	config *svrconfig.Config,
	indexer evertypes.EVMTxIndexer,
) (*http.Server, chan struct{}, error)

StartJSONRPC starts the JSON-RPC server

Types

type DBOpener

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

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

type EVMIndexerService

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

EVMIndexerService indexes transactions for json-rpc service.

func NewEVMIndexerService

func NewEVMIndexerService(
	txIdxr evertypes.EVMTxIndexer,
	client cmtrpcclient.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 types.AppCreator, defaultNodeHome string) StartOptions

NewDefaultStartOptions use the default db opener provided in CometBFT db.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳