Skip to content

Commit

Permalink
Move comment to code
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor-N-Suadicani committed Oct 28, 2024
1 parent 9b00a23 commit 8f5a410
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions backend-rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ To run the services, the following dependencies are required to be available on

The indexer talks to a Concordium node in order to gather data about the chain, which it then inserts into a PostgreSQL database.
Note that only one instance of the indexer may run at any one time, as multiple instances would conflict with each other.
The indexer purposefully performs insertions in a sequential manner, such that table indices can be strictly increasing without skipping any values.
Since no rows are ever deleted, this allows using the table indices to quickly calculate the number of rows in a table, without having to actually count all rows via a table scan.

For instructions on how to use the indexer run:

Expand Down
6 changes: 6 additions & 0 deletions backend-rust/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ use tokio_util::sync::CancellationToken;
use tracing::{error, info, warn};

/// Service traversing each block of the chain, indexing it into a database.
///
/// The indexer purposefully performs insertions in a sequential manner, such
/// that table indices can be strictly increasing without skipping any values.
/// Since no rows are ever deleted, this allows using the table indices to
/// quickly calculate the number of rows in a table, without having to actually
/// count all rows via a table scan.
pub struct IndexerService {
/// List of Concordium nodes to cycle through when traversing.
endpoints: Vec<v2::Endpoint>,
Expand Down

0 comments on commit 8f5a410

Please sign in to comment.