Closed wemeetagain closed 9 years ago
OK, so I installed go-ethereum
following Option 1 here for OS X, and I've got mist
running with mist -rpc=true -upnp=true
, but having difficulties from there.
First off, mist
doesn't seem to be going very far past block 0: http://pastebin.com/iHSDHWf5
ethereum -rpc=true -upnp=true
doesn't seem to be doing much better: http://pastebin.com/R3d1deM0
I tried querying either ethereum
or mist
via JSON-RPC (via cURL) and that doesn't work (but maybe something here is wrong):
-> % curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"EthereumApi.GetStorageAt","params":[{"address": "blah", "key": "foo"]}' -H 'content-type:text/plain;' http://127.0.0.1:8080
curl: (52) Empty reply from server
Checked out this PR and tried: curl -H 'HOST: ethereum.dns' http://127.0.0.1:8088/foo/bar
DNSChain gave output:
2014-11-25T00:47:14.202Z - debug: [HTTP] request (<callback> http.coffee:47)
{ path: 'foo/bar', url: '/foo/bar' }
2014-11-25T00:47:14.209Z - debug: [ETH] eth resolve (<resolve> eth.coffee:36)
{ path: 'foo/bar' }
And curl just hung there.
Err, that might have been, not sure, because go-ethereum
crashed: http://pastebin.com/2aDTrMRU
Edit: nope, restarted and still observing that hang.
So it looks like there are two separate issues at play.
Due to Ethereum's inability to handle HTTP RPC requests, we currently open a raw TCP socket for RPC on initialization, https://github.com/WeMeetAgain/dnschain/blob/feature-ethereum/src/lib/eth.coffee#L27, and use that same open socket for the lifetime of the application.
This strategy fails when something breaks the socket (like ethereum crashing). Instead, we should open (and close) a new socket per RPC, to mirror what is done with the other chains.
Great job, the hang seems to be gone! :+1:
Looks like this is almost ready to merge. :smile:
Ethereum is still crashing though, so how do you recommend I test it?
Just a note: according to @WeMeetAgain this PR is on hold until Ethereum gets their client into a stable state and finishes some refactoring project.
@WeMeetAgain said:
lets close for now
Adds rudimentary support for Ethereum blockchain lookups. It currently assumes
ethereum
, the go client, is running, with JSON-RPC enabled. This is defaulted to port 8080 currently.Querying the Ethereum chain requires two parameters, the address, and key. Address is the contract address to look up, and key is the storage slot within the contract to query. These parameters are currently deduced by using the root element of the URL path as the address, and the rest as the key. ie: ethereum.dns/ADDRESS/KEY