node

package
v0.0.0-...-d44451d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 52 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFileConfig

func InitFileConfig(cmd *cobra.Command, options ConfigOptions) error

InitFileConfig initializes configuration according to the following precedence: 1. Command line flags 2. Environment variables 3. Config file 4. Cobra default values

func RegisterFlagWithValidationOrFail

func RegisterFlagWithValidationOrFail(cmd *cobra.Command, name string, description string, example string, expectedSchemes []string) *string

Types

type ConfigOptions

type ConfigOptions struct {
	FilePath  string
	FileName  string
	EnvPrefix string
}

type G

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

func NewGuardianNode

func NewGuardianNode(
	env common.Environment,
	gk *ecdsa.PrivateKey,
) *G

func (*G) Run

func (g *G) Run(rootCtxCancel context.CancelFunc, options ...*GuardianOption) supervisor.Runnable

type GuardianOption

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

func GuardianOptionAccountant

func GuardianOptionAccountant(
	websocket string,
	contract string,
	enforcing bool,
	wormchainConn *wormconn.ClientConn,
	nttContract string,
	nttWormchainConn *wormconn.ClientConn,
) *GuardianOption

GuardianOptionAccountant configures the Accountant module. Dependencies: db

func GuardianOptionAdminService

func GuardianOptionAdminService(socketPath string, ethRpc *string, ethContract *string, rpcMap map[string]string) *GuardianOption

GuardianOptionAdminService enables the admin rpc service on a unix socket. Dependencies: db, governor

func GuardianOptionDatabase

func GuardianOptionDatabase(db *db.Database) *GuardianOption

GuardianOptionDatabase configures the main database to be used for this guardian node. Dependencies: none

func GuardianOptionGatewayRelayer

func GuardianOptionGatewayRelayer(gatewayRelayerContract string, wormchainConn *wormconn.ClientConn) *GuardianOption

GuardianOptionGatewayRelayer configures the Gateway Relayer module. If the gateway relayer smart contract is configured, we will instantiate the GatewayRelayer and signed VAAs will be passed to it for processing when they are published. It will forward payload three transfers destined for the specified contract on wormchain to that contract.

func GuardianOptionGovernor

func GuardianOptionGovernor(governorEnabled bool) *GuardianOption

GuardianOptionGovernor enables or disables the governor. Dependencies: db

func GuardianOptionNoAccountant

func GuardianOptionNoAccountant() *GuardianOption

GuardianOptionNoAccountant disables the accountant. It is a shorthand for GuardianOptionAccountant("", "", false, nil) Dependencies: none

func GuardianOptionP2P

func GuardianOptionP2P(p2pKey libp2p_crypto.PrivKey, networkId, bootstrapPeers, nodeName string, disableHeartbeatVerify bool, port uint, ccqBootstrapPeers string, ccqPort uint, ccqAllowedPeers, gossipAdvertiseAddress string, ibcFeaturesFunc func() string) *GuardianOption

GuardianOptionP2P configures p2p networking. Dependencies: Accountant, Governor

func GuardianOptionProcessor

func GuardianOptionProcessor() *GuardianOption

GuardianOptionProcessor enables the default processor, which is required to make consensus on messages. Dependencies: db, governor, accountant

func GuardianOptionPublicRpcSocket

func GuardianOptionPublicRpcSocket(publicGRPCSocketPath string, publicRpcLogDetail common.GrpcLogDetail) *GuardianOption

GuardianOptionPublicRpcSocket enables the public rpc service on a unix socket Dependencies: db, governor

func GuardianOptionPublicWeb

func GuardianOptionPublicWeb(listenAddr string, publicGRPCSocketPath string, tlsHostname string, tlsProdEnv bool, tlsCacheDir string) *GuardianOption

GuardianOptionPublicWeb enables the public rpc service on http, i.e. gRPC-web and JSON-web. Dependencies: db, governor, publicrpcsocket

func GuardianOptionPublicrpcTcpService

func GuardianOptionPublicrpcTcpService(publicRpc string, publicRpcLogDetail common.GrpcLogDetail) *GuardianOption

GuardianOptionPublicrpcTcpService enables the public gRPC service on TCP. Dependencies: db, governor, publicrpcsocket

func GuardianOptionQueryHandler

func GuardianOptionQueryHandler(ccqEnabled bool, allowedRequesters string) *GuardianOption

GuardianOptionQueryHandler configures the Cross Chain Query module.

func GuardianOptionStatusServer

func GuardianOptionStatusServer(statusAddr string) *GuardianOption

GuardianOptionStatusServer configures the status server, including /readyz and /metrics. If g.env == common.UnsafeDevNet || g.env == common.GoTest, pprof will be enabled under /debug/pprof/ Dependencies: none

func GuardianOptionWatchers

func GuardianOptionWatchers(watcherConfigs []watchers.WatcherConfig, ibcWatcherConfig *IbcWatcherConfig) *GuardianOption

GuardianOptionWatchers configues all normal watchers and all IBC watchers. They need to be all configured at the same time because they may depend on each other. TODO: currently, IBC watchers are partially statically configured in ibc.ChainConfig. It might make sense to refactor this to instead provide this as a parameter here. Dependencies: none

type IbcWatcherConfig

type IbcWatcherConfig struct {
	Websocket      string
	Lcd            string
	BlockHeightURL string
	Contract       string
}

type LogSizeCounter

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

func NewLogSizeCounter

func NewLogSizeCounter(lvl zapcore.Level) *LogSizeCounter

func (*LogSizeCounter) Core

func (lc *LogSizeCounter) Core() zapcore.Core

func (*LogSizeCounter) Reset

func (lc *LogSizeCounter) Reset() uint64

func (*LogSizeCounter) Sync

func (lc *LogSizeCounter) Sync() error

func (*LogSizeCounter) Write

func (lc *LogSizeCounter) Write(p []byte) (n int, err error)

type PrometheusCtxKey

type PrometheusCtxKey struct{}

Jump to

Keyboard shortcuts

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