rpc

package
v3.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: GPL-3.0, LGPL-3.0, LGPL-3.0-or-later Imports: 5 Imported by: 0

Documentation

Overview

Package rpc implements an RPC client that connect to a centralized mock store. Centralazied mock store can be any other mock store implementation that is registered to Ethereum RPC server under mockStore name. Methods that defines mock.GlobalStore are the same that are used by RPC. Example:

server := rpc.NewServer()
server.RegisterName("mockStore", mem.NewGlobalStore())

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalStore

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

GlobalStore is rpc.Client that connects to a centralized mock store. Closing GlobalStore instance is required to release RPC client resources.

func NewGlobalStore

func NewGlobalStore(client *rpc.Client) *GlobalStore

NewGlobalStore creates a new instance of GlobalStore.

func (*GlobalStore) Close

func (s *GlobalStore) Close() error

Close closes RPC client.

func (*GlobalStore) Get

func (s *GlobalStore) Get(addr common.Address, key []byte) (data []byte, err error)

Get calls a Get method to RPC server.

func (*GlobalStore) HasKey

func (s *GlobalStore) HasKey(addr common.Address, key []byte) bool

HasKey calls a HasKey method to RPC server.

func (*GlobalStore) NewNodeStore

func (s *GlobalStore) NewNodeStore(addr common.Address) *mock.NodeStore

NewNodeStore returns a new instance of NodeStore that retrieves and stores chunk data only for a node with address addr.

func (*GlobalStore) Put

func (s *GlobalStore) Put(addr common.Address, key []byte, data []byte) error

Put calls a Put method to RPC server.

Jump to

Keyboard shortcuts

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