-
Notifications
You must be signed in to change notification settings - Fork 146
/
main.go
118 lines (112 loc) · 2.35 KB
/
main.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
package main
import (
"github.com/PlatONnetwork/PlatON-Go/cmd/utils"
"fmt"
"gopkg.in/urfave/cli.v1"
"os"
)
var (
app = utils.NewApp("", "the wasm command line interface")
DebugFlag = cli.BoolFlag{
Name: "debug",
Usage: "output full trace logs",
}
MemProfileFlag = cli.StringFlag{
Name: "memprofile",
Usage: "creates a memory profile at the given path",
}
TxTypeFlag = cli.Int64Flag{
Name: "txtype",
Usage: "The transaction type",
}
StatDumpFlag = cli.BoolFlag{
Name: "statdump",
Usage: "displays stack and heap memory information",
}
CodeFlag = cli.StringFlag{
Name: "code",
Usage: "WASM code",
}
CodeFileFlag = cli.StringFlag{
Name: "codefile",
Usage: "File containing WASM code. If '-' is specified, code is read from stdin",
}
AbiFlag = cli.StringFlag{
Name: "abi",
Usage: "WASM abi",
}
AbiFileFlag = cli.StringFlag{
Name: "abifile",
Usage: "File containing WASM abi. If '-' is specified, abi is read from stdin",
}
GasFlag = cli.Uint64Flag{
Name: "gas",
Usage: "gas limit for the wasm",
}
GasPriceFlag = utils.BigFlag{
Name: "gasPrice",
Usage: "price set for the wasm",
}
ValueFlag = utils.BigFlag{
Name: "value",
Usage: "value set for the wasm",
}
InputFlag = cli.StringFlag{
Name: "input",
Usage: "input for the wasm",
}
VerbosityFlag = cli.IntFlag{
Name: "verbosity",
Usage: "sets the verbosity level",
}
CreateFlag = cli.BoolFlag{
Name: "create",
Usage: "indicates the action should be create rather than call",
}
GenesisFlag = cli.StringFlag{
Name: "prestate",
Usage: "JSON file with prestate (genesis) config",
}
MachineFlag = cli.BoolFlag{
Name: "json",
Usage: "output trace logs in machin readable format(json)",
}
SenderFlag = cli.StringFlag{
Name: "sender",
Usage: "The transaction origin",
}
ReceiverFlag = cli.StringFlag{
Name: "receiver",
Usage: "The transaction receiver (execution context)",
}
)
func init() {
app.Flags = []cli.Flag{
CreateFlag,
DebugFlag,
VerbosityFlag,
CodeFlag,
CodeFileFlag,
GasFlag,
GasPriceFlag,
ValueFlag,
InputFlag,
MemProfileFlag,
StatDumpFlag,
GenesisFlag,
MachineFlag,
SenderFlag,
ReceiverFlag,
}
app.Commands = []cli.Command{
runCommond,
unittestCommand,
benchmarkCommand,
}
}
func main() {
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}