A Cardano blockchain indexer designed for TiDB's distributed architecture.
This project is in active development and not yet ready for production use. We're working on indexing the Cardano blockchain into TiDB to enable efficient querying of on-chain data.
Nectar indexes Cardano blockchain data into TiDB, making it queryable via SQL. It processes all eras from Byron to Conway, storing transactions, UTXOs, stake pools, delegations, and more.
TiDB offers unique advantages for blockchain data:
- High Availability: No single point of failure. TiKV nodes replicate data across the cluster with Raft consensus
- Auto-Sharding: Data automatically distributed across nodes without manual partitioning
- TiFlash: Columnar storage engine for analytical queries on historical blockchain data
- HTAP: Hybrid transactional/analytical processing - index new blocks while running complex analytics
- Compressed Storage: TiKV's RocksDB backend efficiently compresses blockchain data
- Online DDL: Schema changes without downtime as the blockchain evolves
- Horizontal Scaling: Add nodes to handle growing blockchain data without re-architecting
Traditional databases require complex sharding schemes or struggle with the continuous growth of blockchain data. TiDB handles this transparently.
- Actively syncing Cardano mainnet
- Processing all transaction types across all eras
- Building comprehensive indexes for efficient queries
- Implementing memory optimizations and performance improvements
We welcome contributions! This is an open-source project and we're looking for help with:
- Performance optimizations
- Additional query indexes
- Documentation improvements
- Testing and bug reports
- Feature suggestions
Please feel free to:
- Open issues for bugs or feature requests
- Submit pull requests
- Join discussions about the project direction
- Share your use cases and requirements
- Go 1.21+
- TiDB cluster (or TiUP playground for testing)
- Cardano node with local socket access
- 8+ CPU cores, 16GB+ RAM recommended
- Clone the repository:
git clone https://github.com/honeycomb-tech/nectar.git
cd nectar- Build:
go build -o nectar .- Configure (create
nectar.toml):
[database]
dsn = "root:password@tcp(localhost:4000)/nectar"
[cardano]
node_socket = "/path/to/node.socket"
network_magic = 764824073 # mainnet- Run:
./nectarNectar uses a modular processor architecture:
- Block Processor: Orchestrates processing of each block
- Transaction Processor: Handles all transaction types
- Certificate Processor: Processes stake pool and delegation certificates
- Asset Processor: Indexes native tokens and NFTs
- Metadata Processor: Stores transaction metadata
- Script Processor: Handles Plutus scripts
See PROJECT_STRUCTURE.md for detailed code organization.
Apache 2.0 - See LICENSE for details.
- GitHub Issues: github.com/honeycomb-tech/nectar/issues
- Discussions: github.com/honeycomb-tech/nectar/discussions
Built with ❤️ for the Cardano community