This application allows users to prove existence of some information stored and represented by files (pictures, sound, text files etc), showing timestamped files with other useful information which can help determine the owner or files associated with an address. Web app allows for uploading new files from device or taking picture via photo camera. Such object is then send to the smart contract (save details about file) and IPFS for permanent storage.
This decentralized application consits of :
- Client (web app) which allows for adding new files to decentralized system but also for searching these files.
- Smart Contract which bahaves as a register for files and additional information about owner, time etc.
- IPFS which acts as a hard drive or database for files
- Tests which covers all the functionalities in smart contracts
- Ethereum blockchain (Ganache-cli, test networks)
- Solidity, Vyper
- Truffle, web3.js
- Chai, Mocha
- React, Rimble-ui
- Javascript,
- HTML5, CSS3
Make sure that your browser supports MetaMask or similar, recommended browsers: firefox, chrome, brave.
Make sure that you have truffle, ganache-cli and IPFS installed globally on your working environment.
IPFS and ganache-cli should work on 127.0.0.1
IP address, which is their default configuration.
I won't provide detailed instruction for it but you can easily find instructions or tutorials (like these below) on the internet.
https://truffleframework.com/docs/truffle/getting-started/installation
https://nethereum.readthedocs.io/en/latest/ethereum-and-clients/ganache-cli/
https://github.com/ipfs/go-ipfs#install
- Run ganache-cli in terminal or CLI to setup local & private blockchain, leave it running
- In another terminal, start your IPFS node, if you are well prepared command:
ipfs daemon
should be enough, leave it running (if you are facing problems with IPFS take a look at the troubleshooting section below, check documentation or contact me directly) - In another terminal, clone repo
- Enter the main folder and run command:
npm install
- Run
truffle compile
- Run
truffle migrate
- Run
truffle test
- Enter client folder with command :
cd client
- Run command:
npm install
- Run command:
npm start
- this will bring up PoE DApp
- if you are running Poe on your local setup remember to connect with MetaMask to correct rpc address specified for your network
- playing with the app requires some amount of test ether, keep that in mind
- default configuration assumes that every element of this application is working with its default setup like port or address, mostly 127.0.0.1
- you can configure IPFS node for PoE DApp, config is stored in client folder
- camera works only for secure origins (see: https://goo.gl/Y0ZkNV), with default configuration like localhost there is no issue
- there is a vyper contract which is PoE implementation without upgradeability feature
- make sure that you are connected with your MetaMask to the right network, make sure that you compiled contracts for the network specified
- it is possible (if you are doing it for the first time) that IPFS needs additional CORS configuration which can be handled with these two instructions run in terminal:
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
- application works with mobile browsers/wallets which are web3 enabled (i.e. imStatus), but you have to change configuration of the client and ipfs address to have full functionality. Such ipfs configuration might be useful but it is not recommended to use it on production environment:
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
- https://blog.trailofbits.com/2018/10/19/slither-a-solidity-static-analysis-framework/
- https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format
- https://github.com/ConsenSys/smart-contract-best-practices/blob/master/docs/recommendations.md
- https://consensys.github.io/smart-contract-best-practices/