Documentation ¶
Index ¶
- Constants
- type LedgerQuerier
- func (e *LedgerQuerier) Chaincode() shim.Chaincode
- func (e *LedgerQuerier) Enabled() bool
- func (e *LedgerQuerier) Init(stub shim.ChaincodeStubInterface) pb.Response
- func (e *LedgerQuerier) InitArgs() [][]byte
- func (e *LedgerQuerier) InvokableCC2CC() bool
- func (e *LedgerQuerier) InvokableExternal() bool
- func (e *LedgerQuerier) Invoke(stub shim.ChaincodeStubInterface) pb.Response
- func (e *LedgerQuerier) Name() string
- func (e *LedgerQuerier) Path() string
Constants ¶
const ( GetChainInfo string = "GetChainInfo" GetBlockByNumber string = "GetBlockByNumber" GetBlockByHash string = "GetBlockByHash" GetTransactionByID string = "GetTransactionByID" GetBlockByTxID string = "GetBlockByTxID" )
These are function names from Invoke first parameter
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LedgerQuerier ¶
type LedgerQuerier struct {
// contains filtered or unexported fields
}
LedgerQuerier implements the ledger query functions, including: - GetChainInfo returns BlockchainInfo - GetBlockByNumber returns a block - GetBlockByHash returns a block - GetTransactionByID returns a transaction
func New ¶ added in v1.2.0
func New(aclProvider aclmgmt.ACLProvider) *LedgerQuerier
New returns an instance of QSCC. Typically this is called once per peer.
func (*LedgerQuerier) Chaincode ¶ added in v1.3.0
func (e *LedgerQuerier) Chaincode() shim.Chaincode
func (*LedgerQuerier) Enabled ¶ added in v1.3.0
func (e *LedgerQuerier) Enabled() bool
func (*LedgerQuerier) Init ¶
func (e *LedgerQuerier) Init(stub shim.ChaincodeStubInterface) pb.Response
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) InitArgs ¶ added in v1.3.0
func (e *LedgerQuerier) InitArgs() [][]byte
func (*LedgerQuerier) InvokableCC2CC ¶ added in v1.3.0
func (e *LedgerQuerier) InvokableCC2CC() bool
func (*LedgerQuerier) InvokableExternal ¶ added in v1.3.0
func (e *LedgerQuerier) InvokableExternal() bool
func (*LedgerQuerier) Invoke ¶
func (e *LedgerQuerier) Invoke(stub shim.ChaincodeStubInterface) pb.Response
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]
func (*LedgerQuerier) Name ¶ added in v1.3.0
func (e *LedgerQuerier) Name() string
func (*LedgerQuerier) Path ¶ added in v1.3.0
func (e *LedgerQuerier) Path() string