This repository contains the implementation of an architecture specifically designed to handle Honey NFTs, which serve as digital assets representing a batch of honey throughout its journey from the association to its final destination.
Before launching the web application, ensure that Node JS is installed on your system. Additionally, if you intend to run the dapp from the association's perspective, it is essential to supply a valid Infura IPFS API key. You can specify this key within the static/contracts/const.json file.
Warning It is essential to understand that in the current implementation, both the buyers and the association must be aware of the same address of the Main smart contract in order to interact correctly. To ensure smooth communication, the Association, upon deploying the Main smart contract, is responsible for distributing the web application package that includes the accurate address of the Main smart contract stored inside the static/contracts/const.json file.
To follow the workflow for running this application, please follow the steps outlined below:
- The association deploys the Main smart contract according to the instructions provided below.
- The association then distributes the web application package to the buyers, ensuring that it contains the correct address of the Main smart contract.
By following these steps, all buyers will have access to and interact with the same instance of the Main smart contract, facilitating a seamless and consistent user experience.
If you are the association and want to get started with this web application, follow the steps below:
- Clone this repository to your local machine and navigate to the project directory and install the necessary dependencies by running:
cd BlockchainProject
npm install
- Configure the
ENV.json
file based on the provided template in ENV.json.sample. Ensure that you provide valid API keys for the Infura IPFS provider. - Deploy the Main smart contract by running
truffle migrate --reset
or by simply running.npm run build
NOTE: If you want to specify a custom network for the deployment you can edit truffle-config.js
- Once the project is properly set up, start the web app by running:
npm run start
- You can now access the web app locally by opening your browser and visiting localhost:3000.
If you are a buyer and want to get started with this web application, follow the steps below:
- Clone this repository to your local machine and navigate to the project directory and install the necessary dependencies by running:
cd BlockchainProject
npm install
- Start the web app by running:
npm start
- You can now access the web app locally by opening your browser and visiting localhost:3000.
To execute the unit tests for the smart contracts, you can utilize the following command:
npm run test
By running this command, the test suite will be initiated, allowing you to verify the functionality and integrity of the smart contracts. Please ensure that all dependencies are properly installed before running the tests.