I get invalid argument error when running bitcoin-cli -getnetworkinfo, and a few other parameters

0

So I have bitcoind -daemon running and it appears to be generating the blockchain. keeps saying

Potential stale tip detected, will try using extra outbound peer...

The issue is I run bitcoin-cli commands and get the following error:

$ bitcoin-cli -getnetworkinfo
Error parsing command line arguments: Invalid parameter -getnetworkinfo

same for many others. The only cli command that seems to work is :

bitcoin-cli -getinfo
{
  "version": 180100,
  "protocolversion": 70015,
  "walletversion": 169900,
  "balance": 0.00000000,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 0,
  "proxy": "",
  "difficulty": 1,
  "testnet": false,
  "keypoololdest": 1573696666,
  "keypoolsize": 1000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "warnings": ""
}

according to the manual they should all work but many are saying invalid argument. I have searched and am shocked that there does not appear to be any info on why this is happening to some and not others. So here I am.

Norman Bird

Posted 2019-11-14T15:30:44.900

Reputation: 103

It seems like if I remove the - in front of SOME of the parameters, they then work. Even though the instructions on bitcoin.org say to use the hypen (-) for all of them. Is this not strange?Norman Bird 2019-11-14T15:32:37.997

Answers

1

getinfo has been deprecated as an RPC command, and the hyphenated version is provided as a bridge for legacy applications that have not yet moved to getblockchaininfo and getnetworkinfo.

For regular RPC commands, you do not need the hyphen, and can simply run them as bitcoin-cli getblockchaininfo.

The hyphenated parameters control the behaviour of bitcoin-cli itself, such as which datadir to connect to, or whether to use named parameters in the requests.

Raghav Sood

Posted 2019-11-14T15:30:44.900

Reputation: 10 897

Thank you. At least there is a place on the internet, NOW, for people to find this out, easily, cause I spent some time and found NOTHING that explained what you just did. :-) Thanks again.Norman Bird 2019-11-14T15:59:04.607