unwire host from storage.Miner.
This commit is contained in:
parent
3aa6d03cc1
commit
1869de7662
@ -99,7 +99,7 @@ func ConfigStorageMiner(c interface{}) Option {
|
|||||||
|
|
||||||
// Mining / proving
|
// Mining / proving
|
||||||
Override(new(*slashfilter.SlashFilter), modules.NewSlashFilter),
|
Override(new(*slashfilter.SlashFilter), modules.NewSlashFilter),
|
||||||
Override(new(*storage.Miner), modules.StorageMiner(config.DefaultStorageMiner().Fees)),
|
// Override(new(*storage.Miner), modules.StorageMiner(config.DefaultStorageMiner().Fees)),
|
||||||
Override(new(*miner.Miner), modules.SetupBlockProducer),
|
Override(new(*miner.Miner), modules.SetupBlockProducer),
|
||||||
Override(new(gen.WinningPoStProver), storage.NewWinningPoStProver),
|
Override(new(gen.WinningPoStProver), storage.NewWinningPoStProver),
|
||||||
Override(new(*storage.Miner), modules.StorageMiner(cfg.Fees)),
|
Override(new(*storage.Miner), modules.StorageMiner(cfg.Fees)),
|
||||||
|
@ -61,7 +61,7 @@ type StorageMinerAPI struct {
|
|||||||
Host dtypes.Libp2pHost `optional:"true"`
|
Host dtypes.Libp2pHost `optional:"true"`
|
||||||
|
|
||||||
// Miner / storage
|
// Miner / storage
|
||||||
Miner *storage.Miner `optional:"true"`
|
Miner *storage.Miner
|
||||||
BlockMiner *miner.Miner `optional:"true"`
|
BlockMiner *miner.Miner `optional:"true"`
|
||||||
StorageMgr *sectorstorage.Manager `optional:"true"`
|
StorageMgr *sectorstorage.Manager `optional:"true"`
|
||||||
IStorageMgr sectorstorage.SectorManager `optional:"true"`
|
IStorageMgr sectorstorage.SectorManager `optional:"true"`
|
||||||
|
@ -45,7 +45,7 @@ import (
|
|||||||
smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network"
|
smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network"
|
||||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||||
"github.com/filecoin-project/go-multistore"
|
"github.com/filecoin-project/go-multistore"
|
||||||
paramfetch "github.com/filecoin-project/go-paramfetch"
|
"github.com/filecoin-project/go-paramfetch"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-statestore"
|
"github.com/filecoin-project/go-statestore"
|
||||||
"github.com/filecoin-project/go-storedcounter"
|
"github.com/filecoin-project/go-storedcounter"
|
||||||
@ -198,7 +198,6 @@ type StorageMinerParams struct {
|
|||||||
Lifecycle fx.Lifecycle
|
Lifecycle fx.Lifecycle
|
||||||
MetricsCtx helpers.MetricsCtx
|
MetricsCtx helpers.MetricsCtx
|
||||||
API v1api.FullNode
|
API v1api.FullNode
|
||||||
Host host.Host
|
|
||||||
MetadataDS dtypes.MetadataDS
|
MetadataDS dtypes.MetadataDS
|
||||||
Sealer sectorstorage.SectorManager
|
Sealer sectorstorage.SectorManager
|
||||||
SectorIDCounter sealing.SectorIDCounter
|
SectorIDCounter sealing.SectorIDCounter
|
||||||
@ -219,7 +218,6 @@ func StorageMiner(fc config.MinerFeeConfig) func(params StorageMinerParams) (*st
|
|||||||
lc = params.Lifecycle
|
lc = params.Lifecycle
|
||||||
api = params.API
|
api = params.API
|
||||||
sealer = params.Sealer
|
sealer = params.Sealer
|
||||||
h = params.Host
|
|
||||||
sc = params.SectorIDCounter
|
sc = params.SectorIDCounter
|
||||||
verif = params.Verifier
|
verif = params.Verifier
|
||||||
prover = params.Prover
|
prover = params.Prover
|
||||||
@ -240,7 +238,7 @@ func StorageMiner(fc config.MinerFeeConfig) func(params StorageMinerParams) (*st
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
sm, err := storage.NewMiner(api, maddr, h, ds, sealer, sc, verif, prover, gsd, fc, j, as)
|
sm, err := storage.NewMiner(api, maddr, ds, sealer, sc, verif, prover, gsd, fc, j, as)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ func MinerHandler(a api.StorageMiner, permissioned bool) (http.Handler, error) {
|
|||||||
mapi = api.PermissionedStorMinerAPI(mapi)
|
mapi = api.PermissionedStorMinerAPI(mapi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, _ = a.ActorAddress(context.Background())
|
||||||
readerHandler, readerServerOpt := rpcenc.ReaderParamDecoder()
|
readerHandler, readerServerOpt := rpcenc.ReaderParamDecoder()
|
||||||
rpcServer := jsonrpc.NewServer(readerServerOpt)
|
rpcServer := jsonrpc.NewServer(readerServerOpt)
|
||||||
rpcServer.Register("Filecoin", mapi)
|
rpcServer.Register("Filecoin", mapi)
|
||||||
|
@ -6,8 +6,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-bitfield"
|
"github.com/filecoin-project/go-bitfield"
|
||||||
"github.com/libp2p/go-libp2p-core/host"
|
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipfs/go-datastore"
|
"github.com/ipfs/go-datastore"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
@ -52,7 +50,6 @@ var log = logging.Logger("storageminer")
|
|||||||
type Miner struct {
|
type Miner struct {
|
||||||
api fullNodeFilteredAPI
|
api fullNodeFilteredAPI
|
||||||
feeCfg config.MinerFeeConfig
|
feeCfg config.MinerFeeConfig
|
||||||
h host.Host
|
|
||||||
sealer sectorstorage.SectorManager
|
sealer sectorstorage.SectorManager
|
||||||
ds datastore.Batching
|
ds datastore.Batching
|
||||||
sc sealing.SectorIDCounter
|
sc sealing.SectorIDCounter
|
||||||
@ -130,7 +127,6 @@ type fullNodeFilteredAPI interface {
|
|||||||
// NewMiner creates a new Miner object.
|
// NewMiner creates a new Miner object.
|
||||||
func NewMiner(api fullNodeFilteredAPI,
|
func NewMiner(api fullNodeFilteredAPI,
|
||||||
maddr address.Address,
|
maddr address.Address,
|
||||||
h host.Host,
|
|
||||||
ds datastore.Batching,
|
ds datastore.Batching,
|
||||||
sealer sectorstorage.SectorManager,
|
sealer sectorstorage.SectorManager,
|
||||||
sc sealing.SectorIDCounter,
|
sc sealing.SectorIDCounter,
|
||||||
@ -149,7 +145,6 @@ func NewMiner(api fullNodeFilteredAPI,
|
|||||||
verif: verif,
|
verif: verif,
|
||||||
prover: prover,
|
prover: prover,
|
||||||
addrSel: as,
|
addrSel: as,
|
||||||
h: h,
|
|
||||||
|
|
||||||
maddr: maddr,
|
maddr: maddr,
|
||||||
getSealConfig: gsd,
|
getSealConfig: gsd,
|
||||||
|
Loading…
Reference in New Issue
Block a user