This is the backend service for the Sui RWA Provenance Platform, responsible for indexing on-chain data, providing APIs for the frontend, and handling cross-chain communication via Wormhole.
- Indexing Service: Listens for events emitted by SRPP smart contracts and indexes them in a PostgreSQL database
- RESTful API: Provides endpoints for querying item data, provenance history, and manufacturer information
- Wormhole Integration: Processes cross-chain events via Wormhole VAAs
- Swagger Documentation: Auto-generated API documentation
- Node.js (v16+)
- PostgreSQL
- Sui Full Node access
- Clone the repository
- Install dependencies:
npm install - Configure environment variables in
.envfile - Start the application:
npm run start:dev
| Variable | Description | Default |
|---|---|---|
| DB_TYPE | Database type | postgres |
| DB_HOST | Database host | localhost |
| DB_PORT | Database port | 5432 |
| DB_USERNAME | Database username | postgres |
| DB_PASSWORD | Database password | postgres |
| DB_DATABASE | Database name | srpp |
| SUI_RPC_URL | Sui RPC URL | https://fullnode.testnet.sui.io:443 |
| SUI_PACKAGE_ID | SRPP package ID on Sui | |
| PORT | Server port | 3000 |
The API documentation is available at /api when the server is running.
GET /items- Get all items with pagination and filteringGET /items/types- Get all item typesGET /items/:id- Get item by IDGET /items/by-item-id/:itemId- Get item by item ID (e.g., serial number)GET /items/:id/history- Get item provenance historyGET /items/manufacturer/:address- Get items by manufacturer
GET /manufacturers- Get all manufacturers with paginationGET /manufacturers/search- Search manufacturersGET /manufacturers/:address- Get manufacturer by addressPUT /manufacturers/:address- Update manufacturer information
POST /wormhole/process-vaa- Process a Wormhole VAAGET /wormhole/unprocessed- Get all unprocessed cross-chain eventsPOST /wormhole/:id/mark-processed- Mark a cross-chain event as processed
npm run test
npm run build
This project is licensed under the MIT License.