Merge pull request #270 from logos-blockchain/Pravdyvy/indexer-client

Bedrock client adoption
This commit is contained in:
Sergio Chouhy 2026-01-26 11:03:07 -03:00 committed by GitHub
commit eaab2e042a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1697 additions and 265 deletions

1924
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@ members = [
"examples/program_deployment",
"examples/program_deployment/methods",
"examples/program_deployment/methods/guest",
"bedrock_client",
]
[workspace.dependencies]
@ -75,6 +76,9 @@ chrono = "0.4.41"
borsh = "1.5.7"
base58 = "0.2.0"
itertools = "0.14.0"
url = "2.5.4"
common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
rocksdb = { version = "0.24.0", default-features = false, features = [
"snappy",
@ -93,4 +97,4 @@ actix-web = { version = "=4.1.0", default-features = false, features = [
"macros",
] }
clap = { version = "4.5.42", features = ["derive", "env"] }
reqwest = { version = "0.11.16", features = ["json"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls", "stream"] }

View File

@ -0,0 +1,9 @@
[package]
name = "bedrock_client"
version = "0.1.0"
edition = "2024"
[dependencies]
reqwest.workspace = true
anyhow.workspace = true
common-http-client.workspace = true

21
bedrock_client/src/lib.rs Normal file
View File

@ -0,0 +1,21 @@
use anyhow::Result;
use common_http_client::CommonHttpClient;
pub use common_http_client::{BasicAuthCredentials, Error};
use reqwest::Client;
// Simple wrapper
// maybe extend in the future for our purposes
pub struct BedrockClient(pub CommonHttpClient);
impl BedrockClient {
pub fn new(auth: Option<BasicAuthCredentials>) -> Result<Self> {
let client = Client::builder()
//Add more fields if needed
.timeout(std::time::Duration::from_secs(60))
.build()?;
Ok(BedrockClient(CommonHttpClient::new_with_client(
client, auth,
)))
}
}

View File

@ -52,7 +52,7 @@ if [ -d ".git" ]; then
git reset --hard origin/main
else
echo "Cloning repository..."
git clone https://github.com/vacp2p/nescience-testnet.git .
git clone https://github.com/logos-blockchain/lssa.git .
git checkout main
fi