2019-07-18 23:16:23 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
logging "github.com/ipfs/go-log"
|
|
|
|
"gopkg.in/urfave/cli.v2"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/go-lotus/build"
|
|
|
|
lcli "github.com/filecoin-project/go-lotus/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var log = logging.Logger("main")
|
|
|
|
|
2019-07-23 21:50:52 +00:00
|
|
|
const FlagStorageRepo = "storagerepo"
|
|
|
|
|
2019-07-18 23:16:23 +00:00
|
|
|
func main() {
|
|
|
|
logging.SetLogLevel("*", "INFO")
|
|
|
|
local := []*cli.Command{
|
2019-07-19 10:15:22 +00:00
|
|
|
runCmd,
|
|
|
|
initCmd,
|
2019-07-18 23:16:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
app := &cli.App{
|
|
|
|
Name: "lotus-storage-miner",
|
|
|
|
Usage: "Filecoin decentralized storage network storage miner",
|
|
|
|
Version: build.Version,
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "repo",
|
|
|
|
EnvVars: []string{"LOTUS_PATH"},
|
|
|
|
Hidden: true,
|
|
|
|
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
2019-07-23 21:50:52 +00:00
|
|
|
Name: FlagStorageRepo,
|
2019-07-18 23:44:59 +00:00
|
|
|
EnvVars: []string{"LOTUS_STORAGE_PATH"},
|
2019-07-18 23:16:23 +00:00
|
|
|
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Commands: append(local, lcli.Commands...),
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
log.Error(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|