Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rich-indexer which is another built-in indexer based on relational database #4224

Merged
merged 129 commits into from
Mar 20, 2024

Conversation

EthanYuan
Copy link
Collaborator

@EthanYuan EthanYuan commented Nov 9, 2023

What problem does this PR solve?

Problem Summary:

CKB already has a built-in indexer, which is based on a key-value database for indexing. Rich-Indexer is a complement to the original indexer, as it is based on a relational database, providing support for more complex and flexible queries.

Currently, Rich-Indexer supports two types of database drivers.

  1. One is the embedded SQLite, which users can start using without any configuration.
  2. The other is PostgreSQL, which can undergo independent, customized configurations for both software and hardware. Additionally, it allows users to engage in secondary development based on it.

What is changed and how it works?

What's Changed:

Once the Rich-Indexer is activated, the CKB node's RPC based on the Rich-Indexer will gain additional capabilities.

INDEXER RPC Indexer Rich-Indexer
get_cells script args partial mode search ✔️
get_cells cell data filter(prefix|exact|partial) ✔️ ✔️
get_transactions script args partial mode search ✔️
get_transactions cell data filter(prefix|exact|partial) ✔️
get_cells_capacity script args partial mode search ✔️
get_cells_capacity cell data filter(prefix|exact|partial) ✔️ ✔️

In addition, Rich-Indexer can also expose full block data in the form of a PostgreSQL database, providing the most basic and flexible indexing format accessible via SQL and compatible with any programming language.

Please refer to the README for more detailed information

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression

Release note

Title Only: Include only the PR title in the release note.

@EthanYuan EthanYuan requested a review from quake November 9, 2023 01:34
@EthanYuan EthanYuan changed the title [WIP] feat: add indexer-r which is a built-in indexer based on a relational database [WIP] feat: add indexer-r which is another built-in indexer based on a relational database Nov 9, 2023
@EthanYuan EthanYuan changed the title [WIP] feat: add indexer-r which is another built-in indexer based on a relational database [WIP] feat: add indexer-r which is another built-in indexer based on relational database Nov 9, 2023
@EthanYuan EthanYuan force-pushed the indexer-r branch 2 times, most recently from c9597a2 to a1a2fe6 Compare November 17, 2023 03:54
resource/ckb.toml Outdated Show resolved Hide resolved
resource/ckb.toml Outdated Show resolved Hide resolved
@eval-exec eval-exec added the t:enhancement Type: Feature, refactoring. label Nov 22, 2023
@EthanYuan EthanYuan force-pushed the indexer-r branch 3 times, most recently from 5a4c646 to 6c6a08b Compare December 6, 2023 11:58
@EthanYuan EthanYuan force-pushed the indexer-r branch 3 times, most recently from eb3ddd6 to 95fba3b Compare December 17, 2023 01:44
@EthanYuan EthanYuan changed the title [WIP] feat: add indexer-r which is another built-in indexer based on relational database [WIP] feat: add rich-indexer which is another built-in indexer based on relational database Dec 17, 2023
@EthanYuan EthanYuan force-pushed the indexer-r branch 5 times, most recently from 120624c to 26cf54d Compare December 21, 2023 15:25
@EthanYuan EthanYuan force-pushed the indexer-r branch 4 times, most recently from 39d695c to 92012cd Compare January 3, 2024 15:02
@doitian doitian added this pull request to the merge queue Mar 20, 2024
Merged via the queue into nervosnetwork:develop with commit ed1c72f Mar 20, 2024
32 checks passed
@EthanYuan EthanYuan deleted the indexer-r branch July 11, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:enhancement Type: Feature, refactoring.
Projects
Status: 🥳 Released
Development

Successfully merging this pull request may close these issues.

7 participants