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?

SLee
  • 133
  • 1
  • 7

1 Answers1

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.

Pieter Wuille
  • 98,249
  • 9
  • 183
  • 287