Setup PeerTagger as Invoke
This commit is contained in:
parent
8d0d2b2fae
commit
8284436eae
@ -40,7 +40,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/node/modules/helpers"
|
||||
"github.com/filecoin-project/lotus/node/modules/lp2p"
|
||||
"github.com/filecoin-project/lotus/node/modules/testing"
|
||||
"github.com/filecoin-project/lotus/node/peers"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
"github.com/filecoin-project/lotus/paych"
|
||||
"github.com/filecoin-project/lotus/peermgr"
|
||||
@ -101,6 +100,7 @@ const (
|
||||
// daemon
|
||||
ExtractApiKey
|
||||
HeadMetricsKey
|
||||
RunPeerTaggerKey
|
||||
|
||||
SetApiEndpointKey
|
||||
|
||||
@ -234,7 +234,7 @@ func Online() Option {
|
||||
Override(new(*paych.Store), paych.NewStore),
|
||||
Override(new(*paych.Manager), paych.NewManager),
|
||||
Override(new(*market.FundMgr), market.NewFundMgr),
|
||||
Override(new(*peers.PeerTagger), lp2p.TagMiners),
|
||||
Override(RunPeerTaggerKey, lp2p.TagMiners),
|
||||
),
|
||||
|
||||
// Storage miner
|
||||
|
@ -14,7 +14,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/peers"
|
||||
)
|
||||
|
||||
type CommonAPI struct {
|
||||
@ -22,7 +21,6 @@ type CommonAPI struct {
|
||||
|
||||
APISecret *dtypes.APIAlg
|
||||
Host host.Host
|
||||
PeerTagger *peers.PeerTagger // TODO: this needs a better home
|
||||
}
|
||||
|
||||
type jwtPayload struct {
|
||||
|
@ -100,7 +100,7 @@ func simpleOpt(opt libp2p.Option) func() (opts Libp2pOpts, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
func TagMiners(lc fx.Lifecycle, h host.Host, stmgr *stmgr.StateManager) *peers.PeerTagger {
|
||||
func TagMiners(lc fx.Lifecycle, h host.Host, stmgr *stmgr.StateManager) {
|
||||
pt := peers.NewPeerTagger(h, stmgr)
|
||||
lc.Append(fx.Hook{
|
||||
OnStart: func(ctx context.Context) error {
|
||||
@ -112,5 +112,5 @@ func TagMiners(lc fx.Lifecycle, h host.Host, stmgr *stmgr.StateManager) *peers.P
|
||||
},
|
||||
})
|
||||
|
||||
return pt
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user