|
| 1 | +# pyth-lazer-agent |
| 2 | + |
| 3 | +pyth-lazer-agent is intended to be run by Lazer publishers analogous to [pyth-agent](https://github.com/pyth-network/pyth-agent) |
| 4 | +for pythnet publishers. Currently it retains [the existing Lazer publishing interface](https://github.com/pyth-network/pyth-examples/tree/main/lazer/publisher), |
| 5 | +but will batch and sign transactions before publishing them to Lazer. |
| 6 | + |
| 7 | +## Keypair |
| 8 | + |
| 9 | +You will need to generate an ed25519 keypair and provide the pubkey to the Lazer team. `solana-keygen` is the recommended utility. |
| 10 | +```bash |
| 11 | +solana-keygen new -o /path/to/keypair.json |
| 12 | +solana-keygen pubkey /path/to/keypair.json |
| 13 | +``` |
| 14 | + |
| 15 | +pyth-lazer-agent will need to configure access to this keypair file to sign transactions. |
| 16 | + |
| 17 | +## Build and run |
| 18 | + |
| 19 | +### From source |
| 20 | +Please check [rust-toolchain](rust-toolchain.toml) to see the version of Rust needed to build (currently 1.88). |
| 21 | +You will also need SSL and CA certificates. `cargo build` should then work as usual. |
| 22 | + |
| 23 | +### Docker |
| 24 | +See the included [Dockerfile](Dockerfile) to build an image yourself. |
| 25 | + |
| 26 | +### Container |
| 27 | +We also publish images to the [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#pulling-container-images). |
| 28 | +The latest will be available at `ghcr.io/pyth-network/pyth-lazer-agent:latest`. |
| 29 | + |
| 30 | +## Configure |
| 31 | +The agent takes a single `--config` CLI option, pointing at |
| 32 | +`config/config.toml` by default. Configuration is currently minimal: |
| 33 | + |
| 34 | +```toml |
| 35 | +relayer_urls = ["ws://relayer-0.pyth-lazer.dourolabs.app/v1/transaction", "ws://relayer-0.pyth-lazer.dourolabs.app/v1/transaction"] |
| 36 | +publish_keypair_path = "/path/to/keypair.json" |
| 37 | +authorization_token = "your_token" |
| 38 | +listen_address = "0.0.0.0:8910" |
| 39 | +publish_interval_duration = "25ms" |
| 40 | +``` |
| 41 | + |
| 42 | +- `relayers_urls`: The Lazer team will provide these. |
| 43 | +- `publish_keypair_path`: The keypair file generated with `solana-keygen` or similar. |
| 44 | +- `authorization_token`: The Lazer team will provide this or instruct that it can be omitted. |
| 45 | +- `listen_address`: The local port the agent will be listening on; can be anything you want. |
| 46 | +- `publisher_interval`: The agent will batch and send transaction bundles at this interval. The Lazer team will provide guidance here. |
| 47 | + |
| 48 | +## Publish |
| 49 | + |
| 50 | +Please use the `/v1/publisher` or `/v2/publisher` endpoints and the corresponding `PriceFeedDataV1` and `PriceFeedDataV2` |
| 51 | +schemas as defined in [the sdk](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/sdk/rust/protocol/src/publisher.rs). |
0 commit comments