rpc

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CosmosNamespace = "cosmos"

	Web3Namespace     = "web3"
	EthNamespace      = "eth"
	PersonalNamespace = "personal"
	NetNamespace      = "net"
	TxPoolNamespace   = "txpool"
	DebugNamespace    = "debug"
	MinerNamespace    = "miner"
)

RPC namespaces and API version

Variables

This section is empty.

Functions

func BuildRPCs added in v0.7.0

func BuildRPCs(
	selectedAPIs []string,
	ctx *server.Context,
	clientCtx client.Context,
	stream *stream.RPCStream,
	backend backend.BackendI,
) []rpc.API

BuildRPCs builds the JSON-RPC APIs for the given namespaces.

func RegisterAPINamespace

func RegisterAPINamespace(ns string, creator APICreator) error

RegisterAPINamespace registers a new API namespace with the API creator. This function fails if the namespace is already registered.

Types

type APICreator

type APICreator = func(
	ctx *server.Context,
	clientCtx client.Context,
	stream *stream.RPCStream,
	backend backend.BackendI,
) []rpc.API

APICreator creates the JSON-RPC API implementations.

type ErrorMessageJSON

type ErrorMessageJSON struct {
	Code    *big.Int `json:"code"`
	Message string   `json:"message"`
}

type ErrorResponseJSON

type ErrorResponseJSON struct {
	Jsonrpc string            `json:"jsonrpc"`
	Error   *ErrorMessageJSON `json:"error"`
	ID      *big.Int          `json:"id"`
}

type SubscriptionNotification

type SubscriptionNotification struct {
	Jsonrpc string              `json:"jsonrpc"`
	Method  string              `json:"method"`
	Params  *SubscriptionResult `json:"params"`
}

type SubscriptionResponseJSON

type SubscriptionResponseJSON struct {
	Jsonrpc string  `json:"jsonrpc"`
	Result  any     `json:"result"`
	ID      float64 `json:"id"`
}

type SubscriptionResult

type SubscriptionResult struct {
	Subscription rpc.ID `json:"subscription"`
	Result       any    `json:"result"`
}

type WebsocketsServer

type WebsocketsServer interface {
	Start()
}

func NewWebsocketsServer

func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, stream *stream.RPCStream, cfg *config.Config) WebsocketsServer

Jump to

Keyboard shortcuts

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