Skip to content

arpradio/cip60Indexer

Repository files navigation

CIP-60 Music Token Indexer

psyencelab

License: MIT TypeScript PostgreSQL

Overview

The CIP-60 Music Token Indexer is a specialized blockchain indexing tool designed to track and catalog music-related NFTs on the Cardano blockchain that comply with the CIP-60 NFT Metadata Standard. This tool provides real-time monitoring and indexing of music tokens, enabling efficient querying and analysis of on-chain music assets.

Key Features

  • Real-time indexing of CIP-60 compliant music tokens
  • Support for all three versions of the music metadata standard
  • Automatic state management and recovery
  • Live dashboard for monitoring indexing progress
  • RESTful API for querying indexed assets
  • PostgreSQL persistence layer

Architecture

The indexer consists of three main components:

  1. Core Indexer: Connects to Cardano network via Ogmios RPC calls (we recommend using the cardano-node-ogmios build!), processes blocks, and extracts music token metadata
  2. API Server: Provides basic REST endpoints for querying indexed data
  3. Dashboard: Web interface for monitoring indexing progress and system status

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/arpradio/cip60Indexer.git
    cd cip60Indexer
  2. Install dependencies:

    npm install
  3. Set up the database:

    psql -U postgres -f cip60.sql
  4. Configure environment variables:

    cp .env.example .env

    Edit .env with your configuration:

    OGMIOS_URL=ws://<ogmios-host>:<port>
    DB_HOST=localhost
    DB_PORT=5432
    DB_USER=postgres
    DB_PASSWORD=<your-password>
    DB_NAME=cip60
    
  5. Start the indexer:

    npm run dev

API Documentation

Endpoints

GET /api/stats

Returns current indexing statistics and network state.

GET /api/assets/recent

Returns the 10 most recently indexed assets.

GET /api/assets?search=

Keyword search the metadata

Development

Running Tests

npm test

Building

npm run build

Troubleshooting

Common Issues

  1. Connection to Ogmios fails

    • Verify Ogmios is running and accessible
    • Check firewall settings
    • Ensure correct WebSocket URL in .env
  2. Database Connection Issues

    • Verify PostgreSQL is running
    • Check credentials in .env
    • Ensure database exists and schema is initialized
  3. Indexer Crashes During Sync

    • Check available disk space
    • Verify RAM usage
    • Review logs for specific errors

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The Psyence Lab for development of the CIP standard and tooling
  • Ogmios team for the fantastic chain sync implementation
  • All contributors to this project

Contact

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published