mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-03-19 10:23:07 +00:00
Merge pull request #270 from logos-blockchain/Pravdyvy/indexer-client
Bedrock client adoption
This commit is contained in:
commit
eaab2e042a
1924
Cargo.lock
generated
1924
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -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"] }
|
||||
|
||||
9
bedrock_client/Cargo.toml
Normal file
9
bedrock_client/Cargo.toml
Normal 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
21
bedrock_client/src/lib.rs
Normal 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,
|
||||
)))
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user