Storage detach/attach in lotus-miner, cli commands

This commit is contained in:
Łukasz Magiera
2022-08-01 15:58:06 +02:00
parent 943d2a72c6
commit 8cff52aef6
18 changed files with 372 additions and 23 deletions
+16
View File
@@ -1206,6 +1206,22 @@ func (sm *StorageMinerAPI) StorageAddLocal(ctx context.Context, path string) err
return sm.StorageMgr.AddLocalStorage(ctx, path)
}
func (sm *StorageMinerAPI) StorageDetachLocal(ctx context.Context, path string) error {
if sm.StorageMgr == nil {
return xerrors.Errorf("no storage manager")
}
return sm.StorageMgr.DetachLocalStorage(ctx, path)
}
func (sm *StorageMinerAPI) StorageRedeclareLocal(ctx context.Context, id *storiface.ID, dropMissing bool) error {
if sm.StorageMgr == nil {
return xerrors.Errorf("no storage manager")
}
return sm.StorageMgr.RedeclareLocalStorage(ctx, id, false)
}
func (sm *StorageMinerAPI) PiecesListPieces(ctx context.Context) ([]cid.Cid, error) {
return sm.PieceStore.ListPieceInfoKeys()
}