我正在尝试执行以下对比特币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值不是预期的布尔值
我也尝试过使用true和false。
发布于 2019-11-09 05:18:03
所以这个方法起作用了。
在VAR上设置布尔值。
trt = True
print(rpc_connection.listtransactions("slushpool", 10, 0, trt))https://stackoverflow.com/questions/58772742
复制相似问题