Documentation ¶
Index ¶
- Constants
- Variables
- func AddGenValidatorFlags(cmd *cobra.Command)
- func AddInitFlags(cmd *cobra.Command)
- func AddNodeFlags(cmd *cobra.Command)
- func AddSyncFlags(cmd *cobra.Command)
- func GetConfig() *cfg.Config
- func GetConfigFiles() (string, string, string, string, string)
- func NewRunNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
- func NewSyncNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
- func ParseConfig(isInit bool) (*cfg.Config, error)
- func ProcessFollower(byzantium, proxyApp, aAddr string, listenPortN int)
- func ProcessP2P(genesisDoc types.GenesisDoc, nodeFile string, proxyApp string)
- func ResetAll(dbDir, privValFile string, logger log.Logger)
- func SetConfig(CreateEmptyBlocks bool, ForceIntervalBlockSwitch bool, ...) (*cfg.Config, string)
- type GenesisDoc
- type NodeDef
- type ReqJSON
Constants ¶
const ( // PATH - the url path for exchange pubKey & nodeID PATH = "/init-special-request-path-for-exchange-pub-key-and-node-id" // PATH2 - the url path for exchange notify (gotten) PATH2 = "/init-special-request-path-for-notify-i-got-it" // ReportPeriod - continue to notify ReportPeriod = 1500 * time.Millisecond )
Variables ¶
var GenNodeKeyCmd = &cobra.Command{
Use: "gen_node_key",
Short: "Generate a node key for this node and print its ID",
RunE: genNodeKey,
}
GenNodeKeyCmd allows the generation of a node key. It prints node's ID to the standard output.
var GenValidatorCmd = &cobra.Command{
Use: "gen_validator",
Short: "Generate new validator keypair",
Run: genValidator,
}
GenValidatorCmd allows the generation of a keypair for a validator.
var InitFilesCmd = &cobra.Command{
Use: "init",
Short: "Initialize Tendermint",
Run: initFiles,
}
InitFilesCmd initialises a fresh Tendermint Core instance.
var LiteCmd = &cobra.Command{ Use: "lite", Short: "Run lite-client proxy server, verifying tendermint rpc", Long: `This node will run a secure proxy to a tendermint rpc server. All calls that can be tracked back to a block header by a proof will be verified before passing them back to the caller. Other that that it will present the same interface as a full tendermint node, just with added trust and running locally.`, RunE: runProxy, SilenceUsage: true, }
LiteCmd represents the base command when called without any subcommands
var PORT = ":46657"
PORT - default rpc port
var ProbeUpnpCmd = &cobra.Command{
Use: "probe_upnp",
Short: "Test UPnP functionality",
RunE: probeUpnp,
}
ProbeUpnpCmd adds capabilities to test the UPnP functionality.
var ReplayCmd = &cobra.Command{ Use: "replay", Short: "Replay messages from WAL", Run: func(cmd *cobra.Command, args []string) { consensus.RunReplayFile(config, false) }, }
ReplayCmd allows replaying of messages from the WAL.
var ReplayConsoleCmd = &cobra.Command{ Use: "replay_console", Short: "Replay messages from WAL in a console", Run: func(cmd *cobra.Command, args []string) { consensus.RunReplayFile(config, true) }, }
ReplayConsoleCmd allows replaying of messages from the WAL in a console.
var ResetAllCmd = &cobra.Command{
Use: "unsafe_reset_all",
Short: "(unsafe) Remove all the data and WAL, reset this node's validator",
Run: resetAll,
}
ResetAllCmd removes the database of this Tendermint core instance.
var ResetPrivValidatorCmd = &cobra.Command{
Use: "unsafe_reset_priv_validator",
Short: "(unsafe) Reset this node's validator",
Run: resetPrivValidator,
}
ResetPrivValidatorCmd resets the private validator files.
var RootCmd = &cobra.Command{ Use: "tendermint", Short: "Tendermint Core (BFT Consensus) in Go", PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { if cmd.Name() == VersionCmd.Name() { return nil } config, err = ParseConfig(cmd == InitFilesCmd) if err != nil { return err } if len(config.LogFile) > 0 { output, err = os.OpenFile(config.LogFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) if err != nil { return err } } else { output = os.Stdout } logger1 := log.NewTMLogger(config.LogDir(), "tmcore") logger1.SetOutputAsync(true) logger1.SetWithThreadID(true) logger1.AllowLevel("debug") logger = logger1 logger, err = tmflags.ParseLogLevel(config.LogFile, config.LogLevel, logger, cfg.DefaultLogLevel()) if err != nil { return err } if viper.GetBool(cli.TraceFlag) { logger = log.NewTracingLogger(logger) } logger = logger.With("module", "main") return nil }, }
RootCmd is the root command for Tendermint core.
var ShowNodeIDCmd = &cobra.Command{
Use: "show_node_id",
Short: "Show this node's ID",
RunE: showNodeID,
}
ShowNodeIDCmd dumps node's ID to the standard output.
var ShowValidatorCmd = &cobra.Command{
Use: "show_validator",
Short: "Show this node's validator info",
Run: showValidator,
}
ShowValidatorCmd adds capabilities for showing the validator info.
var TestnetFilesCmd = &cobra.Command{
Use: "testnet",
Short: "Initialize files for a Tendermint testnet",
Long: `testnet will create "v" + "n" number of directories and populate each with
necessary files (private validator, genesis, config, etc.).
Note, strict routability for addresses is turned off in the config file.
Optionally, it will fill in persistent_peers list in config file using either hostnames or IPs.
Example:
tendermint testnet --v 4 --o ./output --populate-persistent-peers --starting-ip-address 192.168.10.2
`,
RunE: testnetFiles,
}
TestnetFilesCmd allows initialisation of files for a Tendermint testnet.
var VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { fmt.Println("tendermint version:", version.BaseVersion) fmt.Println("build version:", version.Version) }, }
VersionCmd ...
Functions ¶
func AddGenValidatorFlags ¶
func AddInitFlags ¶
func AddNodeFlags ¶
AddNodeFlags exposes some common configuration options on the command-line These are exposed for convenience of commands embedding a tendermint node
func AddSyncFlags ¶
func NewRunNodeCmd ¶
func NewRunNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
NewRunNodeCmd returns the command that allows the CLI to start a node. It can be used with a custom PrivValidator and in-process ABCI application.
func NewSyncNodeCmd ¶
func NewSyncNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
func ParseConfig ¶
ParseConfig retrieves the default environment configuration, sets up the Tendermint root and ensures that the root exists
func ProcessFollower ¶
ProcessFollower - processing the follower :-) nonsense
func ProcessP2P ¶
func ProcessP2P(genesisDoc types.GenesisDoc, nodeFile string, proxyApp string)
ProcessP2P - process p2p node info exchange nolint cyclomatic
Types ¶
type GenesisDoc ¶
type GenesisDoc map[string]json.RawMessage
type NodeDef ¶
type NodeDef struct { Name string `json:"name"` Power int64 `json:"power"` Reward string `json:"reward_addr"` ListenPort int `json:"listen_port"` Announce string `json:"announce"` IPIn string `json:"ip_in"` IPOut string `json:"ip_out"` IPPriv string `json:"ip_priv"` Apps []string `json:"apps"` }
NodeDef - define a node