peer manager: Handle bootstrap in peermgr

This commit is contained in:
Łukasz Magiera
2019-10-23 13:11:18 +02:00
parent 1d1f468c98
commit 5175d8541e
4 changed files with 17 additions and 51 deletions
+4 -2
View File
@@ -4,6 +4,7 @@ package main
import (
"context"
"github.com/filecoin-project/lotus/peermgr"
"io/ioutil"
"github.com/multiformats/go-multiaddr"
@@ -95,8 +96,9 @@ var DaemonCmd = &cli.Command{
return lr.SetAPIEndpoint(apima)
}),
node.ApplyIf(func(s *node.Settings) bool { return cctx.Bool("bootstrap") },
node.Override(node.BootstrapKey, modules.Bootstrap),
node.ApplyIf(func(s *node.Settings) bool { return !cctx.Bool("bootstrap") },
node.Unset(node.RunPeerMgrKey),
node.Unset(new(*peermgr.PeerMgr)),
),
)
if err != nil {
+1
View File
@@ -15,6 +15,7 @@ import (
func main() {
logging.SetLogLevel("*", "INFO")
logging.SetLogLevel("dht", "ERROR")
local := []*cli.Command{
DaemonCmd,
}