Initial pass at a peer manager
This commit is contained in:
committed by
Łukasz Magiera
parent
ec5e075fa8
commit
fc7c7ddd97
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/sub"
|
||||
"github.com/filecoin-project/lotus/node/hello"
|
||||
"github.com/filecoin-project/lotus/node/modules/helpers"
|
||||
"github.com/filecoin-project/lotus/peermgr"
|
||||
"github.com/filecoin-project/lotus/retrieval/discovery"
|
||||
"github.com/filecoin-project/lotus/storage/sector"
|
||||
)
|
||||
@@ -33,6 +34,10 @@ func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.
|
||||
h.Network().Notify(&bundle)
|
||||
}
|
||||
|
||||
func RunPeerMgr(mctx helpers.MetricsCtx, lc fx.Lifecycle, pmgr *peermgr.PeerMgr) {
|
||||
go pmgr.Run(helpers.LifecycleCtx(mctx, lc))
|
||||
}
|
||||
|
||||
func RunBlockSync(h host.Host, svc *chain.BlockSyncService) {
|
||||
h.SetStreamHandler(chain.BlockSyncProtocolID, svc.HandleStream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user