The following project contains the smart contracts used for the SOFIE foodchain pilot.
To install the necessary node packages execute:
npm installTo compile the smart contracts, execute:
npm run compileTo run the smart contract unit test(s), execute:
npm run testTo run a development blockhain via ganache-cli and deploy the smart contracts,
in one terminal window, execute:
npm run dev-blockchainIn the other terminal, run:
npm run deploy-localYou should see a summary as output containing information about the deployment.
Staging settings are define in truffle-config.js file in object networks.staging.
If the node is locked, unlock it and deploy by running:
ACCOUNT_PASSWORD=<password> npm run deploy-stagingwhere <password> is the account password of the node
You can build a docker image to use to deploy the contract. To build the image run:
docker build -t fsc-consortium-smart-contracts-deployer .Afterwards, you can use it to deploy contracts and extract the smart
contract addresses. Please see Dockerfile for more details.