XRAY/Graph NFTCDN is a tool for fast and predictable deployment of Cardano Tokens Metadata/Datums Indexer (Ogmios-based) & Image Resizer (Sharp-based), IPFS Gateway (Kubo), and Haproxy (TCP/HTTP Load Balancer) stack in a docker environment. Used in the XRAY/Graph distributed Cardano API provider.
Indexes metadata from CIP-0025
(Media Token Metadata: TX Label 721), CIP-0026
(Cardano Token Registry), CIP-0027
(Royalties: TX Label 777), CIP-0060
(Music Token), CIP-0068
(Datum Metadata). Proxies and caches (in case of resize) images received from IPFS, HTTP, Base64 (on-chain). Supports sending WebP if the client supports this format.
git clone \
https://github.com/xray-network/xray-graph-nftcdn.git \
&& cd xray-graph-nftcdn
cp .env.example .env
You can combine profiles to run multiple networks on the same machine:
docker compose --profile mainnet --profile preprod --profile preview up -d
MAINNET
docker compose --profile mainnet up -d
PREPROD
docker compose --profile preprod up -d
PREVIEW
docker compose --profile preview up -d
- NFTCDN — See Endpoints List below
- Kubo — https://github.com/ipfs/kubo/
- Ogmios — https://ogmios.dev/
- Haproxy — https://www.haproxy.org/
Method | Endpoint | Params | Description |
---|---|---|---|
GET | /image/:fingerprint | Proxy original image (IPFS, HTTP, Base64) from asset metadata in order cip68->cip25->cip26 |
|
GET | /image/:fingerprint | ?select=cip25 | Specify from which metadata to load the image. Options: cip25 , cip26 , cip68 |
GET | /image/:fingerprint | ?size=256 | Resize, cache, and serve image |
GET | /image/:fingerprint | ?size=256&crop=true | Resize, crop (to square), cache, and serve image |
GET | /metadata/:fingerprint | Serve asset metadata | |
GET | /metadata/:fingerprint | ?raw=true | Don't replace image value with SERVER_IMAGE_URL prefix |
POST | /metadata | {"fingerprints": string[], "raw": boolean } | Bulk metadata retreiving (up to 1000) |
GET | /assets | Get lits of assets with basic info | |
GET | /assets | ?fingerprint= &policy_id= &asset_name= &asset_name_ascii= &limit= &offset= | Search params, asset_name_ascii searches as %LIKE% in utf8->hex format |
GET | /ipfs/:cid | IPFS gateway proxy |
We recommend to use cardano-nftcdn-client
. Visit cardano-nftcdn-client repo for more information.
HAProxy Config
Kubo Config
Postgres Config
- Config file (see end of file): config/postgresql/postgresql.conf
- Docs: https://www.postgresql.org/docs/current/index.html
- Tune settings: https://pgtune.leopard.in.ua