Skip to content

schummd/credchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c3d2dfe · Nov 6, 2022

History

27 Commits
Nov 6, 2022
Sep 15, 2022
Nov 6, 2022
Nov 1, 2022
Nov 6, 2022
Nov 6, 2022
Nov 6, 2022
Sep 15, 2022
Sep 18, 2022
Oct 30, 2022
Sep 23, 2022
Sep 23, 2022
Nov 6, 2022
Nov 6, 2022
Nov 6, 2022
Nov 6, 2022

Repository files navigation

CredChain

The project consists of mainly two parts at the moment: backend including smart contracts and frontend including sample React app.

How to Run

First, we need to compile and deploy smart contracts to the testnet. To do this, make sure Hardhat is installed on your environment or install using npm install --save-dev hardhat command. Once installed we can deploy contracts.

To deploy, start the hardhat node with npx hardhat node.

Open another terminal window and deploy the contracts using npx hardhat run --network localhost scripts/deploy.js command.

Once the contracts deployed you can see the contract address in the node terminal (e.g., 0x5fbdb2315678afecb367f032d93f642f64180aa3).

Since we are deploying few contracts, each one of them will have different address. Right now the deploy.js file contains all the deployment scripts that will be needed, but part of it is commented out so the only contract that is being deployed right now is DID Registry.

Now we can start the frontend app. To do this call the npm start from the frontend directory. The main logic is in /scr/App.js file and contains a simple app that interacts with deployed DID registry.

To make sure the frontend can access the deployed contracts, for each contract we need to compiled file to the /scr/utils directory. At the moment the only compiled contract is represented by DID.json.

For each deployed contract we also need to add contract ABI and its address in /src/utils/constants.js file. Follow the same pattern as for DID Registry.

Hardhat Commands

npx hardhat help
npx hardhat test
GAS_REPORT=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js

References

Code Base

  • The original CredChain code based was developed by Yue Liu. This is the updated CredChain version to latest Solidity (^0.8.0), utilises new deployment and testing framework (Hardhat and Truffle), includes frontend application and new features (revocation mechanism).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published