qscc

package
v1.0.0-preview Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2017 License: Apache-2.0 Imports: 10 Imported by: 298

Documentation

Index

Constants

View Source
const (
	GetChainInfo       string = "GetChainInfo"
	GetBlockByNumber   string = "GetBlockByNumber"
	GetBlockByHash     string = "GetBlockByHash"
	GetTransactionByID string = "GetTransactionByID"
	GetQueryResult     string = "GetQueryResult"
)

These are function names from Invoke first parameter

Variables

This section is empty.

Functions

This section is empty.

Types

type LedgerQuerier

type LedgerQuerier struct {
}

LedgerQuerier implements the ledger query functions, including: - GetChainInfo returns BlockchainInfo - GetBlockByNumber returns a block - GetBlockByHash returns a block - GetTransactionByID returns a transaction - GetQueryResult returns result of a freeform query

func (*LedgerQuerier) Init

Init is called once per chain when the chain is created. This allows the chaincode to initialize any variables on the ledger prior to any transaction execution on the chain.

func (*LedgerQuerier) Invoke

Invoke is called with args[0] contains the query function name, args[1] contains the chain ID, which is temporary for now until it is part of stub. Each function requires additional parameters as described below: # GetChainInfo: Return a BlockchainInfo object marshalled in bytes # GetBlockByNumber: Return the block specified by block number in args[2] # GetBlockByHash: Return the block specified by block hash in args[2] # GetTransactionByID: Return the transaction specified by ID in args[2] # GetQueryResult: Return the result of executing the specified native query string in args[2]. Note that this only works if plugged in database supports it. The result is a JSON array in a byte array. Note that error may be returned together with a valid partial result as error might occur during accummulating records from the ledger

Jump to

Keyboard shortcuts

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