0

On a tutorial in Youtube it uses pybitcointools. Upon searching it's github repository, I have found that it was not maintained anymore. Are there any alternative to this library which can get wallet balance?

Thank you.

0

Assuming you have a Bitcoin node to execute RPC calls against (i.e. you're running bitcoind with the RPC turned on), you can do this rather simply with pyjsonrpc:

#!/usr/bin/env python
from pyjsonrpc import ServiceProxy

bitcoin = ServiceProxy("http://127.0.0.1:8332")  # this is your bitcoind node and RPC port
bitcoin.username = 'testuser'  # rpcuser
bitcoin.password = 'testpass'  # rpcpassword
print(bitcoin.getbalance())
  • Thank you @Motoma. I am not aware if I have run any local RPC node unless pybitcointools is running it on the background. My intent is to have a personalized payment gateway and be able to track balances of multiple wallet addresses. – CodeJammer Sep 27 '18 at 23:20
  • @CodeJammer In that case, you'll need to run a local Bitcoin node in addition to the script above. Doing that is probably beyond the scope of this question, but Bitcoin Core or Bcoin are two such options for running a local node. – Motoma Sep 28 '18 at 12:36

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.