An API service that routes incoming metadata requests to the appropriate blockchain where the token currently resides.
- Token location tracking across multiple Chromia chains
- Metadata format standardization
- Caching of token locations for improved performance
- RESTful API endpoints for metadata retrieval
- IPFS support
- Bun runtime installed
- Access to Chromia nodes (configuration required)
- Clone the repository
- Install dependencies:
bun install
- Set up environment variables (optional):
DATABASE_URL=your_database_url PORT=3000 IPFS_API=http://localhost:5001
Run the development server with hot reload:
docker compose up -d postgres ipfs
bun devRun everything in Docker:
docker compose up -d --buildGET /metadata/:standard/:project/:collection/:token_id
Parameters:
standard: The metadata standard (e.g., "erc721")project: Project identifiercollection: Collection identifiertoken_id: Token identifier
Response:
Token metadata as application/json in the requested standard.
GET /ipfs/:ipfs_uri
Parameters:
ipfs_uri: The IPFS URI of the token metadata
Response:
Supports both application/json and other mime types supported by IPFS.
The router follows a lazy loading pattern for token location tracking:
- Checks internal index for cached location
- If not found, queries Gamma Chain (issuing chain)
- If not in Gamma Chain, follows transfer history
- Updates index upon locating the token
- Returns standardized metadata