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

Ismael
  • 30,570
  • 21
  • 53
  • 96
  • 1
    Can you post the code here (in text), I can't access the image from where I am. – Itération 122442 Apr 03 '18 at 06: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 Apr 03 '18 at 06:32
  • curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' http://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 03 '18 at 06:35
  • Is your node fully synced? A node syncing in fast mode will not return meaningful data until it has finished (https://ethereum.stackexchange.com/questions/24667/why-is-my-ether-balance-0-in-geth-even-though-the-sync-is-nearly-complete). – Ismael Apr 04 '18 at 04:52

0 Answers0