subscribeReplayInfo gRPC Method - Solana gRPC
Solana gRPC is included with Scale plans and up. Learn more on our pricing page.
パラメータ
このメソッドはパラメータを受け付けません
返します
firstAvailable
文字列
読み込み中...
リクエスト
1パッケージ main23インポート (4「文脈」5"crypto/tls"6"fmt"7「ログ」8「時間」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 {30トークン 文字列31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34戻る map[文字列]文字列{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentialsWithTransportCredentials(credentials.NewTLS(&tls.設定{})),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...)52もし err != nil {53log.Fatalf("Failed to connect: %v", err)54}55延期 conn.閉じる()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61もし 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
1パッケージ main23インポート (4「文脈」5"crypto/tls"6"fmt"7「ログ」8「時間」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 {30トークン 文字列31}3233func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) {34戻る map[文字列]文字列{35"x-token": t.token,36}, nil37}3839func (tokenAuth) RequireTransportSecurity() bool {40return true41}4243func main() {44opts := []grpc.DialOption{45grpc.WithTransportCredentialsWithTransportCredentials(credentials.NewTLS(&tls.設定{})),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...)52もし err != nil {53log.Fatalf("Failed to connect: %v", err)54}55延期 conn.閉じる()5657client := pb.NewGeyserClient(conn)5859req := &pb.SubscribeReplayInfoRequest{}60resp, err := client.SubscribeReplayInfo(context.Background(), req)61もし 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 = "YOUR_TOKEN_NUMBER";56async 関数 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 関数 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