install required libraries
npm install -g truffle
npm install -g web3
got at the root of the project and run the command
truffle compile
in the meantime, start ganache then migrate the smart-contract to the desired network, edit the configuration in the truffle-config.js
truffle migrate --network development
run tests if needed
truffle test
setup first the .env file with the sender and contract address then run the command
- Change directory
cd studentNumberContract/app
- Run the command
npm run start
setup first the .env file with the sender and contract address then run the command
- Change directory
cd pubSubContract/app
- Run the command in 3 distinct terminals
1. node broker.js # listen to the blockain and start a socket server
2. node publisher.js # publish a message to the blockchain
3. node subscriber.js # subscribe to the broker via the smart-contract
Before launching any project, use npm install
to get all dependecies required to run the applications