subscribeReplayInfo gRPC Method - Solana gRPC
Solana gRPC is included with Scale plans and up. Learn more on our pricing page.
Paramètres
Cette méthode n'accepte aucun paramètre
Retours
firstAvailable
chaîne de caractères
Chargement en cours...
Demande
1paquet principal23import (4« contexte »5« crypto/tls »6« fmt »7« journal »8« temps »910pb "yellowstone/proto"1112« google.golang.grpc »13« google.golang.grpc »14"google.golang.org/grpc/encoding/gzip"15"google.golang.org/grpc/keepalive"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:443"20token = "YOUR_TOKEN_NUMBER"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30jeton chaîne de caractères31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34retour carte[chaîne]chaîne{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(informations d'authentification.NewTLS(&tls.Config{})),46grpc.WithKeepaliveParams(kacp),47grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Name)),48grpc.WithPerRPCCredentials(tokenAuth{token: token}),49}5051conn, err := grpc.NewClient(endpoint, opts...)52si err != nil {53log.Fatalf("Failed to connect: %v", err)54}55reporter conn.Fermer()5657client := 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} sinon {68fmt.Println("No replay information available")69}70}71
1paquet principal23import (4« contexte »5« crypto/tls »6« fmt »7« journal »8« temps »910pb "yellowstone/proto"1112« google.golang.grpc »13« google.golang.grpc »14"google.golang.org/grpc/encoding/gzip"15"google.golang.org/grpc/keepalive"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:443"20token = "YOUR_TOKEN_NUMBER"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30jeton chaîne de caractères31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34retour carte[chaîne]chaîne{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(informations d'authentification.NewTLS(&tls.Config{})),46grpc.WithKeepaliveParams(kacp),47grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Name)),48grpc.WithPerRPCCredentials(tokenAuth{token: token}),49}5051conn, err := grpc.NewClient(endpoint, opts...)52si err != nil {53log.Fatalf("Failed to connect: %v", err)54}55reporter conn.Fermer()5657client := 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} sinon {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 = "YOUR_TOKEN_NUMBER";56async fonction main() {7const client = new Client(ENDPOINT, TOKEN, {8grpcDefaultCompressionAlgorithm: 0, // 0 = gzip, 1 = zstd9});10await client.connect();1112try {13const response = await client.subscribeReplayInfo();1415if (response.firstAvailable !== undefined) {16console.log("First available slot for replay:", response.firstAvailable);17} sinon {18console.log("No replay information available");19}2021} catch (error) {22console.error("Error getting replay info:", error);23}24}2526main()27.catch((err) => {28console.error("Unhandled error:", err);29process.exit(1);30});31
1import Client from "@triton-one/yellowstone-grpc";23const ENDPOINT = "https://YOUR_QN_ENDPOINT:443";4const TOKEN = "YOUR_TOKEN_NUMBER";56async fonction main() {7const client = new Client(ENDPOINT, TOKEN, {8grpcDefaultCompressionAlgorithm: 0, // 0 = gzip, 1 = zstd9});10await client.connect();1112try {13const response = await client.subscribeReplayInfo();1415if (response.firstAvailable !== undefined) {16console.log("First available slot for replay:", response.firstAvailable);17} sinon {18console.log("No replay information available");19}2021} catch (error) {22console.error("Error getting replay info:", error);23}24}2526main()27.catch((err) => {28console.error("Unhandled error:", err);29process.exit(1);30});31
Vous n'avez pas encore de compte ?
Créez votreendpoint Quicknode endpoint quelques secondes et commencez à développer
Commencez gratuitement