lotus/cmd/lotus-chainwatch/main.go

50 lines
938 B
Go
Raw Normal View History

2019-11-15 16:38:56 +00:00
package main
import (
2019-11-19 12:57:16 +00:00
"os"
"github.com/filecoin-project/lotus/build"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
2019-11-15 16:38:56 +00:00
)
var log = logging.Logger("chainwatch")
func main() {
if err := logging.SetLogLevel("*", "info"); err != nil {
log.Fatal(err)
}
2019-11-15 16:38:56 +00:00
log.Info("Starting chainwatch")
app := &cli.App{
Name: "lotus-chainwatch",
Usage: "Devnet token distribution utility",
2020-06-01 18:43:51 +00:00
Version: build.UserVersion(),
2019-11-15 16:38:56 +00:00
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
EnvVars: []string{"LOTUS_PATH"},
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
2019-12-05 11:58:19 +00:00
&cli.StringFlag{
Name: "db",
EnvVars: []string{"LOTUS_DB"},
2019-12-10 23:42:36 +00:00
Value: "",
2019-12-05 11:58:19 +00:00
},
&cli.StringFlag{
Name: "log-level",
EnvVars: []string{"GOLOG_LOG_LEVEL"},
Value: "info",
},
},
Commands: []*cli.Command{
dotCmd,
runCmd,
2019-11-15 16:38:56 +00:00
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
2019-11-15 16:38:56 +00:00
}
}