yellowstone-shield-cli

Crates.ioyellowstone-shield-cli
lib.rsyellowstone-shield-cli
version0.6.0
created_at2025-06-19 12:20:47.657075+00
updated_at2025-07-16 16:25:02.105101+00
descriptionYellowstone Shield CLI
homepage
repositoryhttps://github.com/rpcpool/yellowstone-shield
max_upload_size
id1718292
size240,275
Leafaar (leafaar)

documentation

README

Yellowstone Shield CLI

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

To install the CLI, ensure you have Rust and Cargo installed on your system. Then, clone the repository and build the project:

git clone https://github.com/rpcpool/yellowstone-shield
cd yellowstone-shield
cargo build --release --bin yellowstone-shield-cli

The binary should be located at ./target/release/yellowstone-shield-cli.

Usage

The CLI provides several commands to interact with the shield policies and identities. Below are the available commands and their options:

General Options

  • -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.

Commands

  • Create a Policy

    yellowstone-shield-cli policy create [OPTIONS] --strategy <STRATEGY> --name <NAME> --symbol <SYMBOL> --uri <URI>
    
    • -r, --rpc <RPC>: RPC endpoint URL to override using the Solana config.
    • --strategy <STRATEGY>: The strategy to use for the policy. Valid options are 'allow' or 'deny'.
    • -l, --log-level <LOG_LEVEL>: Log level (default is "off").
    • --name <NAME>: The name of the policy.
    • -k, --keypair <KEYPAIR>: Path to the local owner keypair file -- not a hardware wallet.
    • --symbol <SYMBOL>: The symbol of the policy.
    • --uri <URI>: The URI of the policy.
    • -h, --help: Print help.

After creating a new Policy, you will receive CLI output including the Mint address required in the following steps.

  • Add Identities

    yellowstone-shield-cli identities add --mint <MINT> --identities-path <IDENTITIES>
    
    • --mint <MINT>: The mint address linked to the shield policy.
    • --identities-path <IDENTITIES>: File path to a list of public keys, each on a new line, to be added.
  • Update Identities

    yellowstone-shield-cli identities update --mint <MINT> --identities-path <IDENTITIES>
    
    • --mint <MINT>: The mint address linked to the shield policy.
    • --identities-path <IDENTITIES>: File path to a list of public keys, each on a new line, to be updated/replaced.
  • Remove Identities

    yellowstone-shield-cli identities remove --mint <MINT> --identities-path <IDENTITIES>
    
    • --mint <MINT>: The mint address linked to the shield policy.
    • --identities-path <IDENTITIES>: File path to a list of public keys, each on a new line, to be removed.

Configuration

The CLI uses the Solana CLI configuration file to manage RPC endpoints and keypair paths. You can override these settings using the command-line options provided.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or support, please open an issue on github.

Commit count: 32

cargo fmt