subscribeReplayInfo gRPC Method - Solana gRPC
Solana gRPC is included with Scale and Business plans. On Build and Accelerate plans, it remains available via the Solana gRPC add-on.
Parâmetros
Este método não aceita quaisquer parâmetros
Devoluções
first_available
cadeia de caracteres
A carregar...
Pedido
1pacote principal23importar (4"contexto"5"crypto/tls"6"fmt"7"registo"8"time"910pb "yellowstone/proto"1112"google.golang.org/grpc"13"google.golang.org/grpc/credentials"14"google.golang.org/grpc/encoding/gzip"15"google.golang.org/grpc/keepalive"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:10000"20token = "YOUR_TOKEN_NUMBER"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30token string31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34return map[string]string{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return false41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credentials.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...)52if err != nil {53log.Fatalf("Failed to connect: %v", err)54}55defer conn.Close()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61if 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
1pacote principal23importar (4"contexto"5"crypto/tls"6"fmt"7"registo"8"time"910pb "yellowstone/proto"1112"google.golang.org/grpc"13"google.golang.org/grpc/credentials"14"google.golang.org/grpc/encoding/gzip"15"google.golang.org/grpc/keepalive"16)1718var (19endpoint = "YOUR_QN_ENDPOINT:10000"20token = "YOUR_TOKEN_NUMBER"21)2223var kacp = keepalive.ClientParameters{24Time: 10 * time.Second,25Timeout: time.Second,26PermitWithoutStream: true,27}2829type tokenAuth struct {30token string31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34return map[string]string{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return false41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credentials.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...)52if err != nil {53log.Fatalf("Failed to connect: %v", err)54}55defer conn.Close()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61if 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 = "YOUR_QN_ENDPOINT:10000";4const TOKEN = "YOUR_TOKEN_NUMBER";56async função main() {7const client = new Client(ENDPOINT, TOKEN, {});89try {10const response = await client.subscribeReplayInfo({});1112if (response.firstAvailable !== undefined) {13console.log("First available slot for replay:", response.firstAvailable);14} else {15console.log("No replay information available");16}1718} catch (error) {19console.error("Error getting replay info:", error);20}21}2223main()24.catch((err) => {25console.error("Unhandled error:", err);26process.exit(1);27});28
1import Client from "@triton-one/yellowstone-grpc";23const ENDPOINT = "YOUR_QN_ENDPOINT:10000";4const TOKEN = "YOUR_TOKEN_NUMBER";56async função main() {7const client = new Client(ENDPOINT, TOKEN, {});89try {10const response = await client.subscribeReplayInfo({});1112if (response.firstAvailable !== undefined) {13console.log("First available slot for replay:", response.firstAvailable);14} else {15console.log("No replay information available");16}1718} catch (error) {19console.error("Error getting replay info:", error);20}21}2223main()24.catch((err) => {25console.error("Unhandled error:", err);26process.exit(1);27});28
Ainda não tem uma conta?
Crie o seu ponto de extremidade Quicknode em segundos e comece a desenvolver
Comece gratuitamente