Click Here to View Live Demo
git clone https://github.com/wanchain/wanchain-ipfs.git
cd wanchain-ipfs
npm install
npm run start
Open http://localhost:3000/
This very simple smart contract is used to store a single IPFS file hash that can be retrieved by calling the contract.
My deployed contract address (Wanchain Testnet) is 0x4Ef0e1c84c937bc1cE35f9b63047881E41fa1076
//deployed using remix
contract Contract {
string ipfsHash;
function sendHash(string x) public {
ipfsHash = x;
}
function getHash() public view returns (string x) {
return ipfsHash;
}
}
Once you deploy your smart contract you will receive a contract address.
In storehash.js
on line 5 update the contract address to your new contract address.
If you made any edits to the contract, you will also need to update the contract ABI inside storehash.js
This repo was originally cloned from https://github.com/mcchan1/eth-ipfs and modified