I have Ethereum node running the JSON RPC server on this IP example
126.96.36.199 . Then I want to use a client to push some data. I see this library to make the client.
But I can't connect to my server. I got this error :
requests.exceptions.ConnectionError: HTTPConnectionPool(host='188.8.131.52', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError ('<requests.packages.urllib3.connection.HTTPConnection object at 0x10ecfacd0>: Failed to establish a new connection: [Errno 61] Connection refused',))
I just put these 3 lines as it's mentioned in the documentation like this in my python script :
from eth_rpc_client import Client client = Client(host="184.108.40.206", port="8545") client.get_coinbase()
I think I can't connect to my server because the password itsn't defined in my script. How can I send the server password in ethereum rpc client ?
Ok So now I fixed the connection problem. I reconfigured parity with this command line :
geth --rpc --rpcaddr <ip> --rpcport <portnumber>
And set my IP to the web3 object :
var Web3 = require('web3'); var web3 = new Web3(); web3.setProvider(new Web3.providers.HttpProvider('http://220.127.116.11:8545')); web3.eth.syncing
But now I have another problem. I have this error :
ValueError: No JSON object could be decoded
I'm watching the network with Charles and I can see this :
415 Unsupported Media Type Supplied content type is not allowed. Content-Type: application/json is required
Of course the content-type sent is
How can I change the content type with this Ethererum rpc client ?