mirror of
https://github.com/filecoin-project/lotus.git
synced 2025-07-04 11:23:27 +08:00
feat(cli): lotus chain head --height to print epoch number
A simpler version of what's currently possible with: lotus chain list --format '<height>' --count 1
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
- Reduce size of embedded genesis CAR files by removing WASM actor blocks and compressing with zstd. This reduces the `lotus` binary size by approximately 10 MiB. ([filecoin-project/lotus#12439](https://github.com/filecoin-project/lotus/pull/12439))
|
- Reduce size of embedded genesis CAR files by removing WASM actor blocks and compressing with zstd. This reduces the `lotus` binary size by approximately 10 MiB. ([filecoin-project/lotus#12439](https://github.com/filecoin-project/lotus/pull/12439))
|
||||||
- Add ChainSafe operated Calibration archival node to the bootstrap list ([filecoin-project/lotus#12517](https://github.com/filecoin-project/lotus/pull/12517))
|
- Add ChainSafe operated Calibration archival node to the bootstrap list ([filecoin-project/lotus#12517](https://github.com/filecoin-project/lotus/pull/12517))
|
||||||
- Fix hotloop in F3 pariticpation API ([filecoin-project/lotus#12575](https://github.com/filecoin-project/lotus/pull/12575))
|
- Fix hotloop in F3 pariticpation API ([filecoin-project/lotus#12575](https://github.com/filecoin-project/lotus/pull/12575))
|
||||||
|
- `lotus chain head` now supports a `--height` flag to print just the epoch number of the current chain head ([filecoin-project/lotus#12609](https://github.com/filecoin-project/lotus/pull/12609))
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
- Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567))
|
- Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567))
|
||||||
@ -15,8 +16,6 @@
|
|||||||
|
|
||||||
## Improvements
|
## Improvements
|
||||||
|
|
||||||
## Improvements
|
|
||||||
|
|
||||||
## Deps
|
## Deps
|
||||||
|
|
||||||
# UNRELEASED Node v1.30.0
|
# UNRELEASED Node v1.30.0
|
||||||
|
10
cli/chain.go
10
cli/chain.go
@ -72,6 +72,12 @@ var ChainCmd = &cli.Command{
|
|||||||
var ChainHeadCmd = &cli.Command{
|
var ChainHeadCmd = &cli.Command{
|
||||||
Name: "head",
|
Name: "head",
|
||||||
Usage: "Print chain head",
|
Usage: "Print chain head",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "height",
|
||||||
|
Usage: "print just the epoch number of the chain head",
|
||||||
|
},
|
||||||
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
afmt := NewAppFmt(cctx.App)
|
afmt := NewAppFmt(cctx.App)
|
||||||
|
|
||||||
@ -87,9 +93,13 @@ var ChainHeadCmd = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cctx.Bool("height") {
|
||||||
|
afmt.Println(head.Height())
|
||||||
|
} else {
|
||||||
for _, c := range head.Cids() {
|
for _, c := range head.Cids() {
|
||||||
afmt.Println(c)
|
afmt.Println(c)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1616,6 +1616,7 @@ USAGE:
|
|||||||
lotus chain head [command options] [arguments...]
|
lotus chain head [command options] [arguments...]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
--height print just the epoch number of the chain head (default: false)
|
||||||
--help, -h show help
|
--help, -h show help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user