fab3

package module
v0.0.0-...-7bda249 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 28 Imported by: 7 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	NewFilter(*http.Request, *types.GetLogsArgs, *string) error
	UninstallFilter(*http.Request, *string, *bool) 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
Code generated by counterfeiter.
Code generated by counterfeiter.
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