Yellowstone Shield CLI
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.
Overview
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.
Installation
Prerequisites
- Rust and Cargo (latest stable version)
- Solana CLI tools configured with a valid RPC endpoint
- A funded Solana wallet for transaction fees
Build from Source
The binary will be available at target/release/yellowstone-shield-cli
Configuration
The CLI uses your Solana CLI configuration by default. Ensure you have:
# Set your RPC endpoint
# Set your keypair
The binary should be located at ./target/release/yellowstone-shield-cli.
Usage
Global Options
-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")
Policy Commands
-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.
Metadata
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 Policy
Create a new access control policy with metadata:
# Create an Allow policy
# Create a Deny policy (blocklist)
Parameters:
--strategy- Permission strategy:Allow(whitelist) orDeny(blocklist)--name- Human-readable policy name--symbol- Short identifier (like a token symbol)--uri- Metadata URI for additional policy information
Show Policy Details
Display policy information and list all authorized identities:
Delete a Policy
Remove a policy (requires ownership):
Identity Management Commands
Add Identities
Add authorized identities to a policy from a file:
# Create a file with pubkeys (one per line)
# Add all identities to the policy
The command will:
- Skip identities that are already in the policy
- Process additions in batches of 20 for efficiency
- Show transaction signatures for each batch
Remove Identities
Remove identities from a policy:
# Create a file with pubkeys to remove
Example Workflows
1. Validator Access Control
Create a whitelist for authorized validators:
# Create policy
# Note the mint address from output
# Add validators
2. Program Blocklist
Create a blocklist for restricted programs:
# Create deny policy
# Add restricted program IDs
3. Dynamic Access Management
Update access lists programmatically:
#!/bin/bash
POLICY_MINT="7xKXtg2CW87d7TXQ3xgBwSEGD6YA1F3PtdxqMtfqdW4m"
# Add new validators
# Remove deactivated validators
# Show current state
Output Format
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
--------------------------------
Best Practices
- Batch Operations: When adding/removing many identities, use files to batch operations
- Backup Mint Addresses: Save policy mint addresses for future reference
- Metadata URIs: Host policy metadata on IPFS or Arweave for permanence
- Access Strategy: Choose between Allow (whitelist) and Deny (blocklist) based on your security model
- Regular Audits: Use
policy showto regularly audit access lists
Troubleshooting
Common Issues
- Insufficient SOL: Ensure your wallet has enough SOL for transaction fees
- RPC Errors: Try using a different RPC endpoint with
-rflag - Large Identity Lists: Files are processed in batches of 20 to avoid transaction size limits
- Permission Errors: Only the policy owner can modify identities
License
This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.