Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Formatting improvements and grammar
Source Link
Achala Dissanayake
  • 5.2k
  • 14
  • 23
  • 38

I'm usingconnecting to a testnet onusing a Geth node whitrunning version 1.8.8-stable, I'mand also I'm using the lib web3j whitlib version 3.4.0.

I deployed a Smart Contract and I also used the web3j wrapper tools to interact whitwith the contract and everythings lookeverything looks like works..working.

What I want to do is to decode the information from the newnewly mined blocks, so. i subscrive to the new block.e. I subscribe and I'm able to retriveI can retrieve all transaction from the newnewly mined blocks. Now i

I know that a transaction is about my smartcontracts becousesmart-contracts because the "to" address is the same of the smartcontracts, butin smart-contracts. But how can iI recognize the functions that waswere called???

Sorry for my englishEnglish, I hope thtathat someone can help me. Here an example of the TransactionReceiptTransaction Receipt that i retriveI retrieve from a transaction hash. Is there any way to understand what function of the smart contract was called???

TransactionReceipt{ transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', transactionIndex='0x0', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', cumulativeGasUsed='0x9495', gasUsed='0x9495', contractAddress='null', root='0x3a175640d6654236151ffc9f9afbd9087a656b2b46ead9df5587725a77d3bd7a', status='null', from='0x145107ef476743eaabf8df07cefd47b17d87506c', to='0x70104c2d70145d745ee9308e0ee428e1d96e6142', logs=[Log{removed=false, logIndex='0x0', transactionIndex='0x0', transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', address='0x70104c2d70145d745ee9308e0ee428e1d96e6142', data='0x0000000000000000000000000000000000000000000000000000000000000064', type='null', topics=[0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, 0x000000000000000000000000145107ef476743eaabf8df07cefd47b17d87506c, 0x00000000000000000000000061259ec0cfc824e41b5ca2cc64f6453476b165b4]}], logsBloom='0x00000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000040000000000080020000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000'}

TransactionReceipt{ 

transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5',

transactionIndex='0x0',

blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198'

blockNumber='0x5e4cf' 

cumulativeGasUsed='0x9495', 

gasUsed='0x9495', 

contractAddress='null', 

root='0x3a175640d6654236151ffc9f9afbd9087a656b2b46ead9df5587725a77d3bd7a',

status='null', 

from='0x145107ef476743eaabf8df07cefd47b17d87506c',

to='0x70104c2d70145d745ee9308e0ee428e1d96e6142', 

logs=[Log{removed=false, logIndex='0x0', transactionIndex='0x0', transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', address='0x70104c2d70145d745ee9308e0ee428e1d96e6142', data='0x0000000000000000000000000000000000000000000000000000000000000064', type='null', topics=[0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, 0x000000000000000000000000145107ef476743eaabf8df07cefd47b17d87506c, 0x00000000000000000000000061259ec0cfc824e41b5ca2cc64f6453476b165b4]}],

logsBloom='0x00000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000040000000000080020000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000'
}

I'm using a testnet on a Geth node whit version 1.8.8-stable, I'm also using the lib web3j whit version 3.4.0.

I deployed a Smart Contract and I also used the web3j wrapper tools to interact whit the contract and everythings look like works...

What I want to do is to decode the information from the new mined blocks, so i subscrive to the new block and I'm able to retrive all transaction from the new mined blocks. Now i know that a transaction is about my smartcontracts becouse the "to" address is the same of the smartcontracts, but how can i recognize the functions that was called???

Sorry for my english, I hope thta someone can help me. Here an example of the TransactionReceipt that i retrive from a transaction hash. Is there any way to understand what function of the smart contract was called???

TransactionReceipt{ transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', transactionIndex='0x0', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', cumulativeGasUsed='0x9495', gasUsed='0x9495', contractAddress='null', root='0x3a175640d6654236151ffc9f9afbd9087a656b2b46ead9df5587725a77d3bd7a', status='null', from='0x145107ef476743eaabf8df07cefd47b17d87506c', to='0x70104c2d70145d745ee9308e0ee428e1d96e6142', logs=[Log{removed=false, logIndex='0x0', transactionIndex='0x0', transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', address='0x70104c2d70145d745ee9308e0ee428e1d96e6142', data='0x0000000000000000000000000000000000000000000000000000000000000064', type='null', topics=[0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, 0x000000000000000000000000145107ef476743eaabf8df07cefd47b17d87506c, 0x00000000000000000000000061259ec0cfc824e41b5ca2cc64f6453476b165b4]}], logsBloom='0x00000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000040000000000080020000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000'}

I'm connecting to a testnet using a Geth node running version 1.8.8-stable, and also I'm using the web3j lib version 3.4.0.

I deployed a Smart Contract and also used the web3j wrapper tools to interact with the contract and everything looks like working.

What I want to do is to decode the information from newly mined blocks. i.e. I subscribe and I can retrieve all transaction from the newly mined blocks.

I know that a transaction is about my smart-contracts because the "to" address is the same in smart-contracts. But how can I recognize the functions that were called???

Sorry for my English, I hope that someone can help me. Here an example of the Transaction Receipt that I retrieve from a transaction hash. Is there any way to understand what function of the smart contract was called???

TransactionReceipt{ 

transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5',

transactionIndex='0x0',

blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198'

blockNumber='0x5e4cf' 

cumulativeGasUsed='0x9495', 

gasUsed='0x9495', 

contractAddress='null', 

root='0x3a175640d6654236151ffc9f9afbd9087a656b2b46ead9df5587725a77d3bd7a',

status='null', 

from='0x145107ef476743eaabf8df07cefd47b17d87506c',

to='0x70104c2d70145d745ee9308e0ee428e1d96e6142', 

logs=[Log{removed=false, logIndex='0x0', transactionIndex='0x0', transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', address='0x70104c2d70145d745ee9308e0ee428e1d96e6142', data='0x0000000000000000000000000000000000000000000000000000000000000064', type='null', topics=[0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, 0x000000000000000000000000145107ef476743eaabf8df07cefd47b17d87506c, 0x00000000000000000000000061259ec0cfc824e41b5ca2cc64f6453476b165b4]}],

logsBloom='0x00000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000040000000000080020000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000'
}
Source Link

Web3j decode function from TransactionReceipt

I'm using a testnet on a Geth node whit version 1.8.8-stable, I'm also using the lib web3j whit version 3.4.0.

I deployed a Smart Contract and I also used the web3j wrapper tools to interact whit the contract and everythings look like works...

What I want to do is to decode the information from the new mined blocks, so i subscrive to the new block and I'm able to retrive all transaction from the new mined blocks. Now i know that a transaction is about my smartcontracts becouse the "to" address is the same of the smartcontracts, but how can i recognize the functions that was called???

Sorry for my english, I hope thta someone can help me. Here an example of the TransactionReceipt that i retrive from a transaction hash. Is there any way to understand what function of the smart contract was called???

TransactionReceipt{ transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', transactionIndex='0x0', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', cumulativeGasUsed='0x9495', gasUsed='0x9495', contractAddress='null', root='0x3a175640d6654236151ffc9f9afbd9087a656b2b46ead9df5587725a77d3bd7a', status='null', from='0x145107ef476743eaabf8df07cefd47b17d87506c', to='0x70104c2d70145d745ee9308e0ee428e1d96e6142', logs=[Log{removed=false, logIndex='0x0', transactionIndex='0x0', transactionHash='0x6583a913786bc0010937806c4a97e8fcac673b1cd9e25c79074df76ae235f4f5', blockHash='0x624ed9afc8a45c0b79a1c471fe732d00b813cc476f264e9ada0d3a15a7cf6198', blockNumber='0x5e4cf', address='0x70104c2d70145d745ee9308e0ee428e1d96e6142', data='0x0000000000000000000000000000000000000000000000000000000000000064', type='null', topics=[0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, 0x000000000000000000000000145107ef476743eaabf8df07cefd47b17d87506c, 0x00000000000000000000000061259ec0cfc824e41b5ca2cc64f6453476b165b4]}], logsBloom='0x00000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000040000000000080020000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000'}