yep / eth-tweet

Decentralized Twitter: A microblogging service running on the Ethereum blockchain
http://ethertweet.net
GNU General Public License v3.0
578 stars 91 forks source link

Error: new BigNumber() not a base 16 number: #4

Closed jikkujose closed 8 years ago

jikkujose commented 8 years ago

I tried the following as per the Readme:

  1. Installed Ethereum (in AWS micro instance having Ubuntu)
  2. Created an account via: geth account new
  3. Ran geth
  4. In a separate shell I ran geth attach to get interactive shell with the prompt: >
  5. Then I followed the following commands
var TweetAccount = web3.eth.contract([{"constant":true,"inputs":[],"name":"getOwnerAddress","outputs":[{"name":"adminAddress","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"adminDeleteAccount","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"}],"name":"adminRetrieveDonations","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getLatestTweet","outputs":[{"name":"tweetString","type":"string"},{"name":"timestamp","type":"uint256"},{"name":"numberOfTweets","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"isAdmin","outputs":[{"name":"isAdmin","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"tweetId","type":"uint256"}],"name":"getTweet","outputs":[{"name":"tweetString","type":"string"},{"name":"timestamp","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"getNumberOfTweets","outputs":[{"name":"numberOfTweets","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"tweetString","type":"string"}],"name":"tweet","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"inputs":[],"type":"constructor"}]).at("0x9e82d1745c6c9c04a6cfcde102837cf0f25efc56"); TweetAccount

> TweetAccount.getLatestTweet()
new BigNumber() not a base 16 number:
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at <unknown>
    at getLatestTweet (<anonymous>:-109371:-30)

But I didn't get any tweets; any help?

yep commented 8 years ago

Strange. This is what the output of the exact same commands looks for me (first line is not shown completely):

> {:"result","type":"int256"}],"type":"function"},{"inputs":[],"type":"constructor"}]).at("0x9e82d1745c6c9c04a6cfcde102837cf0f25efc56"); TweetAccount
{
  address: "0x9e82d1745c6c9c04a6cfcde102837cf0f25efc56",
  adminDeleteAccount: function(),
  adminRetrieveDonations: function(),
  allEvents: function(),
  getLatestTweet: function(),
  getNumberOfTweets: function(),
  getOwnerAddress: function(),
  getTweet: function(),
  isAdmin: function(),
  tweet: function()
}
> 
> TweetAccount.getLatestTweet()
["hello world", 1449750863, 1]
>

What geth version are you using, maybe it's old? Get version by running geth version. This the output for me:

Version: 1.3.3
Protocol Versions: [63 62 61]
Network Id: 1
jikkujose commented 8 years ago

Tried again, same output :(. I did geth version and got this:

Geth
Version: 1.3.3
Protocol Versions: [63 62 61]
Network Id: 1
Go Version: go1.5.1
OS: linux
GOPATH=
GOROOT=/usr/lib/go
yep commented 8 years ago

As I can not reproduce the problem locally, could you please provide additional information so I could try to reproduce this on AWS if I find the time for it? Helpful would be: what AWS AMI are you using? Did you install geth from source and how? Is the problem reproducible? That is, if you create a new AWS VM and repeat the steps you did, does the problem occur again? Same error message as in this web3 isssue. Thanks.

jikkujose commented 8 years ago

Seems it was my issue; I was able to have it run in a Ubuntu machine & Mac locally.

yep commented 8 years ago

Glad to hear it's working now!

5chdn commented 8 years ago

Google just sent me here. FYI, This error message appears if the blockchain is not fully synced yet. This also explains the differences in comment 1 and 2.