4

Once a transaction is completed on Ethereum Wallet then we can see the address of the transaction in our geth console : [ Tx("{txn address}") to: "{contract_address}" ]before mining starts. Pic attached for reference.

enter image description here

How can I capture that address and the address of contract which is shown just along transaction address in any format possible so that I can show the transaction address in UI ?

2 Answers 2

3

First copy and assign the transaction hash to a variable like so:

var tx = "0x123456789abcdef"

Then get the transaction recept(assigned to variable info).

var info = web3.eth.getTransactionReceipt(tx);

Press info to display the full info of the transaction, including the transaction addresses.

2
  • Where should I " press info " how can I see the contents of info in console or in UI ? Jul 24, 2016 at 10:28
  • In the console. But you can also use a block explorer like etherchain.org.
    – Physes
    Jul 28, 2016 at 18:48
1

You can get the transactions in each block using web3.eth.getblock(blocknumber). To know about the contract address using the transaction hash, you can use web3.eth.getTransactionReceipt(Transaction_Hash). You can display all these details on UI using web3 API and JSON-RPC.

Your Answer

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

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