workers: RPC scaffolding

This commit is contained in:
Łukasz Magiera
2020-03-11 02:58:02 +01:00
parent da52596d79
commit eb61a36fd7
15 changed files with 299 additions and 214 deletions
+15 -9
View File
@@ -10,6 +10,7 @@ import (
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -107,16 +108,12 @@ type StorageMiner interface {
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error
/*WorkerStats(context.Context) (sealsched.WorkerStats, error)*/
// WorkerConnect tells the node to connect to workers RPC
WorkerConnect(context.Context, string) error
WorkerAttachStorage(context.Context, StorageInfo) error
WorkerDeclareSector(ctx context.Context, storageId string, s abi.SectorID) error
WorkerFindSector(context.Context, abi.SectorID, sectorbuilder.SectorFileType) ([]StorageInfo, error)
/*// WorkerQueue registers a remote worker
WorkerQueue(context.Context, WorkerCfg) (<-chan WorkerTask, error)
// WorkerQueue registers a remote worker
WorkerQueue(context.Context, sectorbuilder.WorkerCfg) (<-chan sectorbuilder.WorkerTask, error)
WorkerDone(ctx context.Context, task uint64, res sectorbuilder.SealRes) error
*/
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error
MarketListDeals(ctx context.Context) ([]storagemarket.StorageDeal, error)
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error)
@@ -128,6 +125,15 @@ type StorageMiner interface {
StorageAddLocal(ctx context.Context, path string) error
}
type StorageInfo struct {
ID string
URLs []string // TODO: Support non-http transports
Cost int
CanSeal bool
CanStore bool
}
type SealRes struct {
Err string
GoErr error `json:"-"`