Open FroghubMan opened 2 years ago
The APIs involved include:
StorageDeclareSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error
StorageDropSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType) error
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]SectorStorageInfo, error)
Approximate workflow:
First check whether it already exists through StorageFindSector
, if it is, discard it(StorageDropSector
), and use StorageDeclareSector
to declare to a new location.
If the sector is restored successfully, the miner will be notified to declare the sector as soon as possible, then the failure time of this sector can be used. Need to use
MINER_API_INFO
to quickly declare the new location of the sector by calling the interfaceStorageDeclareSector
.