feat(swqos): Astralane QUIC region-based endpoints and endpoint selection
- Add SWQOS_ENDPOINTS_ASTRALANE_QUIC array (8 regions: ny, fr, ams, lim, sg, ams, la, lim) - Select QUIC endpoint by region and optional custom URL in get_swqos_client (was hardcoded) - Use primary endpoints only; avoid ams2/fr2 for lower latency - Align with Astralane QUIC docs (port 7000, gateway.astralane.io) Made-with: Cursor
This commit is contained in:
+12
-2
@@ -268,8 +268,18 @@ pub const SWQOS_ENDPOINTS_ASTRALANE: [&str; 8] = [
|
||||
"http://lim.gateway.astralane.io/irisb",
|
||||
];
|
||||
|
||||
/// Astralane QUIC 默认端点。
|
||||
pub const ASTRALANE_QUIC_ENDPOINT: &str = "lim.gateway.astralane.io:7000";
|
||||
/// Astralane QUIC endpoints (port 7000). Region order: NewYork, Frankfurt, Amsterdam, SLC, Tokyo, London, LosAngeles, Default.
|
||||
/// See: https://github.com/Astralane/astralane-quic-client. We use fr, ams, la, ny, lim, sg only (avoid ams2/fr2 for lower latency).
|
||||
pub const SWQOS_ENDPOINTS_ASTRALANE_QUIC: [&str; 8] = [
|
||||
"ny.gateway.astralane.io:7000", // NewYork
|
||||
"fr.gateway.astralane.io:7000", // Frankfurt
|
||||
"ams.gateway.astralane.io:7000", // Amsterdam
|
||||
"lim.gateway.astralane.io:7000", // SLC (no slc, use lim)
|
||||
"sg.gateway.astralane.io:7000", // Tokyo (Asia)
|
||||
"ams.gateway.astralane.io:7000", // London (Europe, avoid ams2)
|
||||
"la.gateway.astralane.io:7000", // LosAngeles
|
||||
"lim.gateway.astralane.io:7000", // Default
|
||||
];
|
||||
|
||||
pub const SWQOS_ENDPOINTS_STELLIUM: [&str; 8] = [
|
||||
"http://ewr1.flashrpc.com",
|
||||
|
||||
+4
-2
@@ -37,6 +37,7 @@ use crate::{
|
||||
SWQOS_ENDPOINTS_FLASHBLOCK,
|
||||
SWQOS_ENDPOINTS_BLOCKRAZOR,
|
||||
SWQOS_ENDPOINTS_ASTRALANE,
|
||||
SWQOS_ENDPOINTS_ASTRALANE_QUIC,
|
||||
SWQOS_ENDPOINTS_STELLIUM,
|
||||
SWQOS_ENDPOINTS_SOYAS,
|
||||
SWQOS_ENDPOINTS_SPEEDLANDING,
|
||||
@@ -365,9 +366,10 @@ impl SwqosConfig {
|
||||
SwqosConfig::Astralane(auth_token, region, url, transport) => {
|
||||
let use_quic = transport.map_or(false, |t| t == SwqosTransport::Quic);
|
||||
if use_quic {
|
||||
let quic_endpoint = crate::constants::swqos::ASTRALANE_QUIC_ENDPOINT;
|
||||
let quic_endpoint = url
|
||||
.unwrap_or_else(|| SWQOS_ENDPOINTS_ASTRALANE_QUIC[region as usize].to_string());
|
||||
let astralane_client =
|
||||
AstralaneClient::new_quic(rpc_url.clone(), quic_endpoint, auth_token).await?;
|
||||
AstralaneClient::new_quic(rpc_url.clone(), &quic_endpoint, auth_token).await?;
|
||||
Ok(Arc::new(astralane_client))
|
||||
} else {
|
||||
let endpoint = SwqosConfig::get_endpoint(SwqosType::Astralane, region, url);
|
||||
|
||||
Reference in New Issue
Block a user