Documentation ¶
Index ¶
- Constants
- func AddCommands(ctx *Context, cdc *codec.Codec, rootCmd *cobra.Command, appCreator AppCreator, ...)
- func ExportCmd(ctx *Context, cdc *codec.Codec, appExporter AppExporter) *cobra.Command
- func ExternalIP() (string, error)
- func FreeTCPAddr() (addr, port string, err error)
- func GenerateCoinKey() (sdk.AccAddress, string, error)
- func GenerateSaveCoinKey(keybase keys.Keybase, keyName, keyPass string, overwrite bool, ...) (sdk.AccAddress, string, error)
- func GetPruningOptionsFromFlags() (types.PruningOptions, error)
- func InsertKeyJSON(cdc *codec.Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)
- func InstallHookEx(flag string, hooker fnHookstartInProcess)
- func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
- func SetupViper(t *testing.T) func()
- func ShowAddressCmd(ctx *Context) *cobra.Command
- func ShowNodeIDCmd(ctx *Context) *cobra.Command
- func ShowValidatorCmd(ctx *Context) *cobra.Command
- func StartCmd(ctx *Context, cdc *codec.Codec, appCreator AppCreator, appStop AppStop, ...) *cobra.Command
- func Stop()
- func StopCmd(ctx *Context) *cobra.Command
- func TrapSignal(cleanupFunc func())
- func UnsafeResetAllCmd(ctx *Context) *cobra.Command
- func VersionCmd(ctx *Context) *cobra.Command
- type AppCreator
- type AppExporter
- type AppStop
- type Context
Constants ¶
const ( FlagEvmExportMode = "evm-export-mode" FlagEvmExportPath = "evm-export-path" )
const ( FlagMinGasPrices = "minimum-gas-prices" FlagHaltHeight = "halt-height" FlagHaltTime = "halt-time" FlagInterBlockCache = "inter-block-cache" FlagUnsafeSkipUpgrades = "unsafe-skip-upgrades" FlagTrace = "trace" FlagPruning = "pruning" FlagPruningKeepRecent = "pruning-keep-recent" FlagPruningKeepEvery = "pruning-keep-every" FlagPruningInterval = "pruning-interval" FlagLocalRpcPort = "local-rpc-port" FlagPortMonitor = "netstat" FlagEvmImportPath = "evm-import-path" FlagEvmImportMode = "evm-import-mode" FlagGoroutineNum = "goroutine-num" FlagPruningMaxWsNum = "pruning-max-worldstate-num" )
Tendermint full-node start flags
const ( FlagListenAddr = "rest.laddr" FlagExternalListenAddr = "rest.external_laddr" FlagUlockKey = "rest.unlock_key" FlagUlockKeyHome = "rest.unlock_key_home" FlagRestPathPrefix = "rest.path_prefix" FlagCORS = "cors" FlagMaxOpenConnections = "max-open" FlagHookstartInProcess = "startInProcess" FlagWebsocket = "wsport" FlagWsMaxConnections = "ws.max_connections" FlagWsSubChannelLength = "ws.sub_channel_length" // plugin flags FlagBackendEnableBackend = "backend.enable_backend" FlagBackendEnableMktCompute = "backend.enable_mkt_compute" FlagBackendLogSQL = "backend.log_sql" FlagBackendCleanUpsTime = "backend.clean_ups_time" FlagBacekendOrmEngineType = "backend.orm_engine.engine_type" FlagBackendOrmEngineConnectStr = "backend.orm_engine.connect_str" FlagStreamEngine = "stream.engine" FlagStreamKlineQueryConnect = "stream.klines_query_connect" FlagStreamWorkerId = "stream.worker_id" FlagStreamRedisScheduler = "stream.redis_scheduler" FlagStreamRedisLock = "stream.redis_lock" FlagStreamLocalLockDir = "stream.local_lock_dir" FlagStreamCacheQueueCapacity = "stream.cache_queue_capacity" FlagStreamMarketTopic = "stream.market_topic" FlagStreamMarketPartition = "stream.market_partition" FlagStreamMarketServiceEnable = "stream.market_service_enable" FlagStreamMarketNacosUrls = "stream.market_nacos_urls" FlagStreamMarketNacosNamespaceId = "stream.market_nacos_namespace_id" FlagStreamMarketNacosClusters = "stream.market_nacos_clusters" FlagStreamMarketNacosServiceName = "stream.market_nacos_service_name" FlagStreamMarketNacosGroupName = "stream.market_nacos_group_name" FlagStreamMarketEurekaName = "stream.market_eureka_name" FlagStreamEurekaServerUrl = "stream.eureka_server_url" FlagStreamRestApplicationName = "stream.rest_application_name" FlagStreamRestNacosUrls = "stream.rest_nacos_urls" FlagStreamRestNacosNamespaceId = "stream.rest_nacos_namespace_id" FlagStreamPushservicePulsarPublicTopic = "stream.pushservice_pulsar_public_topic" FlagStreamPushservicePulsarPrivateTopic = "stream.pushservice_pulsar_private_topic" FlagStreamPushservicePulsarDepthTopic = "stream.pushservice_pulsar_depth_topic" FlagStreamRedisRequirePass = "stream.redis_require_pass" )
exchain full-node start flags
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
func AddCommands( ctx *Context, cdc *codec.Codec, rootCmd *cobra.Command, appCreator AppCreator, appStop AppStop, appExport AppExporter, registerRouters func(rs *lcd.RestServer), registerAppFlagFn func(cmd *cobra.Command), appPreRun func(ctx *Context))
add server commands
func ExternalIP ¶
https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go TODO there must be a better way to get external IP
func FreeTCPAddr ¶
Get a free address for a test tendermint server protocol is either tcp, http, etc
func GenerateCoinKey ¶
func GenerateCoinKey() (sdk.AccAddress, string, error)
GenerateCoinKey returns the address of a public key, along with the secret phrase to recover the private key.
func GenerateSaveCoinKey ¶
func GenerateSaveCoinKey(keybase keys.Keybase, keyName, keyPass string, overwrite bool, mnemonicInput string) (sdk.AccAddress, string, error)
GenerateSaveCoinKey returns the address of a public key, along with the secret phrase to recover the private key.
func GetPruningOptionsFromFlags ¶
func GetPruningOptionsFromFlags() (types.PruningOptions, error)
GetPruningOptionsFromFlags parses command flags and returns the correct PruningOptions. If a pruning strategy is provided, that will be parsed and returned, otherwise, it is assumed custom pruning options are provided.
func InsertKeyJSON ¶
func InsertKeyJSON(cdc *codec.Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)
InsertKeyJSON inserts a new JSON field/key with a given value to an existing JSON message. An error is returned if any serialization operation fails.
NOTE: The ordering of the keys returned as the resulting JSON message is non-deterministic, so the client should not rely on key ordering.
func InstallHookEx ¶
func InstallHookEx(flag string, hooker fnHookstartInProcess)
func PersistentPreRunEFn ¶
PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config object.
func SetupViper ¶
SetupViper creates a homedir to run inside, and returns a cleanup function to defer
func ShowAddressCmd ¶
ShowAddressCmd - show this node's validator address
func ShowNodeIDCmd ¶
ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout
func ShowValidatorCmd ¶
ShowValidator - ported from Tendermint, show this node's validator info
func StartCmd ¶
func StartCmd(ctx *Context, cdc *codec.Codec, appCreator AppCreator, appStop AppStop, registerRoutesFn func(restServer *lcd.RestServer), registerAppFlagFn func(cmd *cobra.Command), appPreRun func(ctx *Context)) *cobra.Command
StartCmd runs the service passed in, either stand-alone or in-process with Tendermint.
func TrapSignal ¶
func TrapSignal(cleanupFunc func())
TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.
func UnsafeResetAllCmd ¶
UnsafeResetAllCmd - extension of the tendermint command, resets initialization
func VersionCmd ¶
VersionCmd prints tendermint and ABCI version numbers.
Types ¶
type AppCreator ¶
AppCreator is a function that allows us to lazily initialize an application using various configurations.
type AppExporter ¶
type AppExporter func(log.Logger, dbm.DB, io.Writer, int64, bool, []string) (json.RawMessage, []tmtypes.GenesisValidator, error)
AppExporter is a function that dumps all app state to JSON-serializable structure and returns the current validator set.
type AppStop ¶
type AppStop func(app abci.Application)