API example for CED.
Clone the project
git clone https://github.com/Kerala-Blockchain-Academy/ced-dapp-api.git
cd ced-dapp-api
Install dependencies
npm install
Create a '.env' and add the following variables
CHAIN=sepolia
API_KEY=<your-alchemy-api-key>
PRIVATE_KEY=<your-ethereum-private-key>
Deploy the contract
npm run deploy:sepolia
Start the application
npm run dev
Issue a certificate (new terminal)
curl -X POST http://localhost:8080/issue -H "Content-Type: application/json" -d '{"id": 9, "name": "Langley", "course": "9th Agency", "grade": "S", "date": "N.F. 79"}'
Fetch a certificate
curl http://localhost:8080/fetch?id=9