mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-26 07:18:06 +00:00
debug
This commit is contained in:
+5
-5
@@ -23,11 +23,9 @@ pub struct RpcResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
||||||
let mut client_builder = reqwest::Client::builder();
|
println!("get_tip_accounts: {}", block_engine_url);
|
||||||
if let Ok(http_proxy) = env::var("HTTP_PROXY") {
|
|
||||||
let proxy = Proxy::all(http_proxy)?;
|
let client_builder = reqwest::Client::builder();
|
||||||
client_builder = client_builder.proxy(proxy);
|
|
||||||
}
|
|
||||||
let client = client_builder.build()?;
|
let client = client_builder.build()?;
|
||||||
let request_body = RpcRequest {
|
let request_body = RpcRequest {
|
||||||
jsonrpc: "2.0".to_string(),
|
jsonrpc: "2.0".to_string(),
|
||||||
@@ -35,6 +33,7 @@ pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
|||||||
method: "getTipAccounts".to_string(),
|
method: "getTipAccounts".to_string(),
|
||||||
params: vec![],
|
params: vec![],
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = client
|
let result = client
|
||||||
.post(format!("{}/api/v1/bundles", block_engine_url))
|
.post(format!("{}/api/v1/bundles", block_engine_url))
|
||||||
.json(&request_body)
|
.json(&request_body)
|
||||||
@@ -43,6 +42,7 @@ pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
|||||||
.json::<RpcResponse>()
|
.json::<RpcResponse>()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
println!("result: {:?}", result);
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
/// tip accounts
|
/// tip accounts
|
||||||
|
|||||||
Reference in New Issue
Block a user