By now i have developed few basic example apps to execute Ethereum contracts using truffle based web application in a private blockchain.
I have setup an IPFS node in my local. Able to upload files to IPFS and view on the IPFS gateway.
Now Looking for a sample code to connect my IPFS node from my truffle based web app and the perform add/view operations of documents from/to IPFS.
Here is what I am looking for
1. Believe have to install IPFS.js using npm
2. Start the IPFS daemon
3. Connect to my local IPFS Node
4. Modify the html interface to accept a file object
5. Invoke IPFS API to add the file in IPFS and get the hash
6. Store the hash in Ethereum blockchain
7. Change the html interface to accept the file specific hash value
8. Invoke IPFS API to get the file from IPFS based on the provided hash
Help is needed for steps 3, 5 and 8. If you could share a sample code to perform the same will be helpful.