I have a function:
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'])
That I'm running in a loop (several million times) at the moment. I think that doing several batch calls would be much quicker that doing all these calls in series.
I can't seem to find any documentation on doing a batch RPC call in Python.
I've tried doing:
payload = json.dumps({"method": command, "params": [foo], "jsonrpc": "2.0"},
{"method": command, "params": [foo+1], "jsonrpc": "2.0"})
to no avail.