ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
638 stars 160 forks source link

feat: extend `forest-cli chain head` #4952

Closed LesnyRumcajs closed 3 weeks ago

LesnyRumcajs commented 3 weeks ago

Summary of changes

Changes introduced in this pull request:

❯ forest-cli chain head
[2097089]
bafy2bzaceajfbzlhuwudsdu3swuhgys2govtyel46akjdbarq2752w7cz7gde
bafy2bzaceapu74bbaxoftc76qbez7vr5a3hmkjcxjfk5pofufwv3wnlk36b3w
bafy2bzaceb2372awzqenvkdgpnkt34ssz64redtf4qb2ewugzbbpekl4kfftq
bafy2bzacebzh3llwhllzxsremaop4u37kbm4quu5bpjiwuoagzgmudmmwsywo
❯ forest-cli chain head -n 5
[2097089]
bafy2bzaceajfbzlhuwudsdu3swuhgys2govtyel46akjdbarq2752w7cz7gde
bafy2bzaceapu74bbaxoftc76qbez7vr5a3hmkjcxjfk5pofufwv3wnlk36b3w
bafy2bzaceb2372awzqenvkdgpnkt34ssz64redtf4qb2ewugzbbpekl4kfftq
bafy2bzacebzh3llwhllzxsremaop4u37kbm4quu5bpjiwuoagzgmudmmwsywo
[2097088]
bafy2bzacecxn5fuwwrhanvut4sisoe6ubp64kguhjalmawt6bdqxwvde6n4pe
bafy2bzacebbcf4xzbzfge7hqri3pa2ladnk4urqmlg24nmqdw3v2dzlzu35ia
bafy2bzacebv73y7v42f6nv2rinmfkuoaubmamz5uqsrsp5xe2g6dogsl7uiei
bafy2bzacecmxda677fteaap73ot6pfugcg4ixhsy2axyfnowjxvihg5pf4jds
[2097087]
bafy2bzaceckhkuybrh5uxzubse33kpeyeddzhmt5f3p23myh75c6cr4gnq3jk
bafy2bzacebu7pg2ne3b7tssw4dlf4jmflpid735nwn3rdlqgevzal36o6v5kg
bafy2bzaceblhetqnlhrhedt4hqzypnl4s6kbyqijbklqzl5nqy7euzu4v4qxc
bafy2bzacecwmdjo4zlagcqoqrd47iudkej5z5lzjbunhobxtzyucccjoptldw
[2097086]
bafy2bzaced5nc6tiaa2sada3qee3lveu5jhh45ouec7nwn74fe4nzadkxswg6
bafy2bzacecrna54zlij2gbtzuetliselajexb2nptzqzujdzpggh5wwxwkqq4
bafy2bzacec7iysjbauybb3ooiohgrxqkibuwiqhjno4p5xfqaycc6ur4jvow6
[2097085]
bafy2bzaceae3zvxgzqukg5sznohxozvz3ykf2rnyhthc5zs3lyhy3fneofnvo
bafy2bzacedckvm74g2tsr2vyqgay6xtljwh5xgem66hvri3dy65jmv5mdp6ac
bafy2bzacedat26oxwybmxqxqhzfvn3hspvoknvmgiqr2dvpx7ijagt5ggqu2m

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

hanabi1224 commented 3 weeks ago

It'd be great to support --format json (Not necessarily in this PR)

LesnyRumcajs commented 3 weeks ago

It'd be great to support --format json (Not necessarily in this PR)

Totally agree, not only for this subcommand but also for some others.

Added with low priority here https://github.com/ChainSafe/forest/issues/4954. It's nice to have, but so far, nobody needs it. And even in our CI, there was a single usage of it.

LesnyRumcajs commented 3 weeks ago

@hanabi1224 I removed the edge case in https://github.com/ChainSafe/forest/pull/4952/commits/f5d1adbc755d452368a2670d9e6ab2e507fe3f03, it was an artefact from a different approach. with saturating_sub it's not needed.