getVersion gRPC Method
Please note that this RPC method requires the Yellowstone gRPC add-on enabled on your QuickNode endpoint.
Parameters
This method does not accept any parameters
Returns
version
object
The version object which contains the following fields:
package
string
Specifies the version of the yellowstone-grpc-geyser package being used
version
string
Indicates the plugin's version
proto
string
Version of the protocol buffer definition used by the Yellowstone gRPC plugin
solana
string
Specifies the version of the Solana blockchain that the plugin is compatible with
git
string
Provides the short hash of the Git commit from which this build was created
rustc
string
Version of the Rust compiler used to build the plugin
buildts
string
A timestamp indicating when this version was built
extra
object
The extra object which contains the following fields:
hostname
string
The hostname of the server or instance running the plugin
Request
1package main23import (4"context"5"crypto/tls"6"fmt"7"log"8"time"910pb "yellowstone/proto"111213"google.golang.org/grpc"14"google.golang.org/grpc/credentials"15"google.golang.org/grpc/encoding/gzip"16"google.golang.org/grpc/keepalive"17)1819// QuickNode endpoints consist of two crucial components: the endpoint name and the corresponding token20// For eg: QN Endpoint: https://docs-demo.solana-mainnet.quiknode.pro/abcde12345678921// endpoint will be: docs-demo.solana-mainnet.quiknode.pro:10000 {10000 is the port number for gRPC}22// token will be : abcde1234567892324var (25endpoint = "YOUR_QN_ENDPOINT:10000"26token = "YOUR_TOKEN_NUMBER"27)2829func main() {30opts := []grpc.DialOption{31grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),32grpc.WithKeepaliveParams(kacp),33grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Name)),34grpc.WithPerRPCCredentials(tokenAuth{token: token}),35}3637conn, err := grpc.NewClient(endpoint, opts...)38if err != null {39log.Fatalf("Failed to connect: %v", err)40}41defer conn.Close()4243client := pb.NewGeyserClient(conn)4445ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)46defer cancel()4748version, err := client.GetVersion(ctx, &pb.GetVersionRequest{})49if err != null {50log.Fatalf("Failed to get version: %v", err)51}5253fmt.Printf("Yellowstone gRPC Version:\n")54fmt.Printf(" GeyserGrpc: %s\n", version.GetVersion())5556}
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free