server

package
v0.0.0-...-50aa497 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 75 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDevnetValidatorTokes = "30000000000000000000000"
	DefaultDelegatorShares      = "30000000000000000000000.000000000000000"
	// DefaultUpgradeHeighOffset is the offset used to schedule the upgrade
	DefaultUpgradeHeighOffset = 100
)
View Source
const (
	ServiceName = "EVMIndexerService"

	NewBlockWaitTimeout = 60 * time.Second
)
View Source
const (
	// KeyIsDevnet is used to determine whether to run in devnet mode
	KeyIsDevnet = "is-devnet"
	// KeyNewChainID is the new chain ID to use in devnet mode
	KeyNewChainID = "new-chain-ID"
	// KeyOperatorAddress is the new operator address in devnet mode
	KeyOperatorAddress = "operator-address"
	// KeyUpgradeVersion is set to the upgrade version
	KeyUpgradeVersion = "upgrade-version"
	// KeyValidatorConsensusAddr is set to the validator consensus address in the devnetify function
	KeyValidatorConsensusAddr = "validator-consensus-address"
	// KeyValidatorConsensusPubkey is set to the validator consensus pubkey in the devnetify function
	KeyValidatorConsensusPubkey = "validator-consensus-pubkey"
	// KeyAppBlockHeight is set to the latest app block time in the devnetify function
	KeyAppBlockHeight = "app-block-height"
	// FlagSkipConfirmation is used to skip the confirmation prompt when running devnet mode
	FlagSkipConfirmation = "skip-confirmation"
)
View Source
const (

	// DefaultTimeoutProposeDelta How much timeout_propose increases with each round
	DefaultTimeoutProposeDelta = 200 * time.Millisecond

	// DefaultTimeoutPrevoteDelta How much the timeout_prevote increases with each round
	DefaultTimeoutPrevoteDelta = 200 * time.Millisecond

	// DefaultTimeoutPrecommitDelta How much the timeout_precommit increases with each round
	DefaultTimeoutPrecommitDelta = 200 * time.Millisecond

	FlagSkipConfigOverwrite = "skip-config-overwrite"
)

REF: https://github.com/zeta-chain/node/issues/4032

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(
	rootCmd *cobra.Command,
	appCreator types.AppCreator,
	defaultNodeHome string,
	appExport types.AppExporter,
	addStartFlags types.ModuleInitFlags,
)

AddCommands adds server commands

func ConnectTmWS

func ConnectTmWS(tmRPCAddr, tmEndpoint string, logger log.Logger) *jsonrpcclient.WSClient

ConnectTmWS connects to a Tendermint WebSocket (WS) server. Parameters: - tmRPCAddr: The RPC address of the Tendermint server. - tmEndpoint: The WebSocket endpoint on the Tendermint server. - logger: A logger instance used to log debug and error messages.

func DevNetCmd

func DevNetCmd(appCreator types.AppCreator) *cobra.Command

func DevnetCmdWithOptions

func DevnetCmdWithOptions(devnetAppCreator types.AppCreator, opts StartCmdOptions) *cobra.Command

DevnetCmdWithOptions creates a command that modifies the local state to create a devnet fork. After running this command, the network can be started with the regular start command.

func GenDocProvider

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

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 OpenIndexerDB

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

func StartCmd

func StartCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command

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

func StartCmdWithOptions

func StartCmdWithOptions(appCreator types.AppCreator, defaultNodeHome string, opts StartCmdOptions) *cobra.Command

func StartJSONRPC

func StartJSONRPC(ctx *server.Context,
	clientCtx client.Context,
	tmRPCAddr,
	tmEndpoint string,
	config *serverconfig.Config,
	indexer cosmosevmtypes.EVMTxIndexer,
) (*http.Server, chan struct{}, error)

StartJSONRPC starts the JSON-RPC server

Types

type CustomSlogHandler

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

CustomSlogHandler bridges Geth's slog logs to the existing Cosmos SDK logger.

func (*CustomSlogHandler) Enabled

func (h *CustomSlogHandler) Enabled(_ context.Context, _ slog.Level) bool

Enabled determines if the handler should log a given level.

func (*CustomSlogHandler) Handle

Handle processes slog records and forwards them to your Cosmos SDK logger.

func (*CustomSlogHandler) WithAttrs

func (h *CustomSlogHandler) WithAttrs(_ []slog.Attr) slog.Handler

WithAttrs allows adding additional attributes.

func (*CustomSlogHandler) WithGroup

func (h *CustomSlogHandler) WithGroup(_ string) slog.Handler

WithGroup is required to implement slog.Handler (not used).

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 StartCmdOptions

type StartCmdOptions struct {
	DBOpener            func(rootDir string, backendType dbm.BackendType) (dbm.DB, error)
	PostSetup           func(svrCtx *server.Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error
	PostSetupStandalone func(svrCtx *server.Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error
	AddFlags            func(cmd *cobra.Command)
	StartCommandHandler func(svrCtx *server.Context, clientCtx client.Context, appCreator types.AppCreator, withCmt bool, opts StartCmdOptions) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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