GetExecutionResultForBlockID Access API Method
參數
BlockId
字串
必填
載入中...
退貨
execution_result
物件
載入中...
previous_result_id
字串
載入中...
block_id
字串
載入中...
chunks
陣列
載入中...
start_state
字串
載入中...
event_collection
字串
載入中...
block_id
字串
載入中...
number_of_transactions
整數
載入中...
end_state
字串
載入中...
execution_data_id
字串
載入中...
請求
1package main23import (4"context"5"encoding/hex"6"encoding/json"7"fmt"8"log"910"github.com/onflow/flow/protobuf/go/flow/access"11)1213func main() {1415// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.16client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")17ctx := context.Background()18if err != nil {19log.Fatalf("err: %v", err)20}2122blockid, err := hex.DecodeString("32e10a29b636e6c226183779ef4f8292975af0a6c3c6762c44c9da2c99a38953")23if err != nil {24log.Fatalf("err: %v", err)25}2627// get execution result for block ID28execResp, err := client.GetExecutionResultForBlockID(ctx, &access.GetExecutionResultForBlockIDRequest{BlockId: blockid})29if err != nil {30log.Fatal("Get Execution Result for Block ID failed: ", err)31}32respJSON, err := json.Marshal(execResp)33if err != nil {34log.Fatal("err: ", err)35}36fmt.Println("GetExecutionResultForBlockID response:", string(respJSON))3738}39
1package main23import (4"context"5"encoding/hex"6"encoding/json"7"fmt"8"log"910"github.com/onflow/flow/protobuf/go/flow/access"11)1213func main() {1415// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.16client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")17ctx := context.Background()18if err != nil {19log.Fatalf("err: %v", err)20}2122blockid, err := hex.DecodeString("32e10a29b636e6c226183779ef4f8292975af0a6c3c6762c44c9da2c99a38953")23if err != nil {24log.Fatalf("err: %v", err)25}2627// get execution result for block ID28execResp, err := client.GetExecutionResultForBlockID(ctx, &access.GetExecutionResultForBlockIDRequest{BlockId: blockid})29if err != nil {30log.Fatal("Get Execution Result for Block ID failed: ", err)31}32respJSON, err := json.Marshal(execResp)33if err != nil {34log.Fatal("err: ", err)35}36fmt.Println("GetExecutionResultForBlockID response:", string(respJSON))3738}39