forked from keep-network/keep-ecdsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
69 lines (59 loc) · 1.2 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
package main
import (
"fmt"
"os"
"path"
"time"
"github.com/ipfs/go-log"
"github.com/keep-network/keep-common/pkg/logging"
"github.com/keep-network/keep-ecdsa/cmd"
"github.com/urfave/cli"
)
var logger = log.Logger("keep-main")
const (
defaultConfigPath = "./configs/config.toml"
)
var (
version string
revision string
configPath string
)
func main() {
if version == "" {
version = "unknown"
}
if revision == "" {
revision = "unknown"
}
err := logging.Configure(os.Getenv("LOG_LEVEL"))
if err != nil {
fmt.Fprintf(os.Stderr, "failed to configure logging: [%v]\n", err)
}
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Usage = "CLI for t-ECDSA keep"
app.Compiled = time.Now()
app.Authors = []cli.Author{
{
Name: "Keep Network",
Email: "[email protected]",
},
}
app.Version = fmt.Sprintf("%s (revision %s)", version, revision)
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config,c",
Value: defaultConfigPath,
Destination: &configPath,
Usage: "full path to the configuration file",
},
}
app.Commands = []cli.Command{
cmd.StartCommand,
cmd.EthereumCommand,
}
err = app.Run(os.Args)
if err != nil {
logger.Fatal(err)
}
}