commands

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExamCommand = cli.Command{
		Name:   "exam",
		Action: exam,
		Flags: []cli.Flag{
			cli.Int64Flag{
				Name:  "start",
				Value: 0,
			},
		},
	}
	InitCommand = cli.Command{
		Name:   "initial",
		Action: initial,
		Flags: []cli.Flag{
			cli.Int64Flag{
				Name:  "start",
				Value: 0,
			},
		},
	}
)
View Source
var (
	KvPutCommands = cli.Command{
		Name:     "put",
		Usage:    "operations for put key value",
		Category: "put",
		Action:   putKeyValue,
		Flags: []cli.Flag{
			anntoolFlags.privateKey,
		},
	}
	KvGetCommands = cli.Command{
		Name:     "get",
		Usage:    "operations for get key value, if",
		Category: "get",
		Action:   getKeyValue,
		Flags: []cli.Flag{
			anntoolFlags.pageNum,
			anntoolFlags.pageSize,
		},
	}
)
View Source
var (
	TransferBenchCommand = cli.Command{
		Name:   "bench",
		Action: transferBench,
		Flags: []cli.Flag{
			cli.Int64Flag{
				Name:  "start",
				Value: 0,
			},
			cli.Int64Flag{
				Name:  "times",
				Value: 1,
			},
		},
	}

	AnnCoinBenchCommand = cli.Command{
		Name:   "benchcoin",
		Action: benchAnnCoin,
		Flags:  []cli.Flag{},
	}
)
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:     "create",
				Action:   accountCreate,
				Usage:    "generate new private-pub key pair",
				Category: "Account",
			},
			{
				Name:     "calc",
				Action:   queryPubAddr,
				Usage:    "calculate pubkey and addr from given privkey",
				Category: "Account",
			},
		},
	}
)
View Source
var (
	AdminCommands = cli.Command{
		Name:     "admin",
		Usage:    "commands for admin operations",
		Category: "Admin",
		Subcommands: []cli.Command{
			{
				Name:   "add_peer",
				Usage:  "add node<peer> into validator_set;",
				Action: AddPeer,
				Flags: []cli.Flag{
					anntoolFlags.cType,
					anntoolFlags.verbose,
					anntoolFlags.nPrivs,
				},
			},
			{
				Name:   "remove_node",
				Usage:  "remove node from validator_set",
				Action: RemoveNode,
				Flags: []cli.Flag{
					anntoolFlags.validatorPubkey,
					anntoolFlags.verbose,
					anntoolFlags.nPrivs,
				},
			},
			{
				Name:   "change_node",
				Usage:  "change node of validator_set",
				Action: UpdateNode,
				Flags: []cli.Flag{
					anntoolFlags.validatorPubkey,
					anntoolFlags.power,
					anntoolFlags.cType,
					anntoolFlags.verbose,
					anntoolFlags.nPrivs,
				},
			},
		},
	}
)
View Source
var (

	//ContractCommands defines a more git-like subcommand system
	EVMCommands = cli.Command{
		Name:     "evm",
		Usage:    "operations for evm",
		Category: "Contract",
		Subcommands: []cli.Command{
			{
				Name:   "create",
				Usage:  "create a new contract",
				Action: createContract,
				Flags: []cli.Flag{
					anntoolFlags.bytecode,
					anntoolFlags.nonce,
					anntoolFlags.abif,
					anntoolFlags.callf,
				},
			}, {
				Name:   "call",
				Usage:  "execute a new contract",
				Action: callContract,
				Flags: []cli.Flag{
					anntoolFlags.payload,
					anntoolFlags.nonce,
					anntoolFlags.abistr,
					anntoolFlags.callstr,
					anntoolFlags.to,
					anntoolFlags.abif,
					anntoolFlags.callf,
				},
			}, {
				Name:   "read",
				Usage:  "read a contract",
				Action: readContract,
				Flags: []cli.Flag{
					anntoolFlags.payload,
					anntoolFlags.nonce,
					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 annchain 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,
			},
			cli.Command{
				Name:   "num_archived_blocks",
				Action: numArchivedBlocks,
			},
		},
	}
)
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:   "pending_nonce",
				Usage:  "query account's pending nonce",
				Action: queryPendingNonce,
				Flags: []cli.Flag{
					anntoolFlags.addr,
				},
			},
			{
				Name:   "receipt",
				Usage:  "",
				Action: queryReceipt,
				Flags: []cli.Flag{
					anntoolFlags.hash,
				},
			},
		},
	}
)
View Source
var (
	SignCommand = cli.Command{
		Name:   "sign",
		Action: signCA,
		Usage:  "nodes who want to join a chain must first get a CA signature from one the CA nodes in that chain",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "pub",
				Value: "0",
				Usage: "pubkeys of the nodes want to join, comma separated",
			},
		},
	}
)
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.nonce,
					anntoolFlags.to,
					anntoolFlags.value,
				},
			},
			{
				Name:   "data",
				Usage:  "query transaction execution info",
				Action: txData,
				Flags: []cli.Flag{
					cli.StringFlag{
						Name: "txHash",
					},
				},
			},
		},
	}
)
View Source
var (
	VersionCommands = cli.Command{
		Name:   "version",
		Action: ShowVersion,
		Usage:  "show version of gtool",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "version",
				Usage: "show version of gtool",
				Value: "0",
			},
		},
	}
)

Functions

func AddPeer

func AddPeer(ctx *cli.Context) error

-------------------------------------------------------------------

func CType

func CType() string

func InitLog

func InitLog()

func IsHex

func IsHex(str string) bool

func NPrivs

func NPrivs() string

func ParseData

func ParseData(data ...interface{}) (ret []byte)

func Power

func Power() string

func PrivKey

func PrivKey() string

func PubKey

func PubKey() string

func RemoveNode

func RemoveNode(ctx *cli.Context) error

func ShowVersion

func ShowVersion(ctx *cli.Context)

func SignTx

func SignTx(privBytes []byte, tx *etypes.Transaction) (signer etypes.Signer, sig []byte, err error)

func UnpackResult

func UnpackResult(method string, abiDef abi.ABI, output string) (interface{}, error)

func UpdateNode

func UpdateNode(ctx *cli.Context) error

func Verbose

func Verbose() string

Types

type AdminOPUser

type AdminOPUser struct {
	//account info;
	Priv  []byte
	Addr  []byte
	Nonce uint64
	// contains filtered or unexported fields
}

func NewAdminOPUser

func NewAdminOPUser(ctx *cli.Context) (*AdminOPUser, error)

func (*AdminOPUser) AdminTxData

func (au *AdminOPUser) AdminTxData() []byte

func (*AdminOPUser) ContractsAdminCmd

func (au *AdminOPUser) ContractsAdminCmd(vAttr *gtypes.ValidatorAttr) (*gtypes.AdminOPCmd, error)

func (*AdminOPUser) MakeAddPeerMsg

func (au *AdminOPUser) MakeAddPeerMsg(privKey crypto.PrivKey) error

func (*AdminOPUser) MakeRemoveNodeMsg

func (au *AdminOPUser) MakeRemoveNodeMsg(pub string) error

func (*AdminOPUser) MakeUpdateNodeMsg

func (au *AdminOPUser) MakeUpdateNodeMsg(pub string, power int64) error

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