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 não aceita quaisquer parâmetros
Devoluções
firstAvailable
cadeia de caracteres
Carregando...
Pedido
1pacote principal23importar (4"contexto"5"crypto/tls"6"fmt"7"registo"8"tempo"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 {30token cadeia de caracteres31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34retornar mapa[string]string{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credenciais.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...)52se err != nil {53log.Fatalf("Failed to connect: %v", err)54}55adiar conn.Fechar()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61se 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} caso contrário {68fmt.Println("No replay information available")69}70}71
1pacote principal23importar (4"contexto"5"crypto/tls"6"fmt"7"registo"8"tempo"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 {30token cadeia de caracteres31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34retornar mapa[string]string{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentials(credenciais.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...)52se err != nil {53log.Fatalf("Failed to connect: %v", err)54}55adiar conn.Fechar()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61se 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} caso contrário {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 função 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} else {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 função 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} else {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
Ainda não tem uma conta?
Crieendpoint seuendpoint Quicknode endpoint segundos e comece a desenvolver
Comece gratuitamente