Skip to main content

Params gRPC Method

Loading...

Updated on
Jul 04, 2025

Params gRPC Method

Parameters

This method does not accept any parameters

Returns

params
object
Loading...
gas_per_blob_byte
integer
Loading...
gov_max_square_size
integer
Loading...
Request
1
package main
2
3
import (
4
"context"
5
"crypto/tls"
6
"encoding/json"
7
"fmt"
8
"log"
9
"time"
10
11
"google.golang.org/grpc"
12
"google.golang.org/grpc/credentials"
13
14
blobtypes "celestia-grpc/celestia/blob/v1"
15
)
16
17
// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token
18
// For eg: QN Endpoint: https://docs-demo.celestia-mainnet.quiknode.pro/abcde123456789
19
// endpoint will be: docs-demo.celestia-mainnet.quiknode.pro:9090 {9090 is the port number for Celestia gRPC}
20
// token will be : abcde123456789
21
22
var token = "YOUR_TOKEN"
23
var endpoint = "YOUR_ENDPOINT:9090"
24
25
type auth struct {
26
token string
27
}
28
29
func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
30
return map[string]string{
31
"x-token": a.token,
32
}, nil
33
}
34
35
func (a *auth) RequireTransportSecurity() bool {
36
return false
37
}
38
39
func main() {
40
opts := []grpc.DialOption{
41
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),
42
grpc.WithPerRPCCredentials(&auth{token}),
43
}
44
45
// Create gRPC connection
46
conn, err := grpc.Dial(endpoint, opts...)
47
if err != nil {
48
log.Fatalf("Failed to connect to Celestia gRPC server: %v", err)
49
}
50
defer conn.Close()
51
52
client := blobtypes.NewQueryClient(conn)
53
54
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
55
defer cancel()
56
57
resp, err := client.Params(ctx, &blobtypes.QueryParamsRequest{})
58
if err != nil {
59
log.Fatalf("Failed to query blob parameters: %v", err)
60
}
61
62
jsonData, err := json.MarshalIndent(resp.Params, "", " ")
63
if err != nil {
64
log.Printf("Error converting to JSON: %v", err)
65
} else {
66
fmt.Println("\nOutput:")
67
fmt.Println(string(jsonData))
68
}
69
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free