I have a contract. I store data in ethereum using contract. Is it possible, to work with contract in git-like way. For example, i have a list of previous transaction hashes. Can i fetch data from any specific transaction using web3j for example?
Asked
Active
Viewed 858 times
1
-
1yes, but what is the specific question ? obtain data from transaction or specific value from one contract? – Gawey Jul 28 '17 at 09:47
-
1Gawey, obtain data from specific transaction. I can not add a comment unfortunately. It was me, who asked the question – Ilya Khudyakov Jul 28 '17 at 09:56
-
1Moderator deleted comment conversation. Hey! I can not comment to the first post! But anyways, Gawey, Thank you so much for your answers and links :) – Ilya Khudyakov Jul 28 '17 at 10:59
2 Answers
2
BTW, how i did it using web3j:
Dto dto = new Dto();
Observable<EthTransaction> observable = getWeb3().ethGetTransactionByHash(transactionHash).observable();
observable.subscribe(ethTransaction -> ethTransaction.getTransaction().ifPresent(dto::setTransaction));
return dto.getTransaction();
So, here is transaction with specific tx hash. Then simply getInput() to get data from transaction
Ilya Khudyakov
- 201
- 2
- 6
1
QuickBlocks (http://quickblocks.io) provides a number of command line tools that you might find interesting. You can do this from the command line for example:
getBlock 4100010
and it will print that block to the console. Or,
getTransaciton 0xhashhash
and it will print that transaction to the screen. Other tools include getTrace, getReciept, getBloom, isContract, whenBlock, among others. It's also a C++ programming library, so you can write code against it.
Public service announcement: I work for QuickBlocks.
Thomas Jay Rush
- 9,943
- 4
- 31
- 72