【发布时间】:2019-11-08 19:32:59
【问题描述】:
我正在尝试对比特币 RPC 进行以下调用,但不确定如何以正确的方式传递参数。
从 bitcoinrpc.authproxy 导入 AuthServiceProxy, JSONRPCException
curl --user user:password -sf --data-binary '{"jsonrpc": "1.0", "id":"check_btc_blockchain", "method": "listtransactions", "params":["slushpool", 10, 0, true] }' http://127.0.0.1:8332
使用以下python代码
# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%("user", "password"))
print(rpc_connection.listtransactions("slushpool", 10, 0, 0))
错误:bitcoinrpc.authproxy.JSONRPCException:-1:JSON 值不是预期的布尔值
我也尝试过使用真假。
【问题讨论】:
标签: python-3.x bitcoin