Demonstrating a frontend connected to the priveos smart contract and node services to upload, list and download files based on transactions.
You can switch between localhost and jungle2 (default). To connect to localhost, append url param: ?env=localhost
or set localStorage item:
localStorage.setItem('env', 'localhost')
To be able connecting to localhost, you need to have the following processes running:
- EOS node with privEOS smart contract
- IPFS node
- MongoDB (only if mongodb plugin is used by EOS)
Ensure you have the following global bash utilities installed:
- jq (for deployment to ipfs only, see
bin
folder) - webpack
- yarn or npm
The webpack production build does not work with node version > 8.9.0
!
yarn
or
npm install
To create an optimized production build, run:
cd frontend
yarn build
To start the local development frontend, run:
cd frontend
yarn start
It will then start a local development server with live reload. The default configuration does connect to jungle2
testnet, so no full node required but you apparently you need to have ipfs running to up- and download files:
ipfs daemon
If you do not have ipfs installed, see this section:
brew install ipfs
ipfs init
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
brew services start ipfs
Start an ipfs daemon. Then run:
bin/deploy-to-ipfs