-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathmain.go
80 lines (70 loc) · 1.84 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
70
71
72
73
74
75
76
77
78
79
80
package main
import (
"os"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/boost/build"
cliutil "github.com/filecoin-project/boost/cli/util"
)
var log = logging.Logger("boostd")
const (
FlagBoostRepo = "boost-repo"
)
func main() {
app := &cli.App{
Name: "boostd",
Usage: "Markets V2 module for Filecoin",
EnableBashCompletion: true,
Version: build.UserVersion(),
Flags: []cli.Flag{
&cli.StringFlag{
Name: FlagBoostRepo,
EnvVars: []string{"BOOST_PATH"},
Usage: "boost repo path",
Value: "~/.boost",
},
cliutil.FlagVeryVerbose,
},
Commands: []*cli.Command{
authCmd,
runCmd,
initCmd,
migrateMonolithCmd,
migrateMarketsCmd,
backupCmd,
restoreCmd,
dummydealCmd,
dataTransfersCmd,
retrievalDealsCmd,
indexProvCmd,
importDataCmd,
logCmd,
dagstoreCmd,
piecesCmd,
},
}
app.Setup()
if err := app.Run(os.Args); err != nil {
os.Stderr.WriteString("Error: " + err.Error() + "\n")
}
}
func before(cctx *cli.Context) error {
_ = logging.SetLogLevel("boostd", "INFO")
_ = logging.SetLogLevel("db", "INFO")
_ = logging.SetLogLevel("boost-prop", "INFO")
_ = logging.SetLogLevel("modules", "INFO")
_ = logging.SetLogLevel("boost-storage-deal", "INFO")
if cliutil.IsVeryVerbose {
_ = logging.SetLogLevel("boostd", "DEBUG")
_ = logging.SetLogLevel("provider", "DEBUG")
_ = logging.SetLogLevel("boost-net", "DEBUG")
_ = logging.SetLogLevel("gql", "DEBUG")
_ = logging.SetLogLevel("boost-provider", "DEBUG")
_ = logging.SetLogLevel("storagemanager", "DEBUG")
_ = logging.SetLogLevel("index-provider-wrapper", "DEBUG")
_ = logging.SetLogLevel("boost-migrator", "DEBUG")
_ = logging.SetLogLevel("dagstore", "DEBUG")
_ = logging.SetLogLevel("migrator", "DEBUG")
}
return nil
}