This project is a Rust-based utility for listening to messages on Pythnet, processing, and signing them.
cargo build --release
Or for development:
cargo build
You can run the project using cargo run
by passing the required flags:
Make sure to set RUST_LOG=INFO
to enable logs from tracing:
RUST_LOG=INFO cargo run -- run \
--pythnet-url wss://api2.pythnet.pyth.network \
--server-url https://quorum-1.pyth.network \
--server-url https://quorum-2.pyth.network \
--server-url https://quorum-3.pyth.network \
--signer-uri file:///path/to/secret.key \
--wormhole-pid H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU
You can specify multiple --server-url
flags to broadcast observations to more than one server.
✅ Note on --signer-uri
:
This argument specifies the signer backend and is compatible with the formats supported by the Wormhole Guardian Signer.
Supported schemes:
file://<path-to-file>
— Load an armored OpenPGP secp256k1 private key from a file.amazonkms://<key-id-or-arn>
— Use a key stored in AWS KMS. The key must supportECDSA_SHA_256
and use theECC_SECG_P256K1
curve.
Example using AWS KMS:
--signer-uri amazonkms://arn:aws:kms:us-west-2:123456789012:key/abcde-1234-5678
Instead of CLI flags, you can also set environment variables:
export PYTHNET_URL=wss://api2.pythnet.pyth.network
export SERVER_URL=https://quorum-1.pyth.network,https://quorum-2.pyth.network,https://quorum-3.pyth.network
export SIGNER_URI=file:///path/to/secret.key
export WORMHOLE_PID=H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU
export RUST_LOG=INFO
cargo run
You can provide multiple server URLs in the SERVER_URL
environment variable by separating them with commas.
To generate a new armored OpenPGP secp256k1 secret key and write it to a file:
RUST_LOG=INFO cargo run -- generate-key --output-file .secret
This will save the key in raw byte format to the file named .secret
.
To test in a non-production environment (e.g. with devnet or a local Pythnet fork), just provide a different --pythnet-url
, and --server-url
, and optionally use custom --wormhole-pid
.