subscribeReplayInfo gRPC Method - Solana gRPC
Solana gRPC is included with Scale plans and up. Learn more on our pricing page.
Parámetros
Este método no admite ningún parámetro
Devoluciones
firstAvailable
cadena
Cargando...
Solicitud
1paquete principal23import (4«contexto»5«crypto/tls»6«fmt»7«registro»8«tiempo»910pb «yellowstone»1112"google.golang.grpc"13"google.golang.grpc"14"google.golang.grpc"15"google.golang.grpc"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:443"20token = "TU_NÚMERO_DE_TOKEN"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30token cadena31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34volver mapa[cadena]cadena{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credenciales.NewTLS(&tls.Config{})),46grpc.WithKeepaliveParams(kacp),47grpc.WithDefaultCallOptions((grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Nombre)),48grpc.WithPerRPCCredentials(tokenAuth{token: token}),49}5051conn, err := grpc.NewClient(endpoint, opts...)52si err != nil {53registro.Fatalf(«Error al conectarse: %v», err)54}55aplazar conn.Cerrar()5657cliente := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61si err != nil {62log.Fatalf("Failed to get replay info: %v", err)63}6465if resp.FirstAvailable != nil {66fmt.Printf("First available slot for replay: %d\n", *resp.FirstAvailable)67} else {68fmt.Println("No replay information available")69}70}71
1paquete principal23import (4«contexto»5«crypto/tls»6«fmt»7«registro»8«tiempo»910pb «yellowstone»1112"google.golang.grpc"13"google.golang.grpc"14"google.golang.grpc"15"google.golang.grpc"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:443"20token = "TU_NÚMERO_DE_TOKEN"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30token cadena31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34volver mapa[cadena]cadena{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credenciales.NewTLS(&tls.Config{})),46grpc.WithKeepaliveParams(kacp),47grpc.WithDefaultCallOptions((grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Nombre)),48grpc.WithPerRPCCredentials(tokenAuth{token: token}),49}5051conn, err := grpc.NewClient(endpoint, opts...)52si err != nil {53registro.Fatalf(«Error al conectarse: %v», err)54}55aplazar conn.Cerrar()5657cliente := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61si err != nil {62log.Fatalf("Failed to get replay info: %v", err)63}6465if resp.FirstAvailable != nil {66fmt.Printf("First available slot for replay: %d\n", *resp.FirstAvailable)67} else {68fmt.Println("No replay information available")69}70}71
1import Client from "@triton-one/yellowstone-grpc";23const ENDPOINT = "https://YOUR_QN_ENDPOINT:443";4const TOKEN = "TU_NÚMERO_DE_TOKEN";56asíncrono función main() {7const client = new Client(ENDPOINT, TOKEN, {8grpcDefaultCompressionAlgorithm: 0, // 0 = gzip, 1 = zstd9});10await client.connect();1112prueba {13const response = await client.subscribeReplayInfo();1415if (response.firstAvailable !== undefined) {16console.log("First available slot for replay:", response.firstAvailable);17} else {18console.log("No replay information available");19}2021} catch (error) {22console.error("Error getting replay info:", error);23}24}2526principal()27.captura((err) => {28consola.error(«Error no gestionado:», err);29proceso.salir(1);30});31
1import Client from "@triton-one/yellowstone-grpc";23const ENDPOINT = "https://YOUR_QN_ENDPOINT:443";4const TOKEN = "TU_NÚMERO_DE_TOKEN";56asíncrono función main() {7const client = new Client(ENDPOINT, TOKEN, {8grpcDefaultCompressionAlgorithm: 0, // 0 = gzip, 1 = zstd9});10await client.connect();1112prueba {13const response = await client.subscribeReplayInfo();1415if (response.firstAvailable !== undefined) {16console.log("First available slot for replay:", response.firstAvailable);17} else {18console.log("No replay information available");19}2021} catch (error) {22console.error("Error getting replay info:", error);23}24}2526principal()27.captura((err) => {28consola.error(«Error no gestionado:», err);29proceso.salir(1);30});31
¿Aún no tienes una cuenta?
Crea tuendpoint Quicknode endpoint segundos y empieza a desarrollar
Empieza gratis