1

I'm trying to deploy a contract but it seems like I'm going through a minefield...

When I try to deploy the contract I always get timeout error.

I wrote the contract on remix, and tried both remix compiler aswell as solcjs compiler, but to no avail.

Here is the relevant part of my code

from web3 import Web3, HTTPProvider
rpcc = Web3(HTTPProvider('myserver'))
rpcc.personal.unlockAccount(myaddress, 'password')
abi = json.load(open('mycontract.abi')) # [{"constant":true..."type":"event"}]
bytecode = open('mycontract.bin').read() # 60606040523...4406e0029
contract = rpcc.eth.contract(address=myaddress, abi=abi, bytecode=bytecode)
contract.deploy()

And I always get this error

requests.exceptions.ReadTimeout: HTTPConnectionPool(host='yourhost', port=80): Read timed out. (read timeout=10)

Even thought it was just slow, but I gave it 600s (10 minutes) timeout and still got the same error...

I searched all over the internet and got nothing useful

Any ideas?

  • Your connection looks a little unusual (esp. port 80). How did you start up Parity? Can you give the exact provider setup you used? Do other requests over the connection work, like using rpcc.eth.accounts or rpcc.eth.getBlock('latest')? – carver Feb 26 '18 at 18:15
  • 1
    @carver the "myserver" is only a placeholder, however I am running parity behind an nginx ProxyPass (to restrict IPs and do authentication). Parity is running and sync'd. All other calls are running smoothly, including eth.sendTransaction – DarkW Feb 26 '18 at 20:52
  • Can you reproduce the issue when connecting with HTTPProvider directly to the IP/port that parity opens? (ie~ without the proxy) – carver Feb 27 '18 at 20:57
0

On Parity 2.4, contract deployments time out if web3.eth.defaultAccount hasn't been unlocked. Check out docs for the web3.parity.unlockAccount API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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