Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.61 KB

README.md

File metadata and controls

85 lines (67 loc) · 2.61 KB

Supporting Business Confidentiality in Coopetitive Scenarios: the B-CONFIDENT Approach in Blockchain-based Supply Chains

This repository contains the actual version of the B-CONFIDENT approach applied to the case study of the paper.

In the following guide, we are going to describe the necessary steps and instructions to run the B-CONFIDENT system applied to the case study of the paper.

How to run the B-CONFIDENT system

Requirements

Usage

Once requirements have been installed, clone the git repository.

Once the code has been fetched, the following must be executed to run the Web Application:

  1. Change the current directory to the root project folder:
cd BinTraWine
  1. Add the .env file with the following variables:
DATABASE_URL="postgresql://postgres:test1234@postgres/postgresbtw?schema=public"
SERVER_IP=149.132.178.150
NEXTAUTH_URL=http://149.132.178.150:3000
NEXTAUTH_SECRET=YRjU8nuKMtrm4JobvXs035ET6TYctOivoFGbbfPcWtc=
NEXTAUTH_JWT_SECRET=YRjU8nuKMtrm4JobvXs035ET6TYctOivoFGbbfPcWtc=
NODE_IP=149.132.178.150
NODE_PORT=22006
OUTSIDEPORT=3000
POSTGRESQL_PASS=test1234

Change the IP of the server specified in SERVER_IP, NEXTAUTH_URL and NODE_PORT by setting the IP of the server where the application is deployed. Specify also another port in NEXTAUTH_URL and OUTSIDEPORT, if the 3000 is already occupied.

Copy the same .env file in the bintrawine-next folder.

  1. Change the current directory to bintrawine-next
cd bintrawine-next
  1. Install node modules using pnpm or npm:
pnpm install
  1. Generate prisma client:
npx prisma generate
  1. Prepare the build using pnpm or npm:
pnpm build
  1. Change the current directory to the root one:
cd ..
  1. Run docker containers in detach mode to run them in background:
docker-compose up -d

Once containers are running, wait a minute to perform the next action beacause quorum nodes must be initialized.

  1. Deploy smart contracts on the Blockchain:
npm run migrate

or

pnpm migrate

If the previous command is executed too early, an error will appear on console. Try to re-execute the command again until the deploy run correctly.

  1. The last important step is to check if contract addresses just deployed are correct in the following file:
/bintrawine-next/src/server/api/routers/blockChain/filiera/contracts.ts

If the addresses are not correct, change them with the correct ones.