1

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?

3
  • 1
    yes, but what is the specific question ? obtain data from transaction or specific value from one contract?
    – Gawey
    Jul 28, 2017 at 9:47
  • 1
    Gawey, obtain data from specific transaction. I can not add a comment unfortunately. It was me, who asked the question Jul 28, 2017 at 9:56
  • 1
    Moderator deleted comment conversation. Hey! I can not comment to the first post! But anyways, Gawey, Thank you so much for your answers and links :) Jul 28, 2017 at 10:59

2 Answers 2

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

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.

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.