trueblocks-core icon indicating copy to clipboard operation
trueblocks-core copied to clipboard

chifra status: chifra status --terse is missing information with --fmt json option

Open davidfsol5 opened this issue 3 years ago • 2 comments

JSON formated data is missing "Chain (ids)", "pinkey" and "Progress" $ chifra status --terse 2022/02/13 17:35:37 Client: erigon/2022.01.3/linux-amd64/go1.17.2 (archive, tracing) 2022/02/13 17:35:37 TrueBlocks: GHC-TrueBlocks//0.25.0-alpha-28cf2d7e8-20220212 (eskey, no pinkey) 2022/02/13 17:35:37 Config Path: ~/.local/share/trueblocks/ 2022/02/13 17:35:37 Chain (ids): rinkeby (4,4) 2022/02/13 17:35:37 Cache Path: ~/.local/share/trueblocks/cache/rinkeby/ 2022/02/13 17:35:37 Index Path: ~/.local/share/trueblocks/unchained/rinkeby/ 2022/02/13 17:35:37 RPC Provider: http://localhost:8545/ 2022/02/13 17:35:37 Progress: 10163095, 10156754, 10162813, 10162840

$ chifra status --terse --fmt json { "data": [ { "clientVersion": "erigon/2022.01.3/linux-amd64/go1.17.2", "trueblocksVersion": "GHC-TrueBlocks//0.25.0-alpha-28cf2d7e8-20220212", "rpcProvider": "http://localhost:8545/", "configPath": "~/.local/share/trueblocks/", "cachePath": "~/.local/share/trueblocks/cache/rinkeby/", "indexPath": "~/.local/share/trueblocks/unchained/rinkeby/", "isArchive": true, "isTracing": true, "hasEskey": true, "date": "2022-02-13 22:35:33 UTC" } ] }

davidfsol5 avatar Feb 13 '22 22:02 davidfsol5

~Removing the --terse option when --fmt json is specified adds an element named "chainID" that partially coresponds to "Chain (ids)":~ ~"clientIds": "chainId: 4 networkId: 4"~ ~Can this be added output with --terse option with chain name added and reformatted to something like (I'm not fluent in json):~ ~"clientIds": {"chainName": "rinkeby", "chainId": 4, "networkId": 4}~

davidfsol5 avatar Feb 13 '22 22:02 davidfsol5

Thanks for the issue. We'll get this done shortly (next week). It's a tiny bit more complicated than it might seem due to caching. It requires a version change.

tjayrush avatar Feb 16 '22 13:02 tjayrush

This can be fixed easily by adding meta to the output if --fmt json. As of v0.60.0, chifra status is now terse by default.

tjayrush avatar Apr 19 '23 20:04 tjayrush