forked from kyokan/plasma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
106 lines (99 loc) · 2.2 KB
/
cli.go
File metadata and controls
106 lines (99 loc) · 2.2 KB
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
package main
import (
"fmt"
"os"
"github.com/kyokan/plasma/db"
"github.com/kyokan/plasma/plasma"
"github.com/urfave/cli"
plasma_tests "github.com/kyokan/plasma/tester/plasma"
pq_tests "github.com/kyokan/plasma/tester/pq"
)
func main() {
app := cli.NewApp()
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "db",
Value: db.DefaultLocation(),
Usage: "Filepath for Plasma's database.",
},
cli.StringFlag{
Name: "node-url",
Value: "http://localhost:8545",
Usage: "Full URL to a running geth node.",
},
cli.StringFlag{
Name: "contract-addr",
Value: "0xd1d7dddd82189ea452eb5e104d13f0ca367887d9",
Usage: "Plasma contract address.",
},
cli.StringFlag{
Name: "keystore-dir",
Usage: "Keystore directory.",
},
cli.StringFlag{
Name: "keystore-file",
Usage: "Keystore file.",
},
cli.StringFlag{
Name: "sign-passphrase",
Usage: "Passphrase for keystore file.",
},
cli.StringFlag{
Name: "user-address",
Usage: "User address.",
},
cli.StringFlag{
Name: "private-key",
Usage: "Private key of user address.",
},
}
app.Name = "Plasma"
app.Usage = "A secure and scalable solution for decentralized applications."
app.Commands = []cli.Command{
{
Name: "start",
Usage: "Starts running a Plasma root node.",
Action: plasma.Start,
Flags: []cli.Flag{
cli.IntFlag{
Name: "rpc-port",
Value: 8643,
Usage: "Port for the RPC server to listen on.",
},
},
},
{
Name: "validate",
Usage: "Starts running a Plasma validator node.",
Action: func() { fmt.Println("Not implemented yet.") },
Flags: []cli.Flag{
cli.StringFlag{
Name: "root-url",
Usage: "The URL of the root node.",
},
},
},
{
Name: "utxos",
Usage: "Prints UTXOs for the given address.",
Action: plasma.PrintUTXOs,
Flags: []cli.Flag{
cli.StringFlag{
Name: "addr",
Usage: "The address to print UTXOs for.",
},
},
},
{
Name: "plasma-tests",
Usage: "Runs plasma integration tests.",
Action: plasma_tests.IntegrationTest,
},
{
Name: "pq-tests",
Usage: "Runs priority queue integration tests.",
Action: pq_tests.IntegrationTest,
},
}
app.Run(os.Args)
}