rpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package rpc contains RPC handler methods and utilities to start reasurenet's Web3-compatibly JSON-RPC server.

Package rpc contains RPC handler methods, namespaces and utilities to start Treasurenet's Web3-compatible JSON-RPC server.

The list of available namespaces are:

* `rpc/namespaces/eth`: `eth` namespace. Exposes the `PublicEthereumAPI` and the `PublicFilterAPI`. * `rpc/namespaces/personal`: `personal` namespace. Exposes the `PrivateAccountAPI`. * `rpc/namespaces/net`: `net` namespace. Exposes the `PublicNetAPI`. * `rpc/namespaces/web3`: `web3` namespace. Exposes the `PublicWeb3API`

Index

Constants

View Source
const (
	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 GetRPCAPIs

func GetRPCAPIs(ctx *server.Context, clientCtx client.Context, tmWSClient *rpcclient.WSClient, selectedAPIs []string) []rpc.API

GetRPCAPIs returns the list of all APIs

Types

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  interface{} `json:"result"`
	ID      float64     `json:"id"`
}

type SubscriptionResult

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

type WebsocketsServer

type WebsocketsServer interface {
	Start()
}

func NewWebsocketsServer

func NewWebsocketsServer(logger log.Logger, tmWSClient *rpcclient.WSClient, rpcAddr, wsAddr string) WebsocketsServer

Directories

Path Synopsis
namespaces
eth
net

Jump to

Keyboard shortcuts

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