5

We are setting up something akin to a blockchain explorer, but our Eth fullnode seems to be missing transaction info for certain blocks.

For instance, I can query eth.getTransaction but eth.getTransactionReceipt returns null

> eth.getTransaction('0x03a05ea076149ae8cff6b0fbc9b1f29c6bf6b7ab04ded92080c54084688456dd') { blockHash: "0xfd3b78d9b56e9a911beda3ff488c28c9dd83a9ae4961ba676f852e316cffde89", blockNumber: 5035686, from: "0x0ce287cc90601a891e65efda7037f5682cb1ade6", gas: 210000, gasPrice: 40000000000, hash: "0x03a05ea076149ae8cff6b0fbc9b1f29c6bf6b7ab04ded92080c54084688456dd", input: "0x", nonce: 21, r: "0x464f05819d48288db06cac5ff21b49d02a1250df6c4ba1e20ecdb38c558e5b44", s: "0x1f48c4531a3807b987857b99639b51f54e3718b9f1d808d66ad765ee0f71aba0", to: "0xe4bad5a72c04d5473e932f54036376772378b83d", transactionIndex: 72, v: "0x26", value: 98082570000000016 }

eth.getTransactionReceipt('0x03a05ea076149ae8cff6b0fbc9b1f29c6bf6b7ab04ded92080c54084688456dd') null

Is there a reason why this would happen, and are there any solutions other than a full resync?

I do believe that the first time that I synced the blockchain I used --fast, so potentially it missed some txs, although this parameter is poorly documented.

relik
  • 287
  • 5
  • 15

2 Answers2

1

It looks like there's an issue with your node. The receipt is returned from Infura. I'd recommend resync without --fast.

truffle(liveI)> web3.eth.getTransactionReceipt('0x03a05ea076149ae8cff6b0fbc9b1f29c6bf6b7ab04ded92080c54084688456dd', (e, r) => console.log(r));
undefined
truffle(liveI)> { blockHash: '0xfd3b78d9b56e9a911beda3ff488c28c9dd83a9ae4961ba676f852e316cffde89',
  blockNumber: 5035686,
  contractAddress: null,
  cumulativeGasUsed: 2154783,
  from: '0x0ce287cc90601a891e65efda7037f5682cb1ade6',
  gasUsed: 21000,
  logs: [],
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: '0x1',
  to: '0xe4bad5a72c04d5473e932f54036376772378b83d',
  transactionHash: '0x03a05ea076149ae8cff6b0fbc9b1f29c6bf6b7ab04ded92080c54084688456dd',
  transactionIndex: 72 }
Adam Kipnis
  • 10,175
  • 10
  • 35
  • 48
  • how do you access an Infura node? I'd like to be able to test my node against others. Is it free? – relik Apr 24 '18 at 18:52
  • Yes, it's free. You just need to create an API key through their site (infuria.io). They're not the only ones, but they're one of the more popular (it's the node farm behind MetaMask). Both Truffle and Infura have documentation on how to access it. – Adam Kipnis Apr 24 '18 at 18:57
  • Note that there are limitations on what web3 APIs are available due to load concerns (ie, filters). – Adam Kipnis Apr 24 '18 at 18:58
1

if you get null, then firstly do miner.start() and then after few blocks are mined, stop mining and then try getting the transactionReceipt.

FYI: It worked for me.

Abhi Agarwal
  • 156
  • 1
  • 4