The blockchaininfo command is now returning a lot of "softfork" information.

Is there a way I can get other fields without the softfork blob?

  • 2
    Don't look at them? Or if you're using bitcoin-cli, use jq or even grep to filter them out? – Pieter Wuille Aug 15 '17 at 4:07
  • @PieterWuille You know, Pieter, blockchaininfo is a very commonly used command. It makes sense to return a single screen of the most useful information. For most users, the key thing is to make sure that they are synced, which means comparing the block count to the headers. Scrolling this critical information off the screen with a lot of softfork verbiage is a nuisance. There should either be a switch to remove that information altogether or at least it should be distilled to a synopsis so that the printout stays on one page. – Tyler Durden Aug 15 '17 at 12:07
  • RPC calls are more intended to be machine readable than human readable. – Pieter Wuille Aug 15 '17 at 17:15

You can use the jq shell command to filter out the unwanted keys.

$ ./bitcoin-cli getblockchaininfo | jq 'del (.softforks)' | jq 'del (.bip9_softforks)'

with as output:

  "chain": "main",
  "blocks": 485623,
  "headers": 485623,
  "bestblockhash": "000000000000000000772fa60c075c57b8ba2db277a84454e1f8e27c3c307b10",
  "difficulty": 922724699725.9628,
  "mediantime": 1505593445,
  "verificationprogress": 0.9999959396017668,
  "chainwork": "0000000000000000000000000000000000000000008aeb8bb8310a6b50e24bb0",
  "pruned": false

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.