rpc

package
v0.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEndpoint = fmt.Sprintf("http://localhost:%d", seiconfig.PortRPC)

DefaultEndpoint is the local CometBFT RPC address.

Functions

This section is empty.

Types

type NodeStatus

type NodeStatus struct {
	LatestBlockHeight int64
	CatchingUp        bool
}

NodeStatus holds the fields we care about from CometBFT /status.

type StatusClient

type StatusClient struct {
	// contains filtered or unexported fields
}

StatusClient queries a CometBFT node's /status endpoint.

func NewStatusClient

func NewStatusClient(endpoint string, httpClient *http.Client) *StatusClient

NewStatusClient creates a client targeting the given RPC endpoint. Pass "" for the default localhost endpoint.

func (*StatusClient) Endpoint

func (c *StatusClient) Endpoint() string

Endpoint returns the configured RPC endpoint.

func (*StatusClient) LatestHeight

func (c *StatusClient) LatestHeight(ctx context.Context) (int64, error)

LatestHeight is a convenience wrapper returning just the height.

func (*StatusClient) Status

func (c *StatusClient) Status(ctx context.Context) (*NodeStatus, error)

Status queries the node and returns the parsed status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL