Answer the question
In order to leave comments, you need to log in
Where can I find a Python library or methods for working with Bitcoin RPC or CLI?
Good afternoon, I know that it’s not right to ask questions in this format, but I can’t figure out how to simply use Python, for example, create a wallet, delete it, send coins from it.
Answer the question
In order to leave comments, you need to log in
Just downloaded, tried it - works
https://github.com/jgarzik/python-bitcoinrpc
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
rpc_user = "btc_user"
rpc_password = "btc_password"
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:8332"%(rpc_user, rpc_password))
addr = "1LTzdfgert56546ytythghgfUEK"
print(rpc_connection.getreceivedbyaddress(addr))
newaddress = rpc_connection.getnewaddress ( "label", "p2sh-segwit" )
print(newaddress)
difficulty = rpc_connection.getdifficulty()
print(difficulty)
balance = rpc_connection.getbalance()
print(balance)
#список всех последних 1000 транзакций:
transactions = rpc_connection.listtransactions("*", 1000)
print(transactions)
I’m starting to deal with this topic, tell me, in this code, do we authorize in the blockchain itself or is this a library for working with api of a particular exchange?
rpc_user = "btc_user"
rpc_password = "btc_password"
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:8332"%(rpc_user, rpc_password))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question