擅长:python、mysql、java
<p>由于您使用的是Python,所以最好的做法是使用RPC,例如:</p>
<pre><code>import base64
import requests
response = requests.post(
bitcoind_url,
data=json.dumps(
{
'method': method,
'params': params,
'jsonrpc': '2.0',
'id': 0,
}
),
headers={'content-type': 'application/json', 'Authorization': b'Basic ' + base64.b64encode(rpcuser + b':' + rpcpassword)})
</code></pre>
<p>其中<code>params</code>是特定<code>method</code>的参数列表。在</p>
<p>您可以从比特币配置文件中获得<code>rpcuser</code>和{<cd4>}。在</p>