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"}

  • 1
    Can you post the code here (in text), I can't access the image from where I am. – Florian Castelain Apr 3 '18 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. – smarx Apr 3 '18 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 – Denver Jacob Apr 3 '18 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 Apr 4 '18 at 4:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.