Home Bitcoin bitcoin core – No connection might be made as a result of the goal machine actively refused it

bitcoin core – No connection might be made as a result of the goal machine actively refused it

0
bitcoin core – No connection might be made as a result of the goal machine actively refused it

[ad_1]

Attempting to make a POST request with python from my desktop to my Bitcoin node operating on raspberrypi. The 2 gadgets are operating on the identical community each linked by ethernet. I’ve been capable of make a POST request utilizing curl from the node’s command line (ssh from the desktop). The command seems like this:

curl -v -u <rpcuser>:<rpcpassword> -d '{"technique":"getblockcount","params":[],"id":1}' http://localhost:8332/

It provides me the output simply high quality, however once I write a python script from my desktop to ship the identical POST request, it provides me the error within the title. The python code seems like this:

request = requests.put up(url=self.url, json={"technique":"getblockhash","params":[0],"id":1}, headers={'Authorization':'Fundamental <base64 encoding of rpcuser:rpcpass>'})

I’ve tried each the auth and the headers parameter they usually each give me the identical error. How can I move within the rpcuser and password to efficiently make a request?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here