-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.go
58 lines (49 loc) · 1.24 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
package main
import (
"context"
"fmt"
"os"
"github.com/sirupsen/logrus"
cli "github.com/urfave/cli/v2"
"github.com/migalabs/goteth/cmd"
"github.com/migalabs/goteth/pkg/utils"
)
var (
log = logrus.WithField(
"cli", "CliName",
)
)
func main() {
fmt.Println(utils.CliName, utils.Version)
customFormatter := new(logrus.TextFormatter)
customFormatter.FullTimestamp = true
// Set the general log configurations for the entire tool
// logrus.SetFormatter(utils.ParseLogFormatter("text"))
logrus.SetFormatter(customFormatter)
logrus.SetOutput(utils.ParseLogOutput("terminal"))
logrus.SetLevel(utils.ParseLogLevel("info"))
app := &cli.App{
Name: utils.CliName,
Usage: "Tinny client that requests and processes the Beacon State for the slot range defined.",
UsageText: "goteth [commands] [arguments...]",
Authors: []*cli.Author{
{
Name: "Cortze",
Email: "cortze@protonmail.com",
}, {
Name: "Tdahar",
Email: "tarsuno@gmail.com",
},
},
EnableBashCompletion: true,
Commands: []*cli.Command{
cmd.BlocksCommand,
cmd.ValidatorWindowCommand,
},
}
// generate the crawler
if err := app.RunContext(context.Background(), os.Args); err != nil {
log.Errorf("error: %v\n", err)
os.Exit(1)
}
}