solana-go/rpc/getBlockHeight.go

19 lines
376 B
Go
Raw Normal View History

2021-07-01 03:15:27 -07:00
package rpc
import (
"context"
)
// GetBlockHeight returns the current block height of the node.
func (cl *Client) GetBlockHeight(
ctx context.Context,
commitment CommitmentType,
) (out uint64, err error) {
params := []interface{}{}
if commitment != "" {
params = append(params, commitment)
}
err = cl.rpcClient.CallFor(&out, "getBlockHeight", params...)
return
}