### Launch helloworld_geyser with Example Credentials Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/python/README.md Run the helloworld_geyser script with example RPC endpoint and authentication token to fetch the latest slot number. ```bash (venv) $ python helloworld_geyser.py --rpc-fqdn 'index.rpcpool.com' --x-token '2625ae71-0823-41b3-b3bc-4ff89d762d52' ``` -------------------------------- ### Run Example Client Subscription Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md Run the TypeScript example client to subscribe to transactions for a specific token. Requires endpoint and X-Token authentication. ```bash tsx examples/typescript/src/client.ts --endpoint --x-token --commitment processed subscribe --transactions TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA ``` -------------------------------- ### Install and Build Project Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/docs/examples.md Installs dependencies and builds the project in development mode. Ensure Node.js v22.14.0 or later is installed. ```bash cd yellowstone-grpc-client-nodejs && npm install && npm build:dev ``` -------------------------------- ### Install Protobuf Go Plugins Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Install the necessary Go plugins for Protocol Buffers and gRPC. These plugins are required for generating Go code from .proto files. ```bash $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.35.1 $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1 ``` -------------------------------- ### Local Test Output Example Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/napi/README.md Example output from running local tests using ava. ```bash $ ava --verbose ✔ sync function from native code ✔ sleep function from native code (201ms) ─ 2 tests passed ✨ Done in 1.12s. ``` -------------------------------- ### Install Test Package Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/napi/README.md Install the test package using yarn. ```bash yarn add @napi-rs/package-template ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/python/README.md Create a virtual environment and install project dependencies using pip. ```bash python -m venv venv source venv/bin/activate (venv) $ python -m pip install -U pip (venv) $ python -m pip install -r requirements.txt ``` -------------------------------- ### Install Dependencies Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md Install required Node.js dependencies for the project. ```bash npm install ``` -------------------------------- ### Run TypeScript Client Example Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/docs/examples.md Executes a TypeScript client example to subscribe to block, slot, and transaction data. Replace placeholders with your actual endpoint and token if required. ```bash tsx src/client.ts --endpoint "YOUR ENDPOINT HERE WITH PORT" \ --x-token "USE YOUR TOKEN HERE IF NEEDED" \ --commitment processed subscribe \ --blocks --slots --transactions TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA ``` -------------------------------- ### Install Golang gRPC and Protobuf Packages (DNF) Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Install the Golang gRPC and Protobuf packages using the DNF package manager. This is an alternative method for setting up dependencies on systems that use DNF. ```bash dnf install golang-google-grpc golang-google-protobuf ``` -------------------------------- ### Example Client Output Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md This shows the output of the client when subscribing to account updates. It includes details about the opened stream and received account messages. ```shell $ cargo run --bin client -- --endpoint https://api.rpcpool.com --x-token subscribe --accounts --accounts-account SysvarC1ock11111111111111111111111111111111 Finished dev [unoptimized + debuginfo] target(s) in 0.69s Running `target/debug/client --accounts --account SysvarC1ock11111111111111111111111111111111` stream opened new message: SubscribeUpdate { filters: ["client"], update_oneof: Some(Account(SubscribeUpdateAccount { account: Some(SubscribeUpdateAccountInfo { pubkey: [6, 167, 213, 23, 24, 199, 116, 201, 40, 86, 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, 0, 0, 0], lamports: 1169280, owner: [6, 167, 213, 23, 24, 117, 247, 41, 199, 61, 147, 64, 143, 33, 97, 32, 6, 126, 216, 140, 118, 224, 140, 40, 127, 193, 148, 96, 0, 0, 0, 0], executable: false, rent_epoch: 0, data: [57, 29, 0, 0, 0, 0, 0, 0, 165, 160, 80, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 221, 189, 80, 99, 0, 0, 0, 0], write_version: 53718 }), slot: 7481, is_startup: false })) } new message: SubscribeUpdate { filters: ["client"], update_oneof: Some(Account(SubscribeUpdateAccount { account: Some(SubscribeUpdateAccountInfo { pubkey: [6, 167, 213, 23, 24, 199, 116, 201, 40, 86, 99, 152, 105, 29, 94, 182, 139, 94, 184, 163, 155, 75, 109, 92, 115, 85, 91, 33, 0, 0, 0, 0], lamports: 1169280, owner: [6, 167, 213, 23, 24, 117, 247, 41, 199, 61, 147, 64, 143, 33, 97, 32, 6, 126, 216, 140, 118, 224, 140, 40, 127, 193, 148, 96, 0, 0, 0, 0], executable: false, rent_epoch: 0, data: [58, 29, 0, 0, 0, 0, 0, 0, 165, 160, 80, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 222, 189, 80, 99, 0, 0, 0, 0], write_version: 53725 }), slot: 7482, is_startup: false })) } ^C ``` -------------------------------- ### Install Repository Pre-commit Hooks Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/README.md Installs Git pre-commit hooks for the repository. These hooks help maintain code quality and consistency. ```bash make install-hooks ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md Clean any existing build artifacts before starting local development. ```bash make clean ``` -------------------------------- ### Check Golang Protobuf and gRPC Versions Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Confirm the installed versions of the Go protobuf and gRPC libraries. These are essential dependencies for the gRPC client. ```bash go list -f '{{.Path}} {{.Version}}' -m google.golang.org/protobuf google.golang.org/protobuf v1.35.1 go list -f '{{.Path}} {{.Version}}' -m google.golang.org/grpc google.golang.org/grpc v1.67.1 ``` -------------------------------- ### Run Solana Validator with Geyser Plugin Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/README.md Starts the Solana validator and loads the Yellowstone gRPC geyser plugin. Ensure the configuration file path is correct. ```bash solana-validator --geyser-plugin-config yellowstone-grpc-geyser/config.json ``` -------------------------------- ### Subscribe to Slot Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to slot updates. This example uses a public endpoint and does not require a token. ```shell npm start -- --endpoint http://sg131.rpcpool.wg:10000 \ subscribe \ --slots ``` -------------------------------- ### Check Protobuf Compiler Version Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Verify that the Protocol Buffer compiler (protoc) is installed and check its version. This is a prerequisite for updating protofiles. ```bash $ protoc --version libprotoc 28.3 ``` -------------------------------- ### Unary GetBlockHeight Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Perform a unary call to get the current block height from the gRPC service. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ get-block-height ``` ```text response: 5188 ``` -------------------------------- ### Test in Local Environment Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/napi/README.md Commands to set up, build, and test the package locally. ```bash yarn yarn build yarn test ``` -------------------------------- ### Print helloworld_geyser Help Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/python/README.md Display the usage instructions and available options for the helloworld_geyser script. ```bash (venv) $ python helloworld_geyser.py --help ``` -------------------------------- ### Build Project on macOS (with dynamic lookup) Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md On macOS, you might need to run the build command with specific RUSTFLAGS to resolve dylibs at runtime and avoid linker failures. ```bash RUSTFLAGS="-Clink-arg=-undefined -Clink-arg=dynamic_lookup" npm run build ``` -------------------------------- ### Build Development Version of SDK Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md Build the development version of the SDK to reflect local changes during test runs. Use this instead of the regular 'build' command for local testing. ```bash npm run build:dev ``` -------------------------------- ### Build Project (TypeScript) Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/README.md Build the project, which generates the gRPC client and compiles TypeScript code. ```bash npm run build ``` -------------------------------- ### Run Golang gRPC Client with SSL Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Execute the Golang gRPC client using an SSL endpoint to fetch slot information. Ensure you have the correct endpoint and an authentication token. ```bash go run ./cmd/grpc-client/ -endpoint https://api.rpcpool.com:443 -x-token -slots ``` -------------------------------- ### Subscribe to Account Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Use this command to subscribe to real-time updates for specific Solana accounts. Replace '' with the actual account public key. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ subscribe \ --accounts --accounts-account "" ``` -------------------------------- ### Check Yellowstone gRPC Plugin Configuration Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/README.md Verifies the configuration file for the Yellowstone gRPC plugin. This command also checks code formatting. ```bash cargo-fmt && cargo run --bin config-check -- --config yellowstone-grpc-geyser/config.json ``` -------------------------------- ### Release Package Versioning Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-client-nodejs/napi/README.md Command to version the package for release. Ensure NPM_TOKEN is set in GitHub secrets. ```bash npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=] | from-git] git push ``` -------------------------------- ### Subscribe to Account Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to account updates by providing the endpoint, token, and the specific account public key. ```shell npm start -- --endpoint https://api.rpcpool.com \ --x-token "" \ subscribe \ --accounts --accounts-account "" ``` -------------------------------- ### Configure Limit Filters for gRPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/README.md This JSON configuration demonstrates how to set limits for various filters within the gRPC service. It allows for fine-grained control over the maximum number of accounts, transactions, or blocks, and specifies rejection criteria. ```json { "grpc": { "filters": { "accounts": { "max": 1, "any": false, "account_max": 10, "account_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "owner_max": 10, "owner_reject": ["11111111111111111111111111111111"] }, "slots": { "max": 1 }, "transactions": { "max": 1, "any": false, "account_include_max": 10, "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "account_exclude_max": 10, "account_required_max": 10 }, "blocks": { "max": 1, "account_include_max": 10, "account_include_any": false, "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "include_transactions": true, "include_accounts" : false, "include_entries" : false }, "blocks_meta": { "max": 1 }, "entry": { "max": 1 } } } } ``` -------------------------------- ### Unary GetVersion RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Retrieve version information for the Solana gRPC service. This includes client, proto, Solana, git, and rustc versions. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ get-version ``` ```text response: GetVersionResponse { version: "{\"version\":\"0.7.0+solana.1.15.2\",\"proto\":\"1.2.0+solana.1.15.2\",\"solana\":\"1.15.2\",\"git\":\"e03a47c-modified\",\"rustc\":\"1.68.0-nightly\",\"buildts\":\"2023-05-27T08:20:15.440278Z\"}" } ``` -------------------------------- ### Run Golang gRPC Client with Non-SSL Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/golang/README.md Execute the Golang gRPC client using a non-SSL endpoint to fetch block information. This is useful for development or environments where SSL is not required. ```bash go run ./cmd/grpc-client/ -endpoint http://api.rpcpool.com:80 -x-token -blocks ``` -------------------------------- ### Generate gRPC Service Stubs Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/python/README.md Generate Python stubs and data types for gRPC services using grpcio-tools. Ensure you are in the correct directory and specify the proto file paths. ```bash python -m grpc_tools.protoc -I../../yellowstone-grpc-proto/proto/ --python_out=. --pyi_out=. --grpc_python_out=. ../../yellowstone-grpc-proto/proto/* ``` -------------------------------- ### Subscribe to Slot Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md This command allows you to subscribe to new Solana slot updates. It's useful for tracking the progression of the blockchain. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ subscribe \ --slots ``` -------------------------------- ### Subscribe to Transaction Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Subscribe to transaction updates, with options to filter by vote transactions and include specific accounts. Use '' for account filtering. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ subscribe \ --transactions \ --transactions-vote false \ --transactions-failed false \ --transactions-account-include "" ``` -------------------------------- ### Unary GetVersion Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Retrieve the version information of the gRPC service using a unary call. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ get-version ``` ```text response: { version: "{\"version\":\"0.7.0+solana.1.15.2\",\"proto\":\"1.2.0+solana.1.15.2\",\"solana\":\"1.15.2\",\"git\":\"e03a47c-modified\",\"rustc\":\"1.68.0-nightly\",\"buildts\":\"2023-05-27T08:20:15.440278Z\"}" } ``` -------------------------------- ### Subscribe to Slot Updates with Commitment Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to slot updates with a specified commitment level, such as 'processed'. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ --commitment processed \ subscribe \ --slots ``` -------------------------------- ### Unary SubscribeReplayInfo Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to replay information from the gRPC service using a unary call. This provides the first available replay data. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ subscribe-replay-info ``` ```text response: { firstAvailable: '390356345' } ``` -------------------------------- ### Subscribe to Deshred Transaction Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Subscribe to deshredded transaction updates, which are available on Triton extension servers. This provides transaction data before Replay execution. Replace '' for account filtering. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ subscribe-deshred \ --vote false \ --account-include "" ``` -------------------------------- ### Subscribe to Slot Updates with Processed Commitment Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Subscribe to slot updates with a 'processed' commitment level. This provides faster, but less finalized, slot information. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ --commitment processed \ subscribe \ --slots ``` -------------------------------- ### Unary GetSlot RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Fetch the current slot number on the Solana network. This indicates the latest processed slot. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ get-slot ``` ```text response: GetSlotResponse { slot: 196214563 } ``` -------------------------------- ### Subscribe to Transaction Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to transaction updates, with options to filter vote transactions, failed transactions, and include specific accounts. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ subscribe \ --transactions \ --transactions-vote false \ --transactions-failed false \ --transactions-account-include "" ``` -------------------------------- ### Subscribe to Deshred Transaction Updates Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Subscribe to deshred transaction updates, with options for parsed data, vote filtering, and account inclusion. ```shell npm start -- -e="http://sg131.rpcpool.wg:10000" \ subscribeDeshred \ --deshred-parsed \ --deshred-vote=false \ --deshred-account-include "" ``` -------------------------------- ### Unary GetBlockHeight RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Query the current block height of the Solana network. This returns the total number of blocks processed. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ get-block-height ``` ```text response: GetBlockHeightResponse { block_height: 178985715 } ``` -------------------------------- ### Unary GetLatestBlockhash RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Retrieve the latest blockhash information from the Solana network. This includes the slot, blockhash, and last valid block height. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ get-latest-blockhash ``` ```text response: GetLatestBlockhashResponse { slot: 196214003, blockhash: "EYo9Ct3k8nPXJfFxcmEWxN59RuvLehQ7WKqmodBJ9cRf", last_valid_block_height: 178985293 } ``` -------------------------------- ### Unary Ping RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Send a ping request to the gRPC server and expect a PongResponse. This is a basic health check. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ ping ``` ```text response: PongResponse { count: 1 } ``` -------------------------------- ### Unary GetSlot Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Make a unary call to retrieve the current slot number from the gRPC service. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ get-slot ``` ```text response: 196214563 ``` -------------------------------- ### Unary GetLatestBlockhash Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Make a unary call to retrieve the latest blockhash information, including slot, blockhash, and last valid block height. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ get-latest-blockhash ``` ```text response: { slot: 5188, blockhash: '5N5v1HQq5EFui4yaPRBAN8cF23KWdJWhvvTnNu97JEH8', lastValidBlockHeight: 5175 } ``` -------------------------------- ### Unary IsBlockhashValid RPC Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/rust/README.md Check if a given blockhash is currently valid on the Solana network. Requires a blockhash as input. ```shell cargo run --bin client -- -e "https://api.rpcpool.com" \ --x-token "" \ is-blockhash-valid --blockhash "" ``` ```text response: IsBlockhashValidResponse { slot: 196214563, valid: true } ``` -------------------------------- ### Unary IsBlockhashValid Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Check if a given blockhash is valid by making a unary call. Requires the blockhash as a parameter. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ is-blockhash-valid --blockhash "" ``` ```text response: { slot: 196214563, valid: true } ``` -------------------------------- ### Unary Ping Call Source: https://github.com/rpcpool/yellowstone-grpc/blob/master/examples/typescript/README.md Perform a unary 'ping' call to the gRPC service to check connectivity. The response indicates success. ```shell npm start -- -e="https://api.rpcpool.com" \ --x-token "" \ ping ``` ```text response: 1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.