/
flags.go
137 lines (128 loc) · 2.66 KB
/
flags.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package core
import "gopkg.in/urfave/cli.v1"
var (
ConfigPathFlag = cli.StringFlag{
Name: "config",
Usage: "config path",
}
PKFilePathFlag = cli.StringFlag{
Name: "pkfile",
Value: "",
Usage: "private key file path",
}
StabExecTimesFlag = cli.IntFlag{
Name: "times",
Value: 1000,
Usage: "execute times",
}
SendTxIntervalFlag = cli.IntFlag{
Name: "interval",
Value: 10,
Usage: "Time interval for sending transactions",
}
AccountSizeFlag = cli.IntFlag{
Name: "size",
Value: 10,
Usage: "account size",
}
TxJsonDataFlag = cli.StringFlag{
Name: "data",
Usage: "transaction data",
}
ContractWasmFilePathFlag = cli.StringFlag{
Name: "code",
Usage: "wasm file path",
}
ContractAddrFlag = cli.StringFlag{
Name: "addr",
Usage: "the contract address",
}
ContractFuncNameFlag = cli.StringFlag{
Name: "func",
Usage: "function and param ,eg :set(1,\"a\")",
}
TransactionTypeFlag = cli.IntFlag{
Name: "type",
Value: 2,
Usage: "tx type ,default 2",
}
ContractAbiFilePathFlag = cli.StringFlag{
Name: "abi",
Usage: "abi file path",
}
TransactionHashFlag = cli.StringFlag{
Name: "hash",
Usage: "tx hash",
}
TxFromFlag = cli.StringFlag{
Name: "from",
Usage: "transaction sender addr",
}
TxToFlag = cli.StringFlag{
Name: "to",
Usage: "transaction acceptor addr",
}
TransferValueFlag = cli.StringFlag{
Name: "value",
Value: "0xDE0B6B3A7640000", //one
Usage: "transfer value",
}
TxStressSourceFilesPathFlag = cli.StringSliceFlag{
Name: "sourceFile",
Usage: "the tps source file path",
}
TxStressStatisticTimeFlag = cli.IntFlag{
Name: "statisticTime",
Usage: "Statistics every few seconds",
}
TxStressOutPutFileFlag = cli.StringFlag{
Name: "output",
Usage: "the output file path",
}
deployCmdFlags = []cli.Flag{
ContractWasmFilePathFlag,
ContractAbiFilePathFlag,
ConfigPathFlag,
}
invokeCmdFlags = []cli.Flag{
ContractFuncNameFlag,
ContractAbiFilePathFlag,
ContractAddrFlag,
ConfigPathFlag,
TransactionTypeFlag,
}
sendTransactionCmdFlags = []cli.Flag{
TxFromFlag,
TxToFlag,
TransferValueFlag,
ConfigPathFlag,
}
sendRawTransactionCmdFlags = []cli.Flag{
PKFilePathFlag,
TxFromFlag,
TxToFlag,
TransferValueFlag,
ConfigPathFlag,
}
getTxReceiptCmdFlags = []cli.Flag{
TransactionHashFlag,
ConfigPathFlag,
}
stabilityCmdFlags = []cli.Flag{
PKFilePathFlag,
StabExecTimesFlag,
SendTxIntervalFlag,
ConfigPathFlag,
}
stabPrepareCmdFlags = []cli.Flag{
PKFilePathFlag,
AccountSizeFlag,
TransferValueFlag,
ConfigPathFlag,
}
txStressFlags = []cli.Flag{
TxStressSourceFilesPathFlag,
TxStressStatisticTimeFlag,
TxStressOutPutFileFlag,
}
)