Skip to content

Commit 142ec9c

Browse files
committed
refactor: move routes out of the config to the code
1 parent bbf014e commit 142ec9c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

config/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ exporter_endpoint = "http://127.0.0.1:4317"
223223

224224
# [pyth_lazer]
225225
# URL for the history service
226-
# history_url = "https://pyth-lazer-staging.dourolabs.app/history/"
226+
# history_url = "https://pyth-lazer-staging.dourolabs.app"
227227

228228
# URLs for the Lazer relayers to connect to
229-
# relayer_urls = ["wss://pyth-lazer-staging.dourolabs.app/v2/publisher"]
229+
# relayer_urls = ["wss://pyth-lazer-staging.dourolabs.app"]
230230

231231
# Unique identifier for this publisher
232232
# publisher_id = 1

src/agent/services/lazer_exporter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ impl RelayerSender {
8585
}
8686

8787
async fn connect_to_relayer(
88-
url: &Url,
88+
mut url: Url,
8989
token: &str,
9090
) -> Result<(
9191
SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, TungsteniteMessage>,
9292
SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>,
9393
)> {
9494
tracing::info!("connecting to the relayer at {}", url);
95+
url.set_path("/v2/publisher");
9596
let mut req = url.clone().into_client_request()?;
9697
let headers = req.headers_mut();
9798
headers.insert(
@@ -112,7 +113,7 @@ async fn connect_to_relayers(
112113
let mut relayer_receivers = Vec::new();
113114
for url in config.relayer_urls.clone() {
114115
let (relayer_sender, relayer_receiver) =
115-
connect_to_relayer(&url, &config.authorization_token).await?;
116+
connect_to_relayer(url, &config.authorization_token).await?;
116117
relayer_senders.push(relayer_sender);
117118
relayer_receivers.push(relayer_receiver);
118119
}

0 commit comments

Comments
 (0)