GetLatestProtocolStateSnapshotRequest Access API Method
पैरामीटर
यह विधि किसी भी पैरामीटर को स्वीकार नहीं करती है।
रिटर्न
serializedSnapshot
लोड हो रहा है...
अनुरोध
1पैकेज मुख्य23आयात (4"प्रसंग"5"एनकोडिंग/जेसन"6"एफएमटी"78"github.com/onflow/flow/protobuf/go/flow/access"9)1011समारोह मुख्य ( ) {1213// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.14client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15ctx := context.Background()16यदि त्रुटि != शून्य {17log.Fatalf("err: %v", err)18}1920snapshotResp, err := client.GetLatestProtocolStateSnapshot(ctx, &access.GetLatestProtocolStateSnapshotRequest{})21यदि त्रुटि != शून्य {22log.Error("get latest protocol state snapshot failed: ", err)23} अन्य {24fmt.Printf("got latest protocol state snapshot: %s\n", snapshotResp.String())25}2627respJSON, err := json.Marshal(snapshotResp)28यदि त्रुटि != शून्य {29log.Fatal("Get Latest Protocol StateSnapshot failed: ", err)30}31fmt.Println("GetLatestProtocolStateSnapshot response:", string(respJSON))3233}
1पैकेज मुख्य23आयात (4"प्रसंग"5"एनकोडिंग/जेसन"6"एफएमटी"78"github.com/onflow/flow/protobuf/go/flow/access"9)1011समारोह मुख्य ( ) {1213// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.14client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15ctx := context.Background()16यदि त्रुटि != शून्य {17log.Fatalf("err: %v", err)18}1920snapshotResp, err := client.GetLatestProtocolStateSnapshot(ctx, &access.GetLatestProtocolStateSnapshotRequest{})21यदि त्रुटि != शून्य {22log.Error("get latest protocol state snapshot failed: ", err)23} अन्य {24fmt.Printf("got latest protocol state snapshot: %s\n", snapshotResp.String())25}2627respJSON, err := json.Marshal(snapshotResp)28यदि त्रुटि != शून्य {29log.Fatal("Get Latest Protocol StateSnapshot failed: ", err)30}31fmt.Println("GetLatestProtocolStateSnapshot response:", string(respJSON))3233}
अब तक कोई खाता नहीं है?
अपना बनाएँ Quicknode endpoint कुछ ही सेकंड में निर्माण शुरू करें
मुफ़्त में शुरुआत करें