This repository contains the web client application of CryptoCerts project, a decentralized academic certificate registry built on Ethereum.
This project is written in Solidity utilizing Ganache CLI, Truffle and IPFS, along with a React web client application with Redux and web3.js.
For the smart contracts repository see cryptocerts-contracts.
To use the packaged environment you will need Docker Desktop for your operating system. Please ensure Docker Compose is also available.
- Clone the contracts repository into a directory:
$ git clone git@github.com:lephleg/cryptocerts-contracts.git . - Clone the client repository in a subdirectory named
client:$ git clone git@github.com:lephleg/cryptocerts-client.git client - While remaining at the root directory, execute the following command to spin up the
ganache-cliandtrufflecontainers:$ docker-compose up -d - Install contract dependencies using
npmin thetrufflecontainer:$ docker exec -it truffle npm install --silent - In order to compile and deploy the contracts in Ganache use:
$ docker exec -it truffle truffle migrate - Write down the address of the newly deployed CryptoCerts contract found in the output of the previous command.
- Navigate to the
clientdirectory. - Make a copy of the
.env.exampleconfiguration file named.env.local:$ cp .env.example .env.local - Paste the address of the CryptoCerts contract as the value of the
REACT_APP_CRYPTOCERTS_CONTRACT_ADDRESSkey in.env.local. - While remaining in the
clientsubdirectory spin up thecryptocerts-clientapplication container along with theipfslocal node:$ docker-compose up -d - Configure IPFS CORS policy to allow connections from localhost and restart container to apply the new configuration:
$ docker exec -it ipfs ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' $ docker exec -it ipfs ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["GET", "POST"]' $ docker restart ipfs - Point your browser to http://localhost:3001 in order to access the web client application.
This repository was bootstrapped with Create React App.
Check the documentation here for all the available scripts, which are still accessible in the cryptocerts-client container in the project root directory.
In order to reset the IPFS files, stored from previous runs in your local IPFS node, use the following steps:
- Remove the
ipfscontainer:$ docker rm -f ipfs - Remove any files located in the
client/ipfsdirectory$ rm -rf client/ipfs - While being in client project root, recreate the container:
$ docker-compose up -d