command

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateCmd = &cobra.Command{
	Use:     "Create {password}",
	Short:   "Create {password}; Create account;",
	Aliases: []string{"create", "C", "c"},
	Example: `
	Create  
		OR
	Create 123456
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  Create,
}
View Source
var CycleSupersCmd = &cobra.Command{
	Use:     "CycleSupers {cycle}; Gets the current super nodes;",
	Short:   "CycleSupers {cycle}; Gets the current super nodes;",
	Aliases: []string{"cyclesupers", "CS", "cs"},
	Example: `
	CycleSupers {8736163}
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  CycleSupers,
}
View Source
var DecryptPrivateCmd = &cobra.Command{
	Use:     "DecryptPrivate {address} {password} {key file};Decrypting account json file generates the private key and mnemonic;;",
	Short:   "DecryptPrivate {address} {password} {key file}; Decrypting account json file generates the private key and mnemonic;",
	Aliases: []string{"decryptprivate", "DP", "dp"},

	Example: `
	DecryptPrivate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ
		OR
	DecryptPrivate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 123456
		OR
	DecryptPrivate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 123456 xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ.json
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  DecryptPrivate,
}
View Source
var EntropyCmd = &cobra.Command{
	Use:     "NewEntropy ;Generate a cryptographically secure pseudorandom entropy(seed);",
	Aliases: []string{"neewentropy", "NE", "ne"},
	Short:   "NewEntropy ;Generate a cryptographically secure pseudorandom entropy(seed);",
	Example: `
	NewEntropy 
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  Entropy,
}
View Source
var GetAccountCmd = &cobra.Command{
	Use:     "Account {address};Get account status;",
	Aliases: []string{"Account", "A", "a"},
	Short:   "Account {address};Get account status;",
	Example: `
	Account xC8RqvGNhQ8sEpKrBHqnxJQh2rrtiJCXZrH 
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  Account,
}
View Source
var GetBlockCmd = &cobra.Command{
	Use:     "GetBlock {height/hash};",
	Short:   "GetBlock {height/hash}; Get block by height or hash;",
	Aliases: []string{"getblock", "gb", "GB"},
	Example: `
	GetBlock 1 
	GetBlock 0x4e32b712330c0d4ee45f06017390c5d1d3c26d0e6c7be4ea9a5036bdb6c72a07 
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  GetBlock,
}
View Source
var GetCandidatesCmd = &cobra.Command{
	Use:     "GetCandidates",
	Short:   "GetCandidates;Get current candidates;",
	Aliases: []string{"getcandidates", "GC", "gc"},
	Example: `
	GetCandidates
	`,
	Run: GetCandidates,
}
View Source
var GetMessageCmd = &cobra.Command{
	Use:     "GetMessage {msghash}; Get Message by hash;",
	Aliases: []string{"getmessage", "GM", "gm"},
	Short:   "GetMessage {msghash}; Get Message by hash;",
	Example: `
	GetMessage 0xef7b92e552dca02c97c9d596d1bf69d0044d95dec4cee0e6a20153e62bce893b
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  GetMessage,
}
View Source
var LastHeightCmd = &cobra.Command{
	Use:     "LastHeight",
	Short:   "LastHeight; Get last height of node;",
	Aliases: []string{"lastheight", "LH", "lh"},
	Example: `
	LastHeight 
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  LastHeight,
}
View Source
var LocalInfoCmd = &cobra.Command{
	Use:     "LocalInfo ;Get the current node information",
	Short:   "LocalInfo ;Get the current node information;",
	Aliases: []string{"localinfo", "LI", "li"},
	Example: `
	LocalInfo
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  LocalInfo,
}
View Source
var MnemonicCmd = &cobra.Command{
	Use:     "NewMnemonic {entropy};Create a mnemonic world-list (BIP39) from an entropy;",
	Aliases: []string{"newmnemonic", "NM", "nm"},
	Short:   "NewMnemonic {entropy};Create a mnemonic world-list (BIP39) from an entropy;",
	Example: `
	NewMnemonic dad1f695098e409da517aa09d91bb163ea749c3f9ee564cb75e223a78f460a1e
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  Mnemonic,
}
View Source
var MnemonicToAccountCmd = &cobra.Command{
	Use:     "MnemonicToAccount {mnemonic} {password};Restore address by mnemonic and set new password;",
	Short:   "MnemonicToAccount {mnemonic} {password}; Restore address by mnemonic and set new password;",
	Aliases: []string{"mnemonictoaccount", "MTA", "mta"},
	Example: `
	MnemonicToAccount "sadness ladder sister camp suspect sting height diagram confirm program twist ostrich blush bronze pass gasp resist random nothing recycle husband install business turtle"
		OR
	MnemonicToAccount "sadness ladder sister camp suspect sting height diagram confirm program twist ostrich blush bronze pass gasp resist random nothing recycle husband install business turtle" 123456
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  MnemonicToAccount,
}
View Source
var MnemonicToEcCmd = &cobra.Command{
	Use:     "MnemonicToEc {Mnemonic};Create a new EC private key from a mnemonic;",
	Aliases: []string{"mnemonictoec", "MTE", "mte"},
	Short:   "MnemonicToEc {Mnemonic};Create a new EC private key from a mnemonic;",
	Example: `
	Mnemonic 'suspect moral pipe basic tomato excite nephew vocal antenna silver unable sick point evoke wrist syrup gospel forum joy elder jump perfect chronic select'
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  MnemonicToEc,
}
View Source
var MsgPoolCmd = &cobra.Command{
	Use:     "MsgPool",
	Short:   "MsgPool; Get messages in the message pool;",
	Aliases: []string{"msgpool", "MP", "mp"},
	Example: `
	MsgPool 
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  MsgPool,
}

GenerateCmd cpu mine block

View Source
var PeerInfoCmd = &cobra.Command{
	Use:     "PeerInfo",
	Short:   "PeerInfo; Get peer info;",
	Aliases: []string{"peerinfo", "PI", "pi"},
	Example: `
	PeerInfo 
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  PeerInfo,
}
View Source
var RootCmd = &cobra.Command{
	Use:  "wallet",
	Long: `wallet cli is a RPC tool`,
}
View Source
var RootSubCmdGroups = make(map[string][]*cobra.Command)
View Source
var SendCancelCmd = &cobra.Command{
	Use:     "SendCancel {address} {fees} {password} {nonce}; Cancel candidate;",
	Aliases: []string{"sendcancel", "SCL", "scl"},
	Short:   "SendCancel {address} {fees} {password} {nonce}; Cancel candidate;",
	Example: `
	SendCancel xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001
		OR
	SendCancel xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001 123456
		OR
	SendCancel xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001 123456 1
	`,
	Args: cobra.MinimumNArgs(2),
	Run:  CancelCandidate,
}
View Source
var SendCandidateCmd = &cobra.Command{
	Use:     "SendCandidate {address} {fees} {password} {nonce}; Become candidate;",
	Aliases: []string{"sendcandidate", "SC", "sc"},
	Short:   "SendCandidate {address} {fees} {password} {nonce}; Become candidate;",
	Example: `
	SendCandidate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001
		OR
	SendCandidate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001 123456
		OR
	SendCandidate xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ 0.001 123456 1
`,
	Args: cobra.MinimumNArgs(2),
	Run:  SendCandidate,
}
View Source
var SendCreateTokenCmd = &cobra.Command{
	Use:     "SendCreateToken {from} {to} {name} {shorthand} {allow increase} {amount} {fees} {password} {nonce}; Send and create token;",
	Aliases: []string{"sendcreatetoken", "sct"},
	Short:   "SendCreateToken {from} {to} {name} {shorthand} {allow increase} {amount} {fees} {password} {nonce}; Send and create token;",
	Example: `
	SendCreateToken 3ajDJUnMYDyzXLwefRfNp7yLcdmg3ULb9ndQ 3ajNkh7yVYkETL9JKvGx3aL2YVNrqksjCUUE "M token" MT false 1000 0.1
		OR
	SendCreateToken 3ajDJUnMYDyzXLwefRfNp7yLcdmg3ULb9ndQ 3ajNkh7yVYkETL9JKvGx3aL2YVNrqksjCUUE "M token" MT false 1000 0.1 123456
		OR
	SendCreateToken 3ajDJUnMYDyzXLwefRfNp7yLcdmg3ULb9ndQ 3ajNkh7yVYkETL9JKvGx3aL2YVNrqksjCUUE "M token" MT false 1000 0.1 123456 0
	`,
	Args: cobra.MinimumNArgs(7),
	Run:  SendCreateToken,
}
View Source
var SendMessageCmd = &cobra.Command{
	Use:     "SendTransaction {from} {to} {token} {amount} {fees} {password} {nonce}; Send a transaction;",
	Aliases: []string{"sendtransaction", "ST", "st"},
	Short:   "SendTransaction {from} {to} {token} {amount} {fees} {password} {nonce}; Send a transaction;",
	Example: `
	SendTransaction xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 FC 10 0.1
		OR
	SendTransaction xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 FC 10 0.1 123456
		OR
	SendTransaction xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 FC 10 0.1 123456 1
	`,
	Args: cobra.MinimumNArgs(5),
	Run:  SendTransaction,
}
View Source
var SendVoteCmd = &cobra.Command{
	Use:     "SendVote {from} {to} {fees} {password} {nonce};Vote for a candidate;",
	Aliases: []string{"sendvote", "SV", "sv"},
	Short:   "SendVote {from} {to} {fees} {password} {nonce}; Vote for a candidate;",
	Example: `
	SendVote xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 0.001
		OR
	SendVote xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 0.001 123456
		OR
	SendVote xCHiGPLCzgnrdTqjKABXZteAGVJu3jXLjnQ xCE9boXz2TxSE9srVPDdfszyiXtfT3vduc8 0.001 123456 1
`,
	Args: cobra.MinimumNArgs(3),
	Run:  Vote,
}
View Source
var ShowAccountsCmd = &cobra.Command{
	Use:     "ListAccounts",
	Short:   "ListAccounts; List all account of the wallet;",
	Aliases: []string{"listaccounts", "LA", "la"},
	Example: `
	ListAccounts
	`,
	Args: cobra.MinimumNArgs(0),
	Run:  ListAccount,
}
View Source
var TokenCmd = &cobra.Command{
	Use:     "Token {token address}; Get a token records;",
	Aliases: []string{"token", "T", "t"},
	Short:   "Token {token address}; Get a token records;",
	Example: `
	Token Tfb792w8YrJxqgWxBV8iqpHq5ntwDePkcbQ
	`,
	Args: cobra.MinimumNArgs(1),
	Run:  Token,
}

Functions

func Account

func Account(cmd *cobra.Command, args []string)

func AccountByRpc

func AccountByRpc(addr string) (*types.Account, error)

func CancelCandidate

func CancelCandidate(cmd *cobra.Command, args []string)

func Create

func Create(cmd *cobra.Command, args []string)

func CycleSupers

func CycleSupers(cmd *cobra.Command, args []string)

func DecryptPrivate

func DecryptPrivate(cmd *cobra.Command, args []string)

func Entropy

func Entropy(cmd *cobra.Command, args []string)

func Eq

func Eq(a interface{}, b interface{}) bool

Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic.

func GetBlock

func GetBlock(cmd *cobra.Command, args []string)

func GetBlockByHash

func GetBlockByHash(cmd *cobra.Command, args []string)

func GetCandidates

func GetCandidates(cmd *cobra.Command, args []string)

func GetMessage

func GetMessage(cmd *cobra.Command, args []string)

func GetMessageRpc

func GetMessageRpc(hashStr string) (*rpc.Response, error)

func GetTokenByRpc

func GetTokenByRpc(tokenAddr string) (*rpc.Response, error)

func Gt

func Gt(a interface{}, b interface{}) bool

Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans, Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as ints and then compared.

func LastHeight

func LastHeight(cmd *cobra.Command, args []string)

func ListAccount

func ListAccount(cmd *cobra.Command, args []string)

func LocalInfo

func LocalInfo(cmd *cobra.Command, args []string)

func MakeHelpTpl

func MakeHelpTpl() string

MakeHelpTpl make root sub group

func Mnemonic

func Mnemonic(cmd *cobra.Command, args []string)

func MnemonicToAccount

func MnemonicToAccount(cmd *cobra.Command, args []string)

func MnemonicToEc

func MnemonicToEc(cmd *cobra.Command, args []string)

func MsgPool

func MsgPool(cmd *cobra.Command, args []string)

func NewRpcClient

func NewRpcClient() (*rpc.Client, error)

func PeerInfo

func PeerInfo(cmd *cobra.Command, args []string)

func SendCandidate

func SendCandidate(cmd *cobra.Command, args []string)

func SendCreateToken

func SendCreateToken(cmd *cobra.Command, args []string)

func SendTransaction

func SendTransaction(cmd *cobra.Command, args []string)

func Token

func Token(cmd *cobra.Command, args []string)

func UseageFunc

func UseageFunc(c *cobra.Command) error

func Vote

func Vote(cmd *cobra.Command, args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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