0

I use this command to get data from eth network, but get null return enter image description here


The command is

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' localhost:8545 -H 'content-type: application/json'

The output is

{"jsonrpc":"2.0","id":83,"result":"0x0"}

4
  • 1
    Can you post the code here (in text), I can't access the image from where I am. Commented Apr 3, 2018 at 6:29
  • You said you get a "null" result, but you don't. You get a JSON response with the correct ID and the result 0. I assume that this is because the current block number on the node you're connecting to is 0.
    – user19510
    Commented Apr 3, 2018 at 6:32
  • curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' localhost:8545 -H 'content-type: application/json' and the output is {"jsonrpc":"2.0","id":83,"result":"0x0"} I have downloaded all the blocks, the result should not be 0 Commented Apr 3, 2018 at 6:35
  • Is your node fully synced? A node syncing in fast mode will not return meaningful data until it has finished (ethereum.stackexchange.com/questions/24667/…).
    – Ismael
    Commented Apr 4, 2018 at 4:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.