0

Connecting to the Testnet Rinkeby:

$ geth --rinkeby --syncmode fast console

trying to Retrieving Transaction data with the following:

eth.getTransaction(eth.getBlock(183000).transactions[0])

I've got the following error message:

Error: invalid argument 0: json: cannot unmarshal non-string into Go value

of type common.Hash

at web3.js:3143:20

at web3.js:6347:15

at web3.js:5081:36

at :1:1

I’ve tried changing Block Number but I got the same error. I’ve tried to exit the console and reboot and I got the same error.

Community
  • 1
  • 1
naszam
  • 11
  • 2

3 Answers3

1

Solved!

In Block n. 183000 there aren't transactions:

eth.getBlock(183000)

{ difficulty: 2, extraData: "0xd783010600846765746887676f312e372e33856c696e75780000000000000000a2111cb9859380205306730539ac8c77dec1d0aa9aa9743a0773c731d300a19f1acad2c7ceb41ee3e603c636fc805c8b7f12a370136ed94bd84b03d3430aca6601", gasLimit: 4712388, gasUsed: 0, hash: "0xd793c4be0804f87d21d42c694e762c6cb6277ef1fcdbf20f67970f5f82e0d16b", logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", miner: "0x0000000000000000000000000000000000000000", mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000", nonce: "0x0000000000000000", number: 183000, parentHash: "0x2233532f7554029162c085888efd944009dd0fc86bdb97314dc0c1c2d37f58cf", receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", size: 609, stateRoot: "0x8425418849819297a2f8f8391f16445928a42f415362bd17cf9282e8bbff8093", timestamp: 1494755487, totalDifficulty: 357271, transactions: [], transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", uncles: [] }

I've found transactions at Block n. 188880.

Also, I'm waiting the full sync of the Testnet Rinkeby to check the Block n. 1830000.

Try to change block number and check if there are transactions in it.

eth.getTransaction(eth.getBlock(188880).transactions[0])

Should work ;)

naszam
  • 11
  • 2
0

same issue with eth.getTransaction(eth.getBlock("latest").transactions[1]) :'( maybe because of gasused is 0 !!

wafa
  • 1
0

Awesome! Thanks naszam :) It also worked with me at block number 299394

wafa
  • 1