A truffle dApp that creates ETH user profiles & stores profile data on IPFS
A decentralized application that creates profiles stored on the Ethereum blockchain using IPFS to house a user's data.
Download: (MetaMask)[https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en]
Ganache is used to local blockchain to interface with our smart contracts Download: (Ganache)[https://truffleframework.com/ganache]
Inter Planetary File Storage IPFS works similarly to the bittorent client in that it uses a content based lookup system instead of an address based on like HTTP. This enables users to request files stored on the network that are the closest to the client, vs at a predefined address. Theoretically if someone from Mars downloaded a movie from IPFS, the first load would take a day or so, but other Mars network users would then get the file from that local source, rather than having to re-download it from Earth!
npm install -g truffle
git clone https://github.com/SerKnight/face-block.git
cd face-block
npm install
This app will save a Faceblock entries data on IPFS and the user's ethereum address will store the address to fetch the correct data for the profiles.
In a new tab
brew install ipfs
ipfs init
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"*\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
ipfs daemon
npm run dev
8545
http://localhost:8081
-> ipfs will default to 8080, so webpack should increment this by 1 portMetamask
to Ganache
Metamask
chrome plugin from browserCustom RPC
http://localhost:8545
under Custom RPC & SaveLast things, then we can do stuff!
truffle compile
truffle migrate
- Open up the Transactions tab in the
Ganache
GUI, you should see some transactions from the Apps initialization.- Under
Ganache's
Accounts tab, show one of the pre-seeded account keys on the right, and copy it in clipboard.- Head over to
http://localhost:8081
and in theMetaMask
plugin, click the users icon, and at the bottom, Import Account- Reload the page, and your imported account address should be loaded in the Signup Eth Address input
- Paste into private key
- Enter all details to create a profile & hit Sign Up
Though the app does reload after success.. I didn't perfect the timing for when IPFS data is accessible and you may need to wait a few and reload manually for your user records to be loaded back in.
You now have a running application & the first FaceBlock profile! There is only ** one user ** allowed per private key so to add more profiles, swap your ETH account by repeating steps 2..6
If you run into any issues getting it running -> [email protected]
Test can be run using:
truffle test --development
If you start/stop ganache occasionally gets our of sync, and you may have to run
truffle migrate --reset
If you get failed transactions ex after importing lots of accounts / restarting Ganache, the console errors might say Nonce is off. (Documentation of issue)[https://github.com/MetaMask/metamask-extension/issues/1999] To fix You can do the following: * Change network id in ganache ui (settings) and restart
truffle migrate --reset
http://localhost:8545