-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
88 lines (82 loc) · 1.72 KB
/
main.go
File metadata and controls
88 lines (82 loc) · 1.72 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
package main
import (
"fmt"
"log"
"os"
"github.com/christophercampbell/dseq/app"
"github.com/christophercampbell/dseq/cmd"
"github.com/urfave/cli/v2"
)
const (
AppName = "dseq"
)
func main() {
cliApp := cli.NewApp()
cliApp.Name = AppName
cliApp.Version = fmt.Sprintf("%v", app.AppVersion)
cliApp.Commands = []*cli.Command{
{
Name: "start",
Usage: "Start the node",
Action: cmd.StartNode,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "home",
Usage: "Home directory `DIR`",
Required: true,
},
&cli.UintFlag{
Name: "port",
Usage: "Data stream server port (6900)",
Required: false,
Value: 6900,
},
},
}, {
Name: "load",
Usage: "Send test transaction requests",
Action: cmd.RunLoad,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "nodes",
Aliases: []string{"n"},
Usage: "Host(&port) of nodes to send load requests, inCSV format",
Required: true,
},
&cli.UintFlag{
Name: "requests",
Aliases: []string{"r"},
Usage: "Total number of requests to send",
Value: 10,
},
&cli.UintFlag{
Name: "concurrency",
Aliases: []string{"c"},
Usage: "Number of concurrent requests",
Value: 1,
},
},
}, {
Name: "read",
Usage: "Read a data stream",
Action: cmd.ReadStream,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "node",
Usage: "Node to read data stream from (host:port)",
Required: true,
},
&cli.UintFlag{
Name: "from",
Usage: "Where to start the data stream from",
Required: false,
Value: 0,
},
},
},
}
err := cliApp.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}