Documentation ¶
Overview ¶
This is referenced from ./venachain/usage.go with tiny modification (line: 198)
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetNames() []string
- func Deposit(z *ZCS, home common.Address, acc *Account, value string, l, r *big.Int) ([]interface{}, error)
- func PointCmp(point1, point2 *bn256.G1) int
- func PointToBn256(data *simAccReturn) *bn256.G1
- func Query(z *ZCS, acc *Account, l, r *big.Int) (*big.Int, error)
- func Register(z *ZCS, home common.Address, a *Account) ([]interface{}, error)
- func Transfer(z *ZCS, home common.Address, acc *Account, value string, decoyNum int, ...) error
- func Withdraw(z *ZCS, home common.Address, acc *Account, value string, l, r *big.Int) error
- func WriteConfig(filePath string, config *Config)
- type Account
- type AccountCopy
- type Config
- type Decoy
- type KeyPair
- type UserState
- type ZCS
Constants ¶
This section is empty.
Variables ¶
var ( RegisterCmd = cli.Command{ Name: "register", Usage: "register a new account", Action: register, Flags: registerCmdFlags, Description: ` client register --bc-owner ... --contract ... --url ... Register a new account in the privacy token contract`, } DepositCmd = cli.Command{ Name: "deposit", Usage: "deposit amount of token", Action: deposit, Flags: depositCmdFlags, Description: ` client deposit --account ... --value ... --bc-owner ... --contract ... --url ... Deposit amount of token from bc token to privacy token contract. the operation may be failed if the amount of token is insufficient in bc token contract`, } TransferCmd = cli.Command{ Name: "transfer", Usage: "invoke contract function", Action: transfer, Flags: transferCmdFlags, Description: ` client transfer --account ... --receiver ... --value ... --bc-owner ... --contract ... --url ... Transfer privacy token from an account to another account The --receiver should also be an account registered in the privacy token `, } WithdrawCmd = cli.Command{ Name: "withdraw", Usage: "withdraw amount of token", Action: withdraw, Flags: withdrawCmdFlags, Description: ` client withdraw --account ... --value ... --abi ... --bc-owner ... --contract ... --url ... Withdraw amount of token from privacy token to bc token contract. the operation may be failed if the amount of token is insufficient in privacy token contract`, } QueryCmd = cli.Command{ Name: "query", Usage: "query the amount of the privacy token in plaintext", Action: query, Flags: queryCmdFlags, Description: ` client query --account ... --bc-owner ... --contract ... --url ... query the AVAILABLE amount of privacy token at current epoch`, } ConfigCmd = cli.Command{ Name: "config", Usage: "generate a config file to eliminate the ", Action: genConfig, Flags: configCmdFlags, Description: ` client config --bc-owner ... --contract ... --url ... set the value of the config file`, } )
var ( /* AbiFlag = cli.StringFlag{ Name: "abi", Usage: "abi file of the privacy token contract.", }*/ UrlFlag = cli.StringFlag{ Name: "url", Usage: "url of remote nodes, format: http://<ip>:<port>", } ContractFlag = cli.StringFlag{ Name: "contract", Usage: "contract address of privacy token contract", } TxSenderFlag = cli.StringFlag{ Name: "bc-owner", Usage: "account registered in the bc token contract", } AccountFlag = cli.StringFlag{ Name: "account", Usage: "account registered in the privacy token contract", } TransferPubFlag = cli.StringFlag{ Name: "receiver", Usage: "public key of the receiver for receiving privacy token", } ValueFlag = cli.StringFlag{ Name: "value", Usage: "amount of token", } DecoyNumFlag = cli.IntFlag{ Name: "decoy-num", Usage: "2^n of members in the decoy, where n is a number from 2 to 6. e.g. --decoy-num 2 means 4 decoy members", Value: 3, } LeftIntervalFlag = cli.Int64Flag{ Name: "l-invl", Usage: "left interval of the balance. it is used for revealing the balance from ciphertext", } RightIntervalFlag = cli.Int64Flag{ Name: "r-invl", Usage: "right interval of the balance. it is used for revealing the balance from ciphertext", } OutputFlag = cli.StringFlag{ Name: "o", Usage: "specify the account file name", Value: defaultFile, } ConfigFlag = cli.BoolFlag{ Name: "config", Usage: "set the value of the config flags provided to the config.json file", } )
var AppHelpFlagGroups = []flagGroup{ { Name: "CONFIG", Flags: []cli.Flag{ UrlFlag, ContractFlag, TxSenderFlag, ConfigFlag, }, }, { Name: "COMMON", Flags: []cli.Flag{ AccountFlag, TransferPubFlag, ValueFlag, }, }, { Name: "MISC", }, }
AppHelpFlagGroups is the application flags, grouped by functionality.
var AppHelpTemplate = `` /* 637-byte string literal not displayed */
AppHelpTemplate is the test template for the default, global app help topic.
var ErrGetReceipt = errors.New("get transaction receipt error")
var ErrNonceUsed = errors.New("nonce is used")
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func PointToBn256 ¶
func WriteConfig ¶
WriteConfigFile writes data into config.json
Types ¶
type Account ¶
func NewAccount ¶
func NewAccount() *Account
type AccountCopy ¶
func NewAccountCopy ¶
func NewAccountCopy() *AccountCopy
type Config ¶
type Config struct { From string `json:"from"` // the address used to send the transaction Contract string `json:"contract"` // the address of the privacy token Url string `json:"url"` // the ip address of the remote node Verbosity int `json:"verbosity"` // the log level }
Config store the values from config.json file
func ParseConfigJson ¶
ParseConfigJson parses the data in config.json to Config object
type UserState ¶
func NewUserState ¶
func NewUserState() *UserState