petertodd / python-bitcoinlib

Python3 library providing an easy interface to the Bitcoin data structures and protocol.
Other
1.84k stars 624 forks source link

In RPC module, "getinfo" method doesn't seem to work #244

Open jeanmonet opened 4 years ago

jeanmonet commented 4 years ago

Hi,

I noticed earlier today that the method getinfo() doesn't seem to work in the rpc module:

https://github.com/petertodd/python-bitcoinlib/blob/b5540e8a8a138f2a4872c34ce4223b8f4e6856d9/bitcoin/rpc.py#L513

Should call('getinfo') be replaced by call('getblockchaininfo')? (https://bitcoincore.org/en/doc/0.20.0/rpc/blockchain/getblockchaininfo/)

mcelrath commented 4 years ago

The getinfo RPC call has been deprecated in favor of a bunch of more specific "info" calls including getblockchainfo. See also getnetworkinfo, getwalletinfo etc. Whether this works depends on the version of bitcoind it's talking to. We should probably add direct methods to reflect changes in bitcoind's rpc...

MentalNomad commented 4 years ago

including getblockchainfo

typo: getblockchaininfo

https://bitcoincore.org/en/doc/0.16.0/rpc/blockchain/getblockchaininfo/