Getting the transaction hash on function call

by m.willes   Last Updated May 22, 2019 18:28 PM

I am new to Solidity, Web3, and Ethereum. I am trying to build a web application through which users can upload a file to IPFS, then store the IPFS hash in the blockchain. I am using the React truffle box and the value is being stored via the SimpleStorage contract that's included with the box.

So essentially, the ideal scenario would be: User A uploads the file to IPFS and its hash is stored in the blockchain. User B can then access the file by typing the transaction hash and getting its storage value to check whether it's authentic or not.

The problem is that in order for User B to be able to check the file's authenticity, they need to have the transaction hash. Is there a way for a function to return the hash on function call? I can get it manually through Ganache, but that's just impractical.

The blockchain is very nice because it gives you the ability to permanently store data within it, but is there a way to check that data?

Thank you.

Related Questions

Updated December 13, 2017 04:28 AM

Updated April 14, 2018 10:28 AM

Updated September 11, 2018 08:28 AM

Updated January 06, 2019 09:28 AM

Updated August 29, 2018 21:28 PM