Yellowstone gRPC

If you're a customer of Solana dedicated node or clusterarrow-up-right, you have an access to Yellowstone gRPC endpoint already. This endpoint is mostly used to subscribe for events which are going on Solana network, such as transactions, votes, new blocks, program executions, etc.

It is the best option to receive transaction data as fast as possible. Compared to traditional WebSocket subscriptions, gRPC has minimal latency and maximum throughput.

How to test Yellowstone gRPC endpoint

  1. Install grpcurlarrow-up-right software onto your machine.

  2. Download Yellowstone gRPC proto files geyser.protoarrow-up-right, solana-storage.protoarrow-up-right (gRPC protocol needs to know methods and how to interact with them)

  3. Place these files to the folder from where you want to invoke grpcurl command.

  4. Grab your endpoint (i.e. sol-yellowstone-customer.rpcfast.net) and your token, which you have received when you ordered the node.

  5. From terminal, launch the command to show the current slot number of the node.

    {% code overflow="wrap" %}

    X_TOKEN="YOUR-TOKEN"
    YELLOWSTONE_ENDPOINT="YOUR-YELLOWSTONE-GRPC-ENDPOINT"
    
    grpcurl \
      -proto geyser.proto \
      -H "x-token: ${X_TOKEN}" \
      ${YELLOWSTONE_ENDPOINT} geyser.Geyser/GetSlot

    {% endcode %}

  6. To test subcription to events, let's take a look at an example of subscribing to transactions on Pump.fun with "processed" commitment level:

    {% code overflow="wrap" %}

    X_TOKEN="YOUR-TOKEN"
    YELLOWSTONE_ENDPOINT="YOUR-YELLOWSTONE-GRPC-ENDPOINT"
    
    grpcurl \
      -proto geyser.proto \
      -H "x-token: ${X_TOKEN}" \
      -d '{
            "transactions": {
              "pumpfun": {
                "account_include": ["6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"]
              }
            },
            "commitment": 0
          }' \
      "${YELLOWSTONE_ENDPOINT}" geyser.Geyser/Subscribe

    {% endcode %}7. For further usage with your applications, please refer to examples, written in Go, Rust and Node: https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/golangarrow-up-right https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/rustarrow-up-right https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/typescriptarrow-up-right

  7. Also please refer to official documentation for advanced usage: https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptionsarrow-up-right

Last updated