Skip to content

Run your own registry

The registry is a single service with a PostgreSQL database. It indexes the chain itself, from a Cardano node, and syncs the CIP-26 registry from GitHub.

Terminal window
git clone https://github.com/cardano-foundation/cf-token-metadata-registry
cd cf-token-metadata-registry
docker compose up -d # mainnet
docker compose --env-file .env.preprod up -d # preprod

The API listens on the port in API_LOCAL_BIND_PORT. The first sync indexes the chain from the start point in the .env file, which takes hours on mainnet; /actuator/health/readiness turns UP when it is done.

ImageUse
cardanofoundation/cf-token-metadata-registry-api:<version>JVM
cardanofoundation/cf-token-metadata-registry-api:<version>-nativeGraalVM native image: faster start, less memory

To scale reads, run extra instances that serve the same database without indexing: the ro Compose profile (COMPOSE_PROFILES=ro docker compose up -d) starts one with STORE_READONLYMODE=true and the readonly Spring profile.

VariableMeaning
DB_URL, DB_USERNAME, DB_PASSWORDthe PostgreSQL database
STORE_CARDANO_HOST, STORE_CARDANO_PORT, STORE_CARDANO_PROTOCOL_MAGICthe Cardano node to index from
STORE_CARDANO_SYNC_START_SLOT, STORE_CARDANO_SYNC_START_BLOCKHASHwhere indexing starts
TOKEN_METADATA_SYNC_JOBsync the CIP-26 registry in this instance (true), or leave it to a separate job
GITHUB_ORGANIZATION, GITHUB_PROJECT_NAMEthe CIP-26 registry repository
CIP113_REGISTRY_NFT_POLICY_IDSthe CIP-113 registry to index; empty switches CIP-113 off

The full list, and the design decisions behind the registry, are in the repository.

Built on Yaci Store and cardano-client-lib by BloxBean.