Merge pull request #362 from filecoin-project/feat/chain-list-timestamp
add timestamp to chain list command output
This commit is contained in:
commit
b5ed3da230
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@ -321,7 +322,9 @@ var chainListCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i := len(tss) - 1; i >= 0; i-- {
|
for i := len(tss) - 1; i >= 0; i-- {
|
||||||
fmt.Printf("%d [ ", tss[i].Height())
|
mints := tss[i].MinTimestamp()
|
||||||
|
t := time.Unix(int64(mints), 0)
|
||||||
|
fmt.Printf("%d: (%s) [ ", tss[i].Height(), t.Format(time.Stamp))
|
||||||
for _, b := range tss[i].Blocks() {
|
for _, b := range tss[i].Blocks() {
|
||||||
fmt.Printf("%s: %s,", b.Cid(), b.Miner)
|
fmt.Printf("%s: %s,", b.Cid(), b.Miner)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user