The API implemented for this project serves as a wrapper to the SmartContract, and facilitates the integration with Front-End applications. The API here mentioned was implemented in Node.js, as an integration of a Next.js project.

Below, see the description of the API endpoints.

All the following endpoints require previous authentication via JWT token.

All the following endpoints can only be called by the user that has the wallet Public Address the same as the owner of the contract.

How to run

To run the API, the user must have installed Node.js and must download the project from the GitHub repo. After that, navigate to the frontend folder of the project. The following .env file must be created in the root of the frontend folder.

BLOCKCHAIN_NETWORK_URL=http://localhost:8545
BLOCKCHAIN_CHAIN_ID=31337
BLOCKCHAIN_PRIVATE_KEY="PRIVATE KEY OF THE HARDHAT ACCOUNT INDEX ZERO"
BLOCKCHAIN_CONTRACT_ADDRESS="ADDRESS OF THE CONTRACT DEPLOYED IN LOCALHOST"
BLOCKCHAIN_OWNER_ADDRESS="ADDRESS OF THE HARDHAT ACCOUNT INDEX ZERO"
BLOCKCHAIN_START_AMOUNT=100