Quickstart
Publish On-Chain with Reclaim on Diamante
Pre-requisite
At this stage, we assume that you are familiar with the steps at ReactJs.
We'll guide you through setting up your environment, deploying the smart contract, and running the frontend application.
To follow this guide, ensure you have the following:
- Diamante Wallet installed and configured.
- Familiarity with ReactJS for frontend interaction.
- Access to the Diamante Faucet for testnet tokens.
Setting Up Your Wallet
- Install Diamante Wallet: Download and install the wallet extension from the provided link.
- Switch to Diamante Testnet:
- Open wallet settings.
- Navigate to "Networks".
- Select "Diamante Testnet".
- Fund Your Wallet: Obtain testnet tokens from the Diamante Faucet.
Accessing the Code
Clone the repository for the Starterpack:
- Reclaim Diamante Example: GitLab Link
Project Overview
This project demonstrates how to verify proofs using the Reclaim Protocol and register them on the Diamante blockchain. The process involves:
- Generating proof requests using the Reclaim SDK.
- Submitting verified proof data to the Diamante blockchain for immutable storage.
Workflow Summary
- Proof Verification:
- Perform verification using the Reclaim infrastructure.
- Handle computationally intensive tasks off-chain.
- On-Chain Proof Registration:
- Record essential proof data (identifier and status) on Diamante’s Account Storage Layer.
- Verification Query:
- Query proof status on-chain and cross-reference with off-chain records for full verification.
Steps to Run the Project
Start the Backend Server
The backend will run on http://localhost:3001
.
Start the Frontend
Access the app at http://localhost:5173
.
Using the Application
- Connect Wallet:
- Open the app.
- Use the "Connect Wallet" button to link your Diamante Wallet.
- Generate Proof Request:
- Click "Create Claim" to generate a proof request.
- Scan the displayed QR code with the Reclaim app to start verification.
- Submit Proof:
- Once the proof is verified, the app will display a "Verify Proof" button.
- Click the button to submit the proof to the Diamante blockchain.
- Check Transaction:
- After submission, a link to the Diamante Testnet Explorer will appear.
- Use it to view transaction details.
Technical Details
Frontend
App.jsx
- Integrates Reclaim SDK to handle proof requests and verification.
- Connects to Diamante Wallet for submitting transactions.
- Fill in your Reclaim credentials marked with //TODOs.
src/utils/submitTransaction.js
- Handles proof submission to the backend.
- Manages wallet connection and transaction signing.
Backend
index.js
- Exposes APIs for creating and submitting transactions to the Diamante blockchain.
- Uses Diamante SDK for interacting with the blockchain.
Notes
- Replace placeholder
APP_ID
,APP_SECRET
, andPROVIDER_ID
inApp.jsx
with valid Reclaim credentials. - Ensure your wallet is connected to the Diamante Testnet before proceeding.