The following project contains the smart contracts used for the SOFIE foodchain pilot.
To install the necessary node packages execute:
npm install
To compile the smart contracts, execute:
npm run compile
To run the smart contract unit test(s), execute:
npm run test
To run a development blockhain via ganache-cli
and deploy the smart contracts,
in one terminal window, execute:
npm run dev-blockchain
In the other terminal, run:
npm run deploy-local
You 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-staging
where <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.