fab3

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const NetworkID = "fabevm"

Variables

View Source
var ZeroAddress = make([]byte, 20)

Functions

func NewRPCCodec

func NewRPCCodec() rpc.Codec

Types

type ChannelClient

type ChannelClient interface {
	Query(request channel.Request, options ...channel.RequestOption) (channel.Response, error)
	Execute(request channel.Request, options ...channel.RequestOption) (channel.Response, error)
}

type EthService

type EthService interface {
	GetCode(r *http.Request, arg *string, reply *string) error
	Call(r *http.Request, args *types.EthArgs, reply *string) error
	SendTransaction(r *http.Request, args *types.EthArgs, reply *string) error
	GetTransactionReceipt(r *http.Request, arg *string, reply *types.TxReceipt) error
	Accounts(r *http.Request, arg *string, reply *[]string) error
	EstimateGas(r *http.Request, args *types.EthArgs, reply *string) error
	GetBalance(r *http.Request, p *[]string, reply *string) error
	GetBlockByNumber(r *http.Request, p *[]interface{}, reply *types.Block) error
	BlockNumber(r *http.Request, _ *interface{}, reply *string) error
	GetTransactionByHash(r *http.Request, txID *string, reply *types.Transaction) error
	GetTransactionCount(r *http.Request, _ *interface{}, reply *string) error
	GetLogs(*http.Request, *types.GetLogsArgs, *[]types.Log) error
}

EthService is the rpc server implementation. Each function is an implementation of one ethereum json-rpc https://github.com/ethereum/wiki/wiki/JSON-RPC

Arguments and return values are formatted as HEX value encoding https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding

gorilla RPC is the receiver of these functions, they must all take three pointers, and return a single error

see godoc for RegisterService(receiver interface{}, name string) error

func NewEthService

func NewEthService(channelClient ChannelClient, ledgerClient LedgerClient, channelID string, ccid string, logger *zap.SugaredLogger) EthService

type Fab3

type Fab3 struct {
	RPCServer  *rpc.Server
	HTTPServer *http.Server
}

func NewFab3

func NewFab3(service EthService, port int) *Fab3

func (*Fab3) Shutdown

func (p *Fab3) Shutdown() error

func (*Fab3) Start

func (p *Fab3) Start() error

type LedgerClient

type LedgerClient interface {
	QueryInfo(options ...ledger.RequestOption) (*fab.BlockchainInfoResponse, error)
	QueryBlock(blockNumber uint64, options ...ledger.RequestOption) (*common.Block, error)
	QueryBlockByTxID(txid fab.TransactionID, options ...ledger.RequestOption) (*common.Block, error)
	QueryBlockByHash(blockHash []byte, options ...ledger.RequestOption) (*common.Block, error)
}

type NetService

type NetService struct {
}

NetService returns data about the network the client is connected to.

func (*NetService) Version

func (s *NetService) Version(r *http.Request, _ *interface{}, reply *string) error

Version takes no parameters and returns the network identifier.

https://github.com/ethereum/wiki/wiki/JSON-RPC#net_version

Directories

Path Synopsis
Package types contains the types used to interact with the json-rpc interface.
Package types contains the types used to interact with the json-rpc interface.

Jump to

Keyboard shortcuts

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