ethereum / populus

The Ethereum development framework with the most cute animal pictures
http://populus.readthedocs.org/
321 stars 321 forks source link

Unable to use Ropsten #421

Closed Netherdrake closed 6 years ago

Netherdrake commented 6 years ago

What was wrong?

Suppose a fresh Greeter project as initiated by populus init. Suppose a running geth --testnet, with IPC at: ~/Library/Ethereum/testnet/geth.ipc Suppose a symlinked folder ~/Library/Ethereum/testnet to ~/Library/Ethereum/ropstenas suggested here

This will fail:

populus deploy -c ropsten Greeter

With:

  with project.get_chain(chain_name) as chain:
  File /Users/user/GitHub/tmp/populus/populus/chain/geth.py, line 131, in __enter__
    self.geth.wait_for_ipc(60)
  File /Users/user/anaconda/lib/python3.6/site-packages/geth/process.py, line 171, in wait_for_ipc
    _timeout.check()
  File /Users/user/anaconda/lib/python3.6/site-packages/geth/utils/timeout.py, line 57, in check
    raise self
geth.utils.timeout.Timeout: 60 seconds

I also tried modifying populus/chain/geth.py:

diff --git a/populus/utils/geth.py b/populus/utils/geth.py
index a07ac49..f637113 100644
--- a/populus/utils/geth.py
+++ b/populus/utils/geth.py
@@ -53,7 +53,7 @@ def get_geth_ipc_path(data_dir):
 @normpath
 def get_geth_default_datadir_path(testnet=False):
     if testnet:
-        testnet = ropsten
+        testnet = testnet
     else:
         testnet = 

Cute Animal Picture

lizard

veox commented 6 years ago

From issue #388, I assume you're running geth v1.7.3?..

veox commented 6 years ago

What does your project.json look like, if you have one?

Do you have anything in ~/.populus/?

Netherdrake commented 6 years ago

Yes, I'm on geth 1.7.3. There is no project.json. My ~/.populus has one file named config.json that contains {}.

veox commented 6 years ago

You may try to delete/move the ~/.populus directory, as Piper suggested on gitter, although I don't think this will help.

The diff you've posted also seems to miss some quotes - should be testnet = "testnet".

The error message - in particular, "line 131":

  File /Users/user/GitHub/tmp/populus/populus/chain/geth.py, line 131, in __enter__
    self.geth.wait_for_ipc(60)

suggests you're running a git version of Populus, and not strictly a 2.2.0 package from pip.


All that said, I'm able to reproduce the IPC timeout (on an Arch Linux machine, so not OSX-specific), for a Greeter project that's using populus==2.2.0.

However, doing a ln -s ~/.ethereum/testnet ~/.ethereum/ropsten helps get past that, and get a response from geth on its inability to get a deploying account (as expected: I haven't created one).

Netherdrake commented 6 years ago

It seems like the link hasn't worked out properly on mac, until I re-did it with absolute paths.

Now I'm running into another issue, which is that contracts are undeployable. For example on Greeter, I get:

 raise ValueError(response[error])
ValueError: {'code': -32000, 'message': 'insufficient funds for gas * price + value'}

Despite having more than 10 ETH on the from (etherbase) account. I run geth like so:

 geth --testnet --etherbase aaf3ffee9d4c976aa8d0cb1bb84c3c90ee6e9118 --unlock aaf3ffee9d4c976aa8d0cb1bb84c3c90ee6e9118 --password unlock.txt
veox commented 6 years ago

Do paste the full traceback. I've done my testing with a node in "light" mode, where etherbase is not supported via RPC/IPC.

Netherdrake commented 6 years ago
populus deploy -c ropsten Greeter
Beginning contract deployment.  Deploying 1 total contracts (1 Specified, 0 because of library dependencies).

Greeter
Deploying Greeter
Traceback (most recent call last):
  File "/Users/user/anaconda/bin/populus", line 11, in <module>
/Users/user/anaconda/lib/python3.6/site-packages/geth/mixins.py:105: DeprecationWarning: generator 'JoinableQueue.__iter__' raised StopIteration
  for line in self.stdout_queue:
/Users/user/anaconda/lib/python3.6/site-packages/geth/mixins.py:112: DeprecationWarning: generator 'JoinableQueue.__iter__' raised StopIteration
  for line in self.stderr_queue:
    load_entry_point('populus', 'console_scripts', 'populus')()
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/user/anaconda/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/user/GitHub/tmp/populus/populus/cli/deploy_cmd.py", line 43, in deploy_cmd
    deploy(project, logger, chain_name, wait_for_sync, contracts_to_deploy)
  File "/Users/user/GitHub/tmp/populus/populus/api/deploy.py", line 135, in deploy
    contract_name=contract_name,
  File "/Users/user/GitHub/tmp/populus/populus/utils/cli.py", line 164, in deploy_contract_and_verify
    kwargs=deploy_kwargs,
  File "/Users/user/anaconda/lib/python3.6/site-packages/web3/contract.py", line 311, in deploy
    txn_hash = cls.web3.eth.sendTransaction(deploy_transaction)
  File "/Users/user/anaconda/lib/python3.6/site-packages/web3/eth.py", line 221, in sendTransaction
    [transaction],
  File "/Users/user/anaconda/lib/python3.6/site-packages/web3/manager.py", line 96, in request_blocking
    raise ValueError(response["error"])
Netherdrake commented 6 years ago

Upon further digging, this seems to be an issue with geth configuration.

So, a TL:DR to anyone running into original issue: