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 ?


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.

| improve this answer | |
  • Where should I " press info " how can I see the contents of info in console or in UI ? – Ayush Aggarwal Jul 24 '16 at 10:28
  • In the console. But you can also use a block explorer like etherchain.org. – Physes Jul 28 '16 at 18:48

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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