| Crates.io | yellowstone-shield-cli |
| lib.rs | yellowstone-shield-cli |
| version | 0.8.0 |
| created_at | 2025-06-19 12:20:47.657075+00 |
| updated_at | 2025-11-07 12:50:25.045997+00 |
| description | Yellowstone Shield CLI |
| homepage | |
| repository | https://github.com/rpcpool/yellowstone-shield |
| max_upload_size | |
| id | 1718292 |
| size | 204,233 |
A command-line interface for managing Yellowstone Shield access control policies on Solana. This tool enables you to create permission-based policies that control access for validators, wallets, and programs.
The Yellowstone Shield CLI is a command-line tool for managing access policies for Solana identities, such as validators, wallets, or programs. It allows users to create and manage policies, add, update and remove identites, and configure various settings related to the policy.
git clone https://github.com/rpcpool/yellowstone-shield
cd yellowstone-shield
cargo build --release --bin yellowstone-shield-cli
The binary will be available at target/release/yellowstone-shield-cli
The CLI uses your Solana CLI configuration by default. Ensure you have:
# Set your RPC endpoint
solana config set --url https://api.mainnet-beta.solana.com
# Set your keypair
solana config set --keypair ~/.config/solana/id.json
The binary should be located at ./target/release/yellowstone-shield-cli.
-r, --rpc <URL> - Override the RPC endpoint from Solana config-k, --keypair <PATH> - Override the keypair path from Solana config-l, --log-level <LEVEL> - Set log verbosity (default: "off")-r, --rpc <URL>: RPC endpoint url to override using the Solana config.-T, --timeout <SECONDS>: Set the timeout duration (default is 90 seconds).-l, --log-level <LEVEL>: Set the log level (default is "off").-k, --keypair <FILE>: Path to the local owner keypair file -- not a hardware wallet.Before creating a new Policy, plan ahead by creating a URI-addressable JSON file containing the metadata for your Policy. The Policy metadata should use the format shown in this example (https://gateway.irys.xyz/CdxWAuxk483JsqJdbE8cSKkZEMTJ1EKpDsUWmqGTaFu8):
{
"name": "Top 25 Validators by Stake",
"symbol": "TV25",
"description": "A Yellowstone Shield policy of the top 25 validators by stake.",
"image": "https://gateway.irys.xyz/Hhdy76nXVpNBCg1pVLtpctaZXbpnSufWggbyiMFUoCTh",
"external_url": "https://triton.one",
"attributes": []
}
After uploading your metadata to a publicly accessible URI, you will use the URI with the --uri parameter when creating the Policy.
Create a new access control policy with metadata:
# Create an Allow policy
yellowstone-shield-cli policy create \
--strategy Allow \
--name "Validator Access Policy" \
--symbol "VAP" \
--uri "https://example.com/policy-metadata.json"
# Create a Deny policy (blocklist)
yellowstone-shield-cli policy create \
--strategy Deny \
--name "Restricted Access" \
--symbol "BLOCK" \
--uri "https://example.com/blocklist.json"
Parameters:
--strategy - Permission strategy: Allow (whitelist) or Deny (blocklist)--name - Human-readable policy name--symbol - Short identifier (like a token symbol)--uri - Metadata URI for additional policy informationDisplay policy information and list all authorized identities:
yellowstone-shield-cli policy show \
--mint 7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m
Remove a policy (requires ownership):
yellowstone-shield-cli policy delete \
--mint 7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m
Add authorized identities to a policy from a file:
# Create a file with pubkeys (one per line)
cat > validators.txt << EOF
DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh
ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt
CiDwVBFgWV9E5MvXWoLgnEgn2hK7rJikbvfWavzAQz3
EOF
# Add all identities to the policy
yellowstone-shield-cli identities add \
--mint 7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m \
--identities-path validators.txt
The command will:
Remove identities from a policy:
# Create a file with pubkeys to remove
cat > remove_list.txt << EOF
ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt
EOF
yellowstone-shield-cli identities remove \
--mint 7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m \
--identities-path remove_list.txt
Create a whitelist for authorized validators:
# Create policy
yellowstone-shield-cli policy create \
--strategy Allow \
--name "Mainnet Validators" \
--symbol "MVAL" \
--uri "https://validators.example.com/metadata.json"
# Note the mint address from output
# Add validators
yellowstone-shield-cli identities add \
--mint <MINT_ADDRESS> \
--identities-path mainnet_validators.txt
Create a blocklist for restricted programs:
# Create deny policy
yellowstone-shield-cli policy create \
--strategy Deny \
--name "Restricted Programs" \
--symbol "DENY" \
--uri "https://security.example.com/blocklist.json"
# Add restricted program IDs
yellowstone-shield-cli identities add \
--mint <MINT_ADDRESS> \
--identities-path restricted_programs.txt
Update access lists programmatically:
#!/bin/bash
POLICY_MINT="7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m"
# Add new validators
yellowstone-shield-cli identities add \
--mint $POLICY_MINT \
--identities-path new_validators.txt
# Remove deactivated validators
yellowstone-shield-cli identities remove \
--mint $POLICY_MINT \
--identities-path removed_validators.txt
# Show current state
yellowstone-shield-cli policy show --mint $POLICY_MINT
The CLI provides formatted output with emojis for better readability:
📜 Policy
--------------------------------
🏠 Addresses
📜 Policy: 5we4Bk6DxGMnMbrUMmVpLjgyHrqh7k7F4vhYVzkeQcH2
🔑 Mint: 7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m
--------------------------------
🔍 Details
✅ Strategy: Allow
🏷️ Name: Validator Access Policy
🔖 Symbol: VAP
🌐 URI: https://example.com/policy-metadata.json
--------------------------------
policy show to regularly audit access lists-r flagThis project is licensed under the AGPL-3.0 License. See the LICENSE file for details.