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"
|
2020-07-14 20:04:27 +00:00
|
|
|
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() {
|
2020-07-16 14:45:31 +00:00
|
|
|
if err := logging.SetLogLevel("*", "info"); err != nil {
|
|
|
|
log.Fatal(err)
|
2020-06-30 17:26:41 +00:00
|
|
|
}
|
2020-08-17 15:31:59 +00:00
|
|
|
log.Info("Starting chainwatch", " v", build.UserVersion())
|
2019-11-15 16:38:56 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
},
|
2020-08-27 00:46:43 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "api",
|
|
|
|
EnvVars: []string{"FULLNODE_API_INFO"},
|
|
|
|
Value: "",
|
|
|
|
},
|
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
|
|
|
},
|
2020-07-16 14:45:31 +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 {
|
2020-07-16 14:45:31 +00:00
|
|
|
log.Fatal(err)
|
2019-11-15 16:38:56 +00:00
|
|
|
}
|
|
|
|
}
|