wanchain / wanchain-ipfs

Simple dApp UI that stores an IPFS file hash within a Wanchain Smart Contract. This dApp allows you to update and retreive the file hash from the smart contract.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wanchain + IPFS React dApp


Click Here to View Live Demo

Clone the Repository

git clone https://github.com/wanchain/wanchain-ipfs.git

cd wanchain-ipfs

npm install

npm run start

Open http://localhost:3000/

Demo Video

Click Here To Watch

The Wan Smart Contract

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

Contract Code

//deployed using remix

contract Contract {
 string ipfsHash;

 function sendHash(string x) public {
   ipfsHash = x;
 }

 function getHash() public view returns (string x) {
   return ipfsHash;
 }
}

1. Deploy Your Smart Contract using Remix

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

License

CC0

Credits

This repo was originally cloned from https://github.com/mcchan1/eth-ipfs and modified

About

Simple dApp UI that stores an IPFS file hash within a Wanchain Smart Contract. This dApp allows you to update and retreive the file hash from the smart contract.

License:Creative Commons Zero v1.0 Universal


Languages

Language:JavaScript 73.1%Language:CSS 17.3%Language:HTML 9.5%