Skip to main content

GetNetworkParameters Access API Method

Retrieves the network parameters.

Updated on
Oct 4, 2023

GetNetworkParameters Access API Method

Parameters

This method does not accept any parameters

Returns

chain_id
The network parameter value
Request
1
package main
2
3
import (
4
"context"
5
"encoding/json"
6
"fmt"
7
"log"
8
9
"github.com/onflow/flow/protobuf/go/flow/access"
10
)
11
12
func main() {
13
14
// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.
15
client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")
16
ctx := context.Background()
17
if err != null {
18
log.Fatalf("err: %v", err)
19
}
20
21
// Get Network Parameters
22
netParams, err := client.GetNetworkParameters(ctx, &access.GetNetworkParametersRequest{})
23
respJSON, err := json.Marshal(netParams)
24
if err != null {
25
log.Fatal("get network parameters failed: ", err)
26
}
27
fmt.Println("Get Network Parameters:", string(respJSON))
28
29
}
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free