CLI
The Pye CLI automates reward calculation and distribution for validator-issued Pye Accounts. It is designed to run continuously on a small server, monitoring for epoch changes and executing payouts when required.
Github Repo: https://github.com/pyefi/pye-cli
Requirements
Server: A small, long-running machine (e.g.
t3.nano
ort3.micro
EC2 instance).⚠️ Running multiple instances simultaneously is not supported. Deploy a single dedicated instance per validator.
Keypair: A filesystem keypair with sufficient SOL to cover transaction fees and distributions. The required SOL balance depends on the validator’s stake size and expected epoch rewards.
Dependencies: Rust toolchain and build utilities.
Installation
From a fresh Ubuntu host:
# Update system packages
sudo apt-get update
sudo apt-get install -y build-essential curl
# Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
# Clone and build the CLI
git clone https://github.com/pyefi/pye-cli
cd pye-cli
cargo build --release
The compiled binary will be located at:
target/release/pye-cli
Running as a Service
We recommend running the CLI as a persistent systemd
service.
Example unit file (/etc/systemd/system/pye-cli.service
):
[Unit]
Description=Pye CLI
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=YOUR_USER
# Environment variables
Environment=RPC=https://api.mainnet-beta.solana.com
Environment=PAYER=/home/ubuntu/keys/payer.json
Environment=VOTE_PUBKEY=YOUR_VOTE_ACCOUNT_PUBKEY
Environment=ISSUERS=ISSUER_KEY1,ISSUER_KEY2
Environment=CONCURRENCY=50
Environment=RUST_LOG=info
ExecStart=/home/ubuntu/pye-cli/target/release/pye-cli validator-pye-account-manager
[Install]
WantedBy=multi-user.target
For multiple issuers, provide a comma-separated list in
ISSUERS
.
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable pye-cli
sudo systemctl start pye-cli
CLI Usage
Run with:
pye-cli validator-pye-account-manager [OPTIONS] --vote-pubkey <VOTE_PUBKEY> --payer <PAYER>
Common Options
-r, --rpc <RPC>
RPC endpoint. Default: https://api.mainnet-beta.solana.com
.
--program-id <PROGRAM_ID>
Pye program ID. Default: PYEQZ2qYHPQapnw8Ms8MSPMNzoq59NHHfNwAtuV26wx
.
-v, --vote-pubkey <VOTE_PUBKEY>
Validator’s vote account pubkey.
-i, --issuers <ISSUERS>
Restrict pye_account payments to specific issuers (comma-delimited).
-p, --payer <PAYER>
Path to payer keypair JSON file.
--concurrency <N>
Max concurrent RPC requests. Default: 50
.
--dry-run
Calculate rewards without transferring funds.
--cycle-secs <N>
Interval (seconds) between epoch checks. Default: 60
.
--block-retry-delay <N>
Retry delay (seconds) for get_block
calls. Default: 1800
.
-h, --help
Show help.
Notes
The CLI automatically calculates and distributes excess rewards for all Lockups associated with the validator.
Use
--dry-run
for testing without sending transactions.Ensure your payer key has enough SOL to cover transfers and fees.
Last updated