8

Am currently sending RPC calls to bitcoind in Python3 in series using JSON:

import json, requests

def pull(command, foo):
    headers = {'content-type': 'application/json'}
    payload = json.dumps({"method": command, "params": [foo], "jsonrpc": "2.0"})
    response = requests.get(serverURL, headers=headers, data=payload)

    return(response.json()['result'])

Ex:

pull('getblock', BLOCKHASH)

and hope to improve call speeds by doing batch RPC calls.

Is this possible and how so?

1 Answer 1

10

Yes, this is supported. As specified by JSON-RPC 2.0, you can send in an array of requests, and receive an array of solutions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.