/
flags.go
154 lines (143 loc) · 3.35 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright 2021 The Alaya Network Authors
// This file is part of Alaya-Go.
//
// Alaya-Go is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Alaya-Go is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Alaya-Go. If not, see <http://www.gnu.org/licenses/>.
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,
}
)