Vehicle Management System using Hyperledger Fabric
- Blockchain: Hyperledger Fabric
- API: Typescript Express
- Frontend: React with MaterialUI
πΉ Hyperledger: fablo-config.json
and /fablo-target
that will be generated
- This is blockchain
πΉ Chaincodes: /chaincodes
- This is smart contracts that will be installed in blockchain
πΉ API: /zeus-middleware-api
- This is API that used to communicate in between Frontend and smart contracts inside blockchain
πΉ Frontend: /atena-frontend
- This is interface used to interact with blockchain
πΉ Mechanic-CLI: /mechanic-cli
- This is CLI to simulate a different system using blockchain (Not use API to run transactions)
πΉ Scripts: /scripts
- This is scripts used to populate base and run performance tests
- Docker and docker-compose
- +Python3.7
- Node 12.x and npm
-
Configure fablo enviroment
make configure-fablo
-
Generate the fablo-target with
./fablo generate
-
Edit file
fablo-target/fabric-config/configtx.yaml
inApplication: &ApplicationDefaults
(usectrl+f
to localize) and replace Policies->Endorsement->Rule toMAJORITY Endorsement
toANY Writers
In this section:
Policies:
...
Endorsement:
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"
Replace for this:
Endorsement:
Type: ImplicitMeta
Rule: "ANY Writers"
-
Run blockchain
./fablo up
, the chaincodes will be installed automatically -
To stop
./fablo down
-
To delete
fablo-target
run./fablo prune
-
For help:
./fablo help
-
For access Hyperledger Explorer, find the docker with name
explorer.example.com
and go to url, nomally ishttp://localhost:7010
and user isadmin
and password isadminpw
for all orgs
- Run
python build_env_files.py
βοΈ Notes:
- You need generate env files before run API
π³ Run in docker
-
Only run
make run-api-docker
and if can stopmake stop-api-docker
-
API will be exposed in port 3000
π» Run in machine
-
Entry is folder
cd zeus-middleware-api/
-
Run
npm i
to install dependencies -
Run
npm run dev
to start API in development mode -
API will be exposed in port 3000
βοΈ Notes:
- The
URL_BASE
configure in file/atena-frontend/src/shared/environment/index.ts
, default ishttps://localhost:3000
π³ Run in docker
-
Only run
make run-frontend-docker
and if can stopmake stop-frontend-docker
-
Frontend will be exposed in port 3006
π» Run in machine
-
Entry is folder
cd atena-frontend/
-
Run
yarn
to install dependencies -
Run
npm run start
to start frontend -
Frontend will be exposed in port 3006
βοΈ Notes:
- You need generate env files before run API
π» Run CLI
-
Entry is folder
cd mechanic-cli/
-
Run
npm i
to install dependencies -
To start run
npm run start
βοΈ Notes:
- You need generate env files before run API
π» Run Scripts CLI
-
Entry is folder
cd scripts/
-
Run
npm i
to install dependencies -
To start run
npm run start