rpc

package
v0.0.0-...-f8b7a73 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

package rpc实现一个连接到集中模拟存储的rpc客户机。 中心化模拟存储可以是任何其他模拟存储实现,即 以mockstore名称注册到以太坊RPC服务器。定义的方法 mock.globalStore与rpc使用的相同。例子:

服务器:=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是一个连接到中央模拟商店的rpc.client。 关闭GlobalStore实例需要释放RPC客户端资源。

func NewGlobalStore

func NewGlobalStore(client *rpc.Client) *GlobalStore

NewGlobalStore创建了一个新的GlobalStore实例。

func (*GlobalStore) Close

func (s *GlobalStore) Close() error

关闭关闭RPC客户端。

func (*GlobalStore) Delete

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

delete向rpc服务器调用delete方法。

func (*GlobalStore) Get

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

get调用rpc服务器的get方法。

func (*GlobalStore) HasKey

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

haskey向RPC服务器调用haskey方法。

func (*GlobalStore) NewNodeStore

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

new nodestore返回一个新的nodestore实例,用于检索和存储 仅对地址为的节点进行数据块处理。

func (*GlobalStore) Put

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

将一个Put方法调用到RPC服务器。

Jump to

Keyboard shortcuts

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