Get things to mostly build
This commit is contained in:
parent
e053cd6b9c
commit
d3ffe48fcb
@ -242,7 +242,7 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
|
||||
// Setup remote sector store
|
||||
_, spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting proof type: %w", err)
|
||||
}
|
||||
|
@ -421,7 +421,12 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
|
||||
return err
|
||||
}
|
||||
|
||||
ppt, spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
winPt, err := spt.RegisteredWinningPoStProof()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -438,12 +443,11 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
|
||||
|
||||
smgr, err := sectorstorage.New(ctx, lr, stores.NewIndex(), &ffiwrapper.Config{
|
||||
SealProofType: spt,
|
||||
PoStProofType: ppt,
|
||||
}, sectorstorage.SealerConfig{true, true, true}, nil, sa)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
epp := storage.NewElectionPoStProver(smgr, dtypes.MinerID(mid))
|
||||
epp := storage.NewElectionPoStProver(smgr, dtypes.MinerID(mid), winPt)
|
||||
|
||||
beacon := beacon.NewMockBeacon(build.BlockDelay * time.Second)
|
||||
|
||||
|
4
go.mod
4
go.mod
@ -24,7 +24,7 @@ require (
|
||||
github.com/filecoin-project/go-padreader v0.0.0-20200210211231-548257017ca6
|
||||
github.com/filecoin-project/go-paramfetch v0.0.2-0.20200218225740-47c639bab663
|
||||
github.com/filecoin-project/go-statestore v0.1.0
|
||||
github.com/filecoin-project/sector-storage v0.0.0-20200410191347-65efbfce12e9
|
||||
github.com/filecoin-project/sector-storage v0.0.0-20200410210142-c0d619cd8616
|
||||
github.com/filecoin-project/specs-actors v0.0.0-20200409043918-e569f4a2f504
|
||||
github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275
|
||||
github.com/filecoin-project/storage-fsm v0.0.0-20200408153957-1c356922353f
|
||||
@ -122,3 +122,5 @@ replace github.com/filecoin-project/specs-storage => /home/magik6k/gohack/github
|
||||
replace github.com/filecoin-project/sector-storage => /home/magik6k/gohack/github.com/filecoin-project/sector-storage
|
||||
|
||||
replace github.com/filecoin-project/go-fil-markets => /home/magik6k/gohack/github.com/filecoin-project/go-fil-markets
|
||||
|
||||
replace github.com/filecoin-project/storage-fsm => /home/magik6k/gohack/github.com/filecoin-project/storage-fsm
|
||||
|
@ -85,7 +85,7 @@ func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams)
|
||||
return nil, xerrors.Errorf("failed checking miners sector size: %w", err)
|
||||
}
|
||||
|
||||
rt, _, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
rt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("bad sector size: %w", err)
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func ProofsConfig(maddr dtypes.MinerAddress, fnapi lapi.FullNode) (*ffiwrapper.C
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
spt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("bad sector size: %w", err)
|
||||
}
|
||||
@ -135,11 +135,16 @@ func StorageMiner(mctx helpers.MetricsCtx, lc fx.Lifecycle, api lapi.FullNode, h
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ppt, _, err := ffiwrapper.SealProofTypeFromSectorSize(sealer.SectorSize()) // TODO: this changes
|
||||
spt, err := ffiwrapper.SealProofTypeFromSectorSize(sealer.SectorSize()) // TODO: this changes
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("bad sector size: %w", err)
|
||||
}
|
||||
|
||||
ppt, err := spt.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fps := storage.NewWindowedPoStScheduler(api, sealer, maddr, worker, ppt)
|
||||
|
||||
sm, err := storage.NewMiner(api, maddr, worker, h, ds, sealer, sc, verif, tktFn)
|
||||
@ -324,7 +329,7 @@ func StorageProvider(ctx helpers.MetricsCtx, fapi lapi.FullNode, h host.Host, ds
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rt, _, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
rt, err := ffiwrapper.SealProofTypeFromSectorSize(ssize)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -43,6 +43,15 @@ func (s SealingAPIAdapter) StateMinerSectorSize(ctx context.Context, maddr addre
|
||||
return s.delegate.StateMinerSectorSize(ctx, maddr, tsk)
|
||||
}
|
||||
|
||||
func (s SealingAPIAdapter) StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tok sealing.TipSetToken) (address.Address, error) {
|
||||
tsk, err := types.TipSetKeyFromBytes(tok)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("failed to unmarshal TipSetToken to TipSetKey: %w", err)
|
||||
}
|
||||
|
||||
return s.delegate.StateMinerWorker(ctx, maddr, tsk)
|
||||
}
|
||||
|
||||
func (s SealingAPIAdapter) StateWaitMsg(ctx context.Context, mcid cid.Cid) (sealing.MsgLookup, error) {
|
||||
wmsg, err := s.delegate.StateWaitMsg(ctx, mcid)
|
||||
if err != nil {
|
||||
|
@ -101,7 +101,7 @@ func (m *Miner) Run(ctx context.Context) error {
|
||||
evts := events.NewEvents(ctx, m.api)
|
||||
adaptedAPI := NewSealingAPIAdapter(m.api)
|
||||
pcp := sealing.NewBasicPreCommitPolicy(adaptedAPI, 10000000)
|
||||
m.sealing = sealing.New(adaptedAPI, NewEventsAdapter(evts), m.maddr, m.worker, m.ds, m.sealer, m.sc, m.verif, m.tktFn, &pcp)
|
||||
m.sealing = sealing.New(adaptedAPI, NewEventsAdapter(evts), m.maddr, m.ds, m.sealer, m.sc, m.verif, m.tktFn, &pcp)
|
||||
|
||||
go m.sealing.Run(ctx)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user