Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyth-agent"
version = "2.12.3"
version = "3.0.0"
edition = "2024"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM rust:slim-bookworm as builder

RUN apt update && apt install -y curl libssl-dev pkg-config && apt clean all
RUN apt update && apt install -y curl libssl-dev pkg-config build-essential && apt clean all

ADD . /agent
WORKDIR /agent
Expand Down
2 changes: 1 addition & 1 deletion config/config.sample.pythnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rpc_urls = ["https://api2.pythnet.pyth.network"]

# WS(S) endpoint of the RRC node. This is used to subscribe to account changes on the network.
# This can be omitted when oracle.subscriber_enabled is set to false.
wss_url = "wss://api2.pythnet.pyth.network"
wss_urls = ["wss://api2.pythnet.pyth.network"]

# Path to your publishing keypair.
key_store.publish_keypair_path = "/path/to/keypair.json"
Expand Down
2 changes: 1 addition & 1 deletion config/config.sample.pythtest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rpc_urls = ["https://api.pythtest.pyth.network"]
# WS(S) endpoint of the RRC node. This is used to subscribe to account changes
# on the network. This can be omitted when oracle.subscriber_enabled is set to
# false.
wss_url = "wss://api.pythtest.pyth.network"
wss_urls = ["wss://api.pythtest.pyth.network"]

# Path to your publishing keypair.
key_store.publish_keypair_path = "/path/to/keypair.json"
Expand Down
23 changes: 22 additions & 1 deletion config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rpc_urls = ["https://api.pythtest.pyth.network"]

# WS(S) endpoint of the RRC node. This is used to subscribe to account changes on the network.
# This can be omitted when oracle.subscriber_enabled is set to false.
wss_url = "wss://api.pythtest.pyth.network"
wss_urls = ["wss://api.pythtest.pyth.network"]

# Path to the keypair used to publish price updates. If set to a
# non-existent file path, the system expects a keypair to be loaded
Expand Down Expand Up @@ -218,3 +218,24 @@ exporter_timeout_duration = "3s"

# Endpoint URL for the OpenTelemetry exporter
exporter_endpoint = "http://127.0.0.1:4317"

## Configuration for Pyth Lazer ##

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

# URLs for the Lazer relayers to connect to
# relayer_urls = ["wss://pyth-lazer-staging.dourolabs.app"]

# Unique identifier for this publisher
# publisher_id = 1

# Authorization token for connecting to relayers
# authorization_token = "your-auth-token"

# Path to the publisher's secret key file
# publisher_secret_key = "/path/to/publisher-key.json"

# Duration between price updates (defaults to 200ms if not specified)
# publish_interval_duration = "200ms"
2 changes: 1 addition & 1 deletion integration-tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV PATH="${PATH}:/root/.local/bin"
RUN poetry config virtualenvs.in-project true

# Install Solana Tool Suite
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)"
RUN sh -c "$(curl -sSfL https://release.anza.xyz/v2.2.1/install)"
ENV PATH="${PATH}:/root/.local/share/solana/install/active_release/bin"

ADD . /agent
Expand Down
7 changes: 4 additions & 3 deletions src/agent/services/lazer_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl std::fmt::Debug for PublisherSecretKey {
}

fn default_publish_interval() -> Duration {
Duration::from_millis(10)
Duration::from_millis(200)
}

struct RelayerSender {
Expand All @@ -85,13 +85,14 @@ impl RelayerSender {
}

async fn connect_to_relayer(
url: &Url,
mut url: Url,
token: &str,
) -> Result<(
SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, TungsteniteMessage>,
SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>,
)> {
tracing::info!("connecting to the relayer at {}", url);
url.set_path("/v2/publisher");
let mut req = url.clone().into_client_request()?;
let headers = req.headers_mut();
headers.insert(
Expand All @@ -112,7 +113,7 @@ async fn connect_to_relayers(
let mut relayer_receivers = Vec::new();
for url in config.relayer_urls.clone() {
let (relayer_sender, relayer_receiver) =
connect_to_relayer(&url, &config.authorization_token).await?;
connect_to_relayer(url, &config.authorization_token).await?;
relayer_senders.push(relayer_sender);
relayer_receivers.push(relayer_receiver);
}
Expand Down
Loading