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

docs: create pindexer readme and mention pindexer<>pd compat in errors #4768

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/bin/pindexer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# pindexer

A indexer that ingests ABCI events emitted by pd and transforms them into useful data.

## Usage

1. Follow the setup instructions in cometindex README
2. `cargo run --bin pindexer -- -s "postgresql://localhost:5432/testnet_raw?sslmode=disable" -d "postgresql://localhost:5432/testnet_compiled?sslmode=disable"`

## pd compatibility

3 changes: 2 additions & 1 deletion crates/bin/pindexer/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::PD_COMPAT;
use anyhow::anyhow;
use cometindex::{async_trait, sqlx, AppView, ContextualizedEvent, PgTransaction};
use penumbra_proto::{core::component::sct::v1 as pb, event::ProtoEvent};
Expand Down Expand Up @@ -52,7 +53,7 @@ CREATE TABLE IF NOT EXISTS block_details (
.bind(i64::try_from(pe.height)?)
.bind(
DateTime::from_timestamp(timestamp.seconds, u32::try_from(timestamp.nanos)?)
.ok_or(anyhow!("failed to convert timestamp"))?,
.ok_or(anyhow!(format!("failed to convert timestamp. {PD_COMPAT}")))?,
)
.bind(pe.root.unwrap().inner)
.execute(dbtx.as_mut())
Expand Down
2 changes: 2 additions & 0 deletions crates/bin/pindexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ pub mod dex;
pub mod shielded_pool;
mod sql;
pub mod stake;

pub(crate) const PD_COMPAT: &'static str = "Check that your pd and pindexer versions match. See pd compatibility section in README for more information.";
Loading