client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchElem

type BatchElem struct {
	Method string
	Args   []interface{}
	Result interface{}
	Error  error
}

BatchElem is a struct to hold the elements of a BatchCall

type RPCClient

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

RPCClient is a wrapper around the geth RPC client

func NewRPCClient

func NewRPCClient(client *rpc.Client, rpcPath string) RPCClient

NewRPCClient creates a new RpcClient

func (RPCClient) BatchCall

func (client RPCClient) BatchCall(batch []BatchElem) error

BatchCall makes a batch RPC call to the node

func (RPCClient) CallContext

func (client RPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error

CallContext makes an rpc method call with the provided context and arguments

func (RPCClient) RPCPath

func (client RPCClient) RPCPath() string

RPCPath returns the RCClient's rpc path

func (RPCClient) Subscribe

func (client RPCClient) Subscribe(namespace string, payloadChan interface{}, args ...interface{}) (*rpc.ClientSubscription, error)

Subscribe subscribes to an rpc "namespace_subscribe" subscription with the given channel The first argument needs to be the method we wish to invoke

func (RPCClient) SupportedModules

func (client RPCClient) SupportedModules() (map[string]string, error)

SupportedModules returns the supported modules

Jump to

Keyboard shortcuts

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