Documentation
¶
Index ¶
Constants ¶
View Source
const NetworkID = "fabric-evm"
Variables ¶
View Source
var ZeroAddress = make([]byte, 20)
Functions ¶
func NewRPCCodec ¶
func NewRPCCodec() rpc.Codec
Types ¶
type Block ¶
type Block struct { Number string `json:"number"` // number: QUANTITY - the block number. null when its pending block. Hash string `json:"hash"` // hash: DATA, 32 Bytes - hash of the block. null when its pending block. ParentHash string `json:"parentHash"` // parentHash: DATA, 32 Bytes - hash of the parent block. // size: QUANTITY - integer the size of this block in bytes. // timestamp: QUANTITY - the unix timestamp for when the block was collated. Transactions []interface{} `json:"transactions"` // transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter. }
Block is an eth return struct defined https://github.com/ethereum/wiki/wiki/JSON-RPC#returns-26
type ChannelClient ¶
type EthService ¶
type EthService interface { GetCode(r *http.Request, arg *string, reply *string) error Call(r *http.Request, args *EthArgs, reply *string) error SendTransaction(r *http.Request, args *EthArgs, reply *string) error GetTransactionReceipt(r *http.Request, arg *string, reply *TxReceipt) error Accounts(r *http.Request, arg *string, reply *[]string) error EstimateGas(r *http.Request, args *EthArgs, reply *string) error GetBalance(r *http.Request, p *[]string, reply *string) error GetBlockByNumber(r *http.Request, p *[]interface{}, reply *Block) error GetTransactionByHash(r *http.Request, txID *string, reply *Transaction) 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
func NewEthService ¶
func NewEthService(channelClient ChannelClient, ledgerClient LedgerClient, channelID string, ccid string, logger *zap.SugaredLogger) EthService
type FabProxy ¶
type FabProxy struct {
// contains filtered or unexported fields
}
func NewFabProxy ¶
func NewFabProxy(service EthService) *FabProxy
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) QueryTransaction(txid fab.TransactionID, options ...ledger.RequestOption) (*peer.ProcessedTransaction, error) }
type NetService ¶
type NetService struct { }
NetService returns data about the network the client is connected to.
type Transaction ¶
type Transaction struct { BlockHash string `json:"blockHash"` // DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. BlockNumber string `json:"blockNumber"` // QUANTITY - block number where this transaction was in. null when its pending. To string `json:"to"` // DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. // From is generated by EVM Chaincode. Until account generation // stabilizes, we are not returning a value. // // From can be gotten from the Signature on the Transaction Envelope // // From string `json:"from"` // DATA, 20 Bytes - address of the sender. Input string `json:"input"` // DATA - the data send along with the transaction. TransactionIndex string `json:"transactionIndex"` // QUANTITY - integer of the transactions index position in the block. null when its pending. Hash string `json:"hash"` //: DATA, 32 Bytes - hash of the transaction. }
Transaction represents an ethereum evm transaction.
type TxReceipt ¶
type TxReceipt struct { TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` ContractAddress string `json:"contractAddress"` GasUsed int `json:"gasUsed"` CumulativeGasUsed int `json:"cumulativeGasUsed"` To string `json:"to"` Logs []Log `json:"logs"` Status string `json:"status"` }
Click to show internal directories.
Click to hide internal directories.