0

I'm trying to interact with this contract using geth: https://etherscan.io/address/0xA33c4A314fAA9684eefFA6ba334688001Ea99bBC#code

From MEW I can call the function whatRound() and get current results.

But from geth I always get 0 back so it looks like I'm not connecting to the contract or something.

This is what I'm doing:

>var phoenixContract = eth.contract(< ABI >).at('0xA33c4A314fAA9684eefFA6ba334688001Ea99bBC');    
>phoenixContract.whatRound();    
>[0, 0, 0, 0]

Why isn't this returning the actual values from the contract?

0

Functions with the view attribute are not queried through the blockchain. The transaction is only sent to your local node and your local node returns you whatever it thinks is the current state. If your node is not up-to-date you might get whatever back.

So my guess is that your geth is not fully synced.

  • Thanks Lauri. Does it sync when you open in console mode? I left the console open over night and still nothing. – Lionel Orellana Apr 8 '18 at 21:23
  • Depends really on your settings. But I'm not an expert in geth in any case, and you should ask for details in some geth forums (or just read the manul) – Lauri Peltonen Apr 9 '18 at 5:34

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.