Skip to content

XRAY/Graph NFTCDN — Dockerized Metadata/Datums indexer & Image Server with IPFS gateway

License

Notifications You must be signed in to change notification settings

xray-network/xray-graph-nftcdn

Repository files navigation

Discord

XRAY/Graph NFTCDN — Dockerized Metadata/Datums indexer & Image Server with IPFS gateway

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.

Getting Started

Prepare Installation

git clone \
  https://github.com/xray-network/xray-graph-nftcdn.git \
  && cd xray-graph-nftcdn
cp .env.example .env

Build and Run via Docker Compose

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

Documentation

Endpoints List

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

TypeScript Client

We recommend to use cardano-nftcdn-client. Visit cardano-nftcdn-client repo for more information.

Advanced Usage

HAProxy Config
Kubo Config
Postgres Config

About

XRAY/Graph NFTCDN — Dockerized Metadata/Datums indexer & Image Server with IPFS gateway

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages