Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dcSpark/carp
A modular indexer for Cardano with an SQL Postgres backend (an alternative to the well known cardano-db-sync)
https://github.com/dcSpark/carp
blockchain cardano database oura postgres sql
Last synced: 14 days ago
JSON representation
A modular indexer for Cardano with an SQL Postgres backend (an alternative to the well known cardano-db-sync)
- Host: GitHub
- URL: https://github.com/dcSpark/carp
- Owner: dcSpark
- License: mit
- Created: 2022-02-09T16:29:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T06:59:48.000Z (about 1 month ago)
- Last Synced: 2024-10-20T12:18:15.199Z (24 days ago)
- Topics: blockchain, cardano, database, oura, postgres, sql
- Language: Rust
- Homepage:
- Size: 11.4 MB
- Stars: 105
- Watchers: 7
- Forks: 22
- Open Issues: 45
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Carp - Cardano Postgres Indexer
**Important**:
- Documentation: [here](https://dcspark.github.io/carp/docs/intro)
- NPM package (client): [here](https://www.npmjs.com/package/@dcspark/carp-client)Welcome to Carp, a Cardano Postgres Indexer. This project is designed to sync data from the Cardano blockchain and store it into a Postgres database. The backend is written in Rust using Oura and CML, while the server and client are written in TypeScript.
## Core Pillars
The core pillars of Carp are:**Speed**: Queries should be fast so they can be used inside production applications like wallets without the user feeling the application is not responsive.
**Modular**: It should be easy to enable only the database functionality you need to keep sync times fast and size requirements low.
**Flexible**: Instead of assuming the format users will need, we prefer to use raw cbor or raw bytes. Almost all applications already implement CML so they should be able to parse this data without any issue.
**Type safe**: Using and exposing types to avoid bugs is crucial in financial software. Database queries and the web server should have all its types checked and available to users.
**Documented**: Although we have to assume the user has read the Cardano ledger specs, design decisions, usage, and pitfalls should all be documented1.
## FAQ
**How long does it take to sync the database from scratch?**
Around 4-5 days. The first epochs are really fast, but Alonzo takes about ~1hr per epoch. We recommend taking occasional snapshots of the database so that you can easily spin up new nodes or recover from crashes without having to resync from scratch.
**How long does it take to query history?**
Querying the transaction history for an address should take <10ms for local queries (no network overhead). Of course, it will take longer if you're using a slow machine or if your machine is at max utilization.
**How can I launch my own network?**
We support parsing genesis blocks so it should be doable. However, this feature is still in development. Feel free to make a PR for more concrete steps1.
## Running Carp
This project contains two different parts:- An indexer that stores the chain to a Postgres database.
- A webserver that provides a REST API for querying the database (ex: for light wallets)1.For detailed instructions on how to run each component, please refer to the respective README files of the indexer and the webserver.
## Contributing
Contributions to Carp are very welcome. If you're interested in improving the project, feel free to make a PR.