Welcome to Digital Sharecropper github repo. To run the project follow the following commands.
First, clone the repo to your local system:
git clone https://github.com/Hasibul-Islam-Shanto/olympiad.git
-
Download fabric binary files script:
curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
-
Run script to download binaries
./install-fabric.sh docker binary
-
Give excution permission to all .sh files:
find . -type f -name "*.sh" -exec chmod +x {} \;
sudo usermod -aG docker user_name
sudo chmod -R 755 path-of-project/backend
** if all process above done once then no necessary to do it again **
- Stop the network:
sudo ./network.sh down
- Start test network:
sudo ./network.sh createChannel -ca -c syschannel -s couchdb
- Deploy Chanicode:
sudo ./network.sh deployCC -ccn sysChaincode -ccp ../dfarmer/chaincode/ -ccl javascript
(After completion of deploying chaincode)
-
Run express server: Open terminal on
backend/dfarmer/application
and then:npm i
node app.js
** If you kill the process or restart the network then, start form process 1. Before running node app.js
, delete files under wallet folder located in backend/dfarmer/application/wallet
-
Open a terminal on frontend directory and run:
npm install -g yarn
npm install -g json-server
yarn install
yarn dev
-
Open another terminal on frontend directory and run:
json-server --watch db.json --port 4000
For that, (to avoid postman)
-
Install a extension in VSCode named REST Client (id: humao.rest-client)
-
Then open api-test.rest file located in
/backend/dfarmer/application/api-test.rest
-
Now click the send requet option shown in the file. By this process admin and agent will be created.
Now, the system is ready to use. The website is running on localhost:3000 port
To check couchdb:
http://localhost:5984/_utils/
username: admin
pass: adminpw