subcommands

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HomeFlag           = "home"
	RPCListenAddress   = "tcp://0.0.0.0:46657"
	P2PListenAddress   = "tcp://0.0.0.0:46656"
	BaseConfigProxyApp = "tcp://127.0.0.1:46658"
	ConfigDir          = "config"
	RootFile           = "config.toml"
)
View Source
const (
	MINIMUN_STAKED int64 = int64(2000)
)

Variables

View Source
var BeginUnbondingCmd = &cobra.Command{
	Use:   "begin_unbonding",
	Short: "begin unbonding",
	RunE:  beginUnbonding,
}
View Source
var CompleteUnbondingCmd = &cobra.Command{
	Use:   "complete_unbonding",
	Short: "complete unbonding",
	RunE:  completeUnbonding,
}
View Source
var InitFilesCmd = &cobra.Command{
	Use:   "init",
	Short: "Initialize essential files",
	RunE:  initFiles,
}

InitFilesCmd initialises a fresh Tendermint Core instance.

View Source
var NodeCmd = constructCommand()
View Source
var RegisterValidatorCmd = &cobra.Command{
	Use:   "register_masternode",
	Short: "register this node as a masternode",
	RunE:  registerValidator,
}

ShowNodeIDCmd dumps node's ID to the standard output.

View Source
var ResetAllCmd = &cobra.Command{
	Use:   "unsafe_reset_all",
	Short: "(unsafe) Remove all the data and WAL, reset this node's validator to genesis state",
	Run:   resetAll,
}

ResetAllCmd removes the database of this Tendermint core instance.

View Source
var ResetPrivValidatorCmd = &cobra.Command{
	Use:   "unsafe_reset_priv_validator",
	Short: "(unsafe) Reset this node's validator to genesis state",
	Run:   resetPrivValidator,
}

ResetPrivValidatorCmd resets the private validator files.

View Source
var RootCmd = &cobra.Command{
	Use:   "shareledger",
	Short: "Shareledger is a distributed blockchain for sharing services",
	PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) {

		bindFlagsLoadViper(cmd, args)

		config, err = ParseConfig()

		if err != nil {
			return err
		}

		return nil
	},
}
View Source
var ShowAddressCmd = &cobra.Command{
	Use:   "show_address",
	Short: "Show this node's address",
	RunE:  showAddress,
}

ShowPrivKeyCmd dumps node's Private Key to the standard output.

View Source
var ShowBalanceCmd = &cobra.Command{
	Use:   "show_balance",
	Short: "show current balance of this masternode",
	RunE:  showBalance,
}
View Source
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.

View Source
var ShowPrivKeyCmd = &cobra.Command{
	Use:   "show_priv_key",
	Short: "Show this node's private key",
	RunE:  showPrivKey,
}

ShowPrivKeyCmd dumps node's Private Key to the standard output.

View Source
var ShowVdiCmd = &cobra.Command{
	Use:   "show_val_dist_info",
	Short: "show current earning of this masternode",
	RunE:  showVdiCmd,
}
View Source
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:

	shareledger 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.

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show version info",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("shareledger-"+version.Version, "tendermint-"+tmversion.Version)
	},
}

VersionCmd ...

View Source
var WithdrawBlockRewardCmd = &cobra.Command{
	Use:   "withdraw_block_reward",
	Short: "withdraw block reward to accounts",
	RunE:  withdrawBlockReward,
}

Functions

func ParseConfig

func ParseConfig() (*cfg.Config, error)

func ParseLogLevel

func ParseLogLevel(lvl string, logger log.Logger, defaultLogLevelValue string) (log.Logger, error)

ParseLogLevel parses complex log level - comma-separated list of module:level pairs with an optional *:level pair (* means all other modules).

Example:

ParseLogLevel("consensus:debug,mempool:debug,*:error", log.NewTMLogger(os.Stdout), "info")

func ResetAll

func ResetAll(dbDir, addrBookFile, privValKeyFile string, privValStateFile string, logger log.Logger)

ResetAll removes the privValidator and address book files plus all data. Exported so other CLI tools can use it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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