1

I am coming across a problem where. I ask for the transaction Receipt but get not found in return. what I am trying to do is establish the created contract address, and obtain the receipt to see the contract address. For example: In Geth when I throw this command at it. I get null.

eth.getTransactionReceipt("0x9ecc9482e5ce1616b6a71ea6b7434d53418836c53a1176b27873c7f7190fc599")
null

on etherscan you can see clearly there is a contract address and other information. Is there a proven method to retrieve receipts, or do these receipts disappear over time. if that's the case. what method is used to discover contract addresses?

1
  • 1
    Are you connected to the right network?
    – 0xsegfault
    Commented Aug 24, 2021 at 21:18

1 Answer 1

1

You first need the actual Transaction from the transaction hash you have, then you can get your receipt. I often use WaitMined() (import "github.com/ethereum/go-ethereum/accounts/abi/bind", which awaits the transaction to get mined.

so first tx, isPending, err := eth.TransactionByHash(context.Background(), txHash) and then receipt, err := bind.WaitMined(context.Background(), dialedClient, tx).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.