commands

package
v0.0.0-...-a4757fd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//AccountCommands defines a more git-like subcommand system
	AccountCommands = cli.Command{
		Name:     "account",
		Usage:    "operations for account",
		Category: "Account",
		Subcommands: []cli.Command{
			{
				Name:     "gen",
				Action:   generatePrivPubAddr,
				Usage:    "generate new private-pub key pair",
				Category: "Account",
			},
			{
				Name:     "cal",
				Action:   calculatePrivPubAddr,
				Usage:    "calculate public key and address from private key",
				Category: "Account",
				Flags: []cli.Flag{
					anntoolFlags.privkey,
				},
			},
			{
				Name:     "geneth",
				Action:   generateSecpPrivPubAddr,
				Usage:    "generate new private-pub key pair",
				Category: "Account",
			},
		},
	}
)
View Source
var (

	//ContractCommands defines a more git-like subcommand system
	EVMCommands = cli.Command{
		Name:     "evm",
		Usage:    "operations for evm contract",
		Category: "Contract",
		Subcommands: []cli.Command{
			{
				Name:   "create",
				Usage:  "create a new contract",
				Action: createContract,
				Flags: []cli.Flag{
					anntoolFlags.addr,
					anntoolFlags.bytecode,
					anntoolFlags.privkey,
					anntoolFlags.nonce,
					anntoolFlags.abif,
					anntoolFlags.callf,
				},
			},
			{
				Name:   "execute",
				Usage:  "execute a new contract",
				Action: executeContract,
				Flags: []cli.Flag{
					anntoolFlags.addr,
					anntoolFlags.payload,
					anntoolFlags.privkey,
					anntoolFlags.nonce,
					anntoolFlags.abif,
					anntoolFlags.callf,
				},
			},
			{
				Name:   "querycontract",
				Usage:  "read a contract",
				Action: queryContract,
				Flags: []cli.Flag{
					anntoolFlags.payload,
					anntoolFlags.abistr,
					anntoolFlags.callstr,
					anntoolFlags.to,
					anntoolFlags.abif,
					anntoolFlags.callf,
				},
			},
			{
				Name:   "exist",
				Usage:  "check if a contract has been deployed",
				Action: existContract,
				Flags: []cli.Flag{
					anntoolFlags.callf,
				},
			},
		},
	}
)
View Source
var (
	InfoCommand = cli.Command{
		Name:  "info",
		Usage: "get ann info",
		Subcommands: []cli.Command{
			cli.Command{
				Name:   "last_block",
				Action: lastBlockInfo,
			},
			cli.Command{
				Name:   "num_unconfirmed_txs",
				Action: numUnconfirmedTxs,
			},
			cli.Command{
				Name:   "net",
				Action: netInfo,
			},
		},
	}
)
View Source
var (
	QueryCommands = cli.Command{
		Name:     "query",
		Usage:    "operations for query state",
		Category: "Query",
		Subcommands: []cli.Command{
			{
				Name:   "nonce",
				Usage:  "query account's nonce",
				Action: queryNonce,
				Flags: []cli.Flag{
					anntoolFlags.addr,
				},
			},
			{
				Name:   "balance",
				Usage:  "query account's balance",
				Action: queryBalance,
				Flags: []cli.Flag{
					anntoolFlags.addr,
				},
			},
			{
				Name:   "share",
				Usage:  "query node's share",
				Action: queryShare,
				Flags: []cli.Flag{
					anntoolFlags.accountPubkey,
				},
			},
			{
				Name:   "receipt",
				Usage:  "",
				Action: queryReceipt,
				Flags: []cli.Flag{
					anntoolFlags.hash,
				},
			},
			{
				Name:   "isvalidator",
				Usage:  "query account is validator",
				Action: queryValidator,
				Flags: []cli.Flag{
					anntoolFlags.accountPubkey,
				},
			},
		},
	}
)
View Source
var (
	ShareCommands = cli.Command{
		Name:     "share",
		Usage:    "operations for share transaction",
		Category: "Share",
		Subcommands: []cli.Command{
			{
				Name:   "send",
				Usage:  "send a mount of share",
				Action: sendShare,
				Flags: []cli.Flag{
					anntoolFlags.nonce,
					anntoolFlags.to,
					anntoolFlags.value,
					cli.StringFlag{
						Name:  "nodeprivkey",
						Usage: "node account privkey",
					},
					cli.StringFlag{
						Name:  "evmprivkey",
						Usage: "evm account privkey",
					},
				},
			},
			{
				Name:   "guarantee",
				Usage:  "use share guarantee to participate election",
				Action: shareGuarantee,
				Flags: []cli.Flag{
					anntoolFlags.nonce,
					anntoolFlags.value,
					cli.StringFlag{
						Name:  "nodeprivkey",
						Usage: "node account privkey",
					},
					cli.StringFlag{
						Name:  "evmprivkey",
						Usage: "evm account privkey",
					},
				},
			},
			{
				Name:   "redeem",
				Usage:  "redeem share to exit election",
				Action: shareRedeem,
				Flags: []cli.Flag{
					anntoolFlags.nonce,
					anntoolFlags.value,
					cli.StringFlag{
						Name:  "nodeprivkey",
						Usage: "node account privkey",
					},
					cli.StringFlag{
						Name:  "evmprivkey",
						Usage: "evm account privkey",
					},
				},
			},
		},
	}
)
View Source
var (
	TxCommands = cli.Command{
		Name:     "tx",
		Usage:    "operations for transaction",
		Category: "Transaction",
		Subcommands: []cli.Command{
			{
				Name:   "send",
				Usage:  "send a transaction",
				Action: sendTx,
				Flags: []cli.Flag{
					anntoolFlags.payload,
					anntoolFlags.privkey,
					anntoolFlags.nonce,
					anntoolFlags.to,
					anntoolFlags.value,
				},
			},
		},
	}
)

Functions

This section is empty.

Types

type AnntoolFlags

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

Jump to

Keyboard shortcuts

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