getVersion gRPC Method - Solana gRPC
Solana gRPC está incluido en los planes Scale y Business. En los planes Build y Accelerate, sigue estando disponible a través del complemento Solana gRPC.
Parámetros
Este método no admite ningún parámetro
Devoluciones
versión
objeto
Cargando...
package
cadena
Cargando...
versión
cadena
Cargando...
proto
cadena
Cargando...
solana
cadena
Cargando...
git
cadena
Cargando...
rustc
cadena
Cargando...
buildts
cadena
Cargando...
extra
objeto
Cargando...
hostname
cadena
Cargando...
Solicitud
1paquete principal23import (4«contexto»5«crypto/tls»6«fmt»7«registro»8«tiempo»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 (25punto final = "TU_QN_ENDPOINT:10000"26token = "TU_NÚMERO_DE_TOKEN"27)2829func main() {30opts := []grpc.DialOption{31grpc.WithTransportCredentials(credenciales.NewTLS(&tls.Config{})),32grpc.WithKeepaliveParams(kacp),33grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Nombre)),34grpc.WithPerRPCCredentials(tokenAuth{token: token}),35}3637conn, err := grpc.NewClient(punto de conexión, opts...)38si err != nil {39registro.Fatalf(«Error al conectarse: %v», err)40}41aplazar conn.Cerrar()4243cliente := pb.NewGeyserClient(conn)4445ctx, cancel := contexto.WithTimeout(contexto.Background(), 10*vez.Segundo)46aplazar cancelar()4748version, err := client.GetVersion(ctx, &pb.GetVersionRequest{})49si err != nil {50log.Fatalf("Failed to get version: %v", err)51}5253fmt.Printf("Yellowstone gRPC Version:\n")54fmt.Printf(" GeyserGrpc: %s\n", version.GetVersion())5556}
1paquete principal23import (4«contexto»5«crypto/tls»6«fmt»7«registro»8«tiempo»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 (25punto final = "TU_QN_ENDPOINT:10000"26token = "TU_NÚMERO_DE_TOKEN"27)2829func main() {30opts := []grpc.DialOption{31grpc.WithTransportCredentials(credenciales.NewTLS(&tls.Config{})),32grpc.WithKeepaliveParams(kacp),33grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Nombre)),34grpc.WithPerRPCCredentials(tokenAuth{token: token}),35}3637conn, err := grpc.NewClient(punto de conexión, opts...)38si err != nil {39registro.Fatalf(«Error al conectarse: %v», err)40}41aplazar conn.Cerrar()4243cliente := pb.NewGeyserClient(conn)4445ctx, cancel := contexto.WithTimeout(contexto.Background(), 10*vez.Segundo)46aplazar cancelar()4748version, err := client.GetVersion(ctx, &pb.GetVersionRequest{})49si err != nil {50log.Fatalf("Failed to get version: %v", err)51}5253fmt.Printf("Yellowstone gRPC Version:\n")54fmt.Printf(" GeyserGrpc: %s\n", version.GetVersion())5556}
1import Client from "@triton-one/yellowstone-grpc";23// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token4// For eg: QN Endpoint: https://docs-demo.solana-mainnet.quiknode.pro/abcde1234567895// endpoint will be: docs-demo.solana-mainnet.quiknode.pro:10000 {10000 is the port number for gRPC}6// token will be : abcde12345678978const PUNTO FINAL = "TU_QN_ENDPOINT:10000";9const TOKEN = "TU_NÚMERO_DE_TOKEN";1011asíncrono función main() {12const client = new Client(ENDPOINT, TOKEN, {});1314prueba {15const version = await client.getVersion();16console.log("Solana Version Information:");17console.log(`getVersion: ${version}`);18} catch (error) {19console.error("Error fetching version:", error);20}21}2223principal()24.captura((err) => {25consola.error(«Error no gestionado:», err);26proceso.salir(1);27});
1import Client from "@triton-one/yellowstone-grpc";23// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token4// For eg: QN Endpoint: https://docs-demo.solana-mainnet.quiknode.pro/abcde1234567895// endpoint will be: docs-demo.solana-mainnet.quiknode.pro:10000 {10000 is the port number for gRPC}6// token will be : abcde12345678978const PUNTO FINAL = "TU_QN_ENDPOINT:10000";9const TOKEN = "TU_NÚMERO_DE_TOKEN";1011asíncrono función main() {12const client = new Client(ENDPOINT, TOKEN, {});1314prueba {15const version = await client.getVersion();16console.log("Solana Version Information:");17console.log(`getVersion: ${version}`);18} catch (error) {19console.error("Error fetching version:", error);20}21}2223principal()24.captura((err) => {25consola.error(«Error no gestionado:», err);26proceso.salir(1);27});
¿Aún no tienes una cuenta?
Crea tu punto de conexión de Quicknode en cuestión de segundos y empieza a desarrollar
Empieza gratis