-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chor: refactor grpc command to use topograph to clean up the control …
…flow. also pull in backfill to be used in ingest
- Loading branch information
Showing
47 changed files
with
1,630 additions
and
1,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[package] | ||
name = "das-backfill" | ||
version = { workspace = true } | ||
edition = { workspace = true } | ||
repository = { workspace = true } | ||
publish = { workspace = true } | ||
|
||
[dependencies] | ||
anyhow = { workspace = true } | ||
blockbuster = { workspace = true } | ||
bs58 = { workspace = true } | ||
das-core = { workspace = true } | ||
solana-client = { workspace = true } | ||
borsh = { workspace = true } | ||
digital_asset_types = { workspace = true, features = [ | ||
"json_types", | ||
"sql_types", | ||
] } | ||
anchor-client = { workspace = true } | ||
futures = { workspace = true } | ||
clap = { workspace = true } | ||
log = { workspace = true } | ||
solana-program = { workspace = true } | ||
program_transformers = { workspace = true } | ||
heck = { workspace = true } | ||
mpl-bubblegum = { workspace = true } | ||
num-traits = { workspace = true } | ||
sea-orm = { workspace = true } | ||
serde_json = { workspace = true } | ||
solana-sdk = { workspace = true } | ||
solana-transaction-status = { workspace = true } | ||
spl-account-compression = { workspace = true, features = ["no-entrypoint"] } | ||
spl-token = { workspace = true, features = ["no-entrypoint"] } | ||
sqlx = { workspace = true } | ||
thiserror = { workspace = true } | ||
tokio = { workspace = true, features = ["time"] } | ||
tracing = { workspace = true } | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## DAS Backfill | ||
|
||
The DAS Backfill library facilitates the initial setup and data backfilling for DAS, focusing on the bubblegum program. This program's indexing heavily relies on transaction data. While the library supports parallel backfilling across different trees, it ensures that transactions within each tree are processed sequentially. This approach guarantees accurate representation of every modification in the merkle tree within DAS. | ||
|
||
## Usage | ||
|
||
```rust | ||
use das_backfill::{ | ||
BubblegumBackfillArgs, | ||
BubblegumBackfillContext, | ||
start_bubblegum_backfill | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() -> anyhow::Result<()> { | ||
let database_pool = sqlx::PgPool::connect("your_database_url").await?; | ||
let solana_rpc = Rpc::new("your_solana_rpc_url"); | ||
|
||
let context = BubblegumBackfillContext::new(database_pool, solana_rpc); | ||
let args = BubblegumBackfillArgs::parse(); // Parses args from CLI | ||
|
||
start_bubblegum_backfill(context, args).await | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum ErrorKind { | ||
#[error("anchor")] | ||
Anchor(#[from] anchor_client::anchor_lang::error::Error), | ||
#[error("solana rpc")] | ||
Rpc(#[from] solana_client::client_error::ClientError), | ||
#[error("parse pubkey")] | ||
ParsePubkey(#[from] solana_sdk::pubkey::ParsePubkeyError), | ||
#[error("serialize tree response")] | ||
SerializeTreeResponse, | ||
#[error("sea orm")] | ||
Database(#[from] sea_orm::DbErr), | ||
#[error("try from pubkey")] | ||
TryFromPubkey, | ||
#[error("try from signature")] | ||
TryFromSignature, | ||
#[error("generic error: {0}")] | ||
Generic(String), | ||
} |
Oops, something went wrong.