fix: lmcli: make 'sectors list' DDO-aware (#11839)

* fix: lmcli: make 'sectors list' DDO-aware

* lmcli: Add ddo info to sectors status
This commit is contained in:
Łukasz Magiera
2024-04-05 11:39:49 -05:00
committed by GitHub
parent c827cf1c0e
commit 83421e2742
2 changed files with 31 additions and 0 deletions
+22
View File
@@ -11,6 +11,7 @@ import (
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/fatih/color"
@@ -109,6 +110,27 @@ func SectorsStatusCmd(getActorAddress ActorAddressGetter, getOnDiskInfo OnDiskIn
fmt.Printf("OnTime:\t\t%v\n", status.OnTime)
fmt.Printf("Early:\t\t%v\n", status.Early)
var pamsHeaderOnce sync.Once
for pi, piece := range status.Pieces {
if piece.DealInfo == nil {
continue
}
if piece.DealInfo.PieceActivationManifest == nil {
continue
}
pamsHeaderOnce.Do(func() {
fmt.Printf("\nPiece Activation Manifests\n")
})
pam := piece.DealInfo.PieceActivationManifest
fmt.Printf("Piece %d: %s %s verif-alloc:%+v\n", pi, pam.CID, types.SizeStr(types.NewInt(uint64(pam.Size))), pam.VerifiedAllocationKey)
for ni, notification := range pam.Notify {
fmt.Printf("\tNotify %d: %s (%x)\n", ni, notification.Address, notification.Payload)
}
}
} else {
onChainInfo = true
}