An open-source HTTP resolver for dPID, bridging data from the decentralized protocols used for publishing to HTTP. The resolver handles requests for scientific research artifact data published on CODEX, resolving data across Ceramic Network, on-chain smart contracts, and IPFS.
DeSci Labs hosts two public resolvers:
- https://beta.dpid.org (mainnet)
- https://dev-beta.dpid.org/ (testnet)
- Resolves dPIDs (short identifiers for CODEX IDs/Ceramic stream IDs) to their corresponding data
- Exposes HTTP endpoints for accessing decentralized data
- Supports caching via Redis for improved performance
- Configurable for both mainnet and testnet environments
Copy .env.example to .env and configure the following options:
DPID_ENV: Environment configuration (mainnet/testnet)OPTIMISM_RPC_URL: RPC URL for Optimism Sepolia networkCERAMIC_URL: js-ceramic/composeDB node URL (ifCERAMIC_FLIGHT_URLis set, this is ignored)
CERAMIC_FLIGHT_URL: If set, exclusively uses ceramic-one for stream resolutionSUPABASE_URL/PORT: For analytics trackingREDIS_*: Redis configuration for caching stream/commit stateCACHE_TTL_ANCHORED: Cache duration for finalized commits (default: 1 week)CACHE_TTL_PENDING: Cache duration for unfinalized commits (default: 10 minutes)
# Install dependencies
npm ci
# Run tests (uses live data from dPID dev environment)
npm run test
# Development mode with hot reload
npm run dev
# Production build
npm run build
npm run start
# Code formatting and linting
npm run tidy
This project supports caching using Redis to improve response times and reduce load on the underlying data sources. If you want to enable Redis caching, follow these steps to set up a local Redis container using Docker:
-
Start a Redis Container
Run the following command to start a Redis server in detached mode:
docker run -d --name dpid-redis -p 6379:6379 redis:alpine
-
Check if Redis is Running
Verify that the container is up and running:
docker ps | grep dpid-redisYou should see
dpid-redisin the list of running containers. -
Test the Redis Connection
Make sure Redis responds to commands:
docker exec dpid-redis redis-cli pingYou should see the response:
PONG
Note:
If you are deploying to production or want to use an external Redis provider, make sure to configure theREDIS_*options in your.envfile as described above.
The API documentation is available at /api-docs when the server is running. This interactive documentation provides:
- Detailed endpoint descriptions
- Request/response schemas
- Example requests and responses
- Interactive testing interface
To access the documentation:
- Start the server (
npm run devornpm run start) - Visit
http://localhost:5460/api-docs(or your configured port)
# Build the image
docker build . -t dpid.org/dpid-resolver
# Run the container
docker run dpid.org/dpid-resolver