Documentation
¶
Index ¶
- func Rwset(res storage.ReadWriteSet) *kvrwset.KVRWSet
- type ChaincodeExecutor
- type Client
- func (c Client) Close() error
- func (c Client) EndorseAndSubmit(channel, namespace string, rw *kvrwset.KVRWSet) (string, error)
- func (c Client) Query(channel, namespace, fn string, args [][]byte) (*peer.ProposalResponse, error)
- func (c Client) TransactionByID(channel, id string) (*peer.ProcessedTransaction, error)
- type ClientIdentity
- func (c ClientIdentity) AssertAttributeValue(attrName string, attrValue string) error
- func (c ClientIdentity) GetAttributeValue(attrName string) (value string, found bool, err error)
- func (c ClientIdentity) GetID() (string, error)
- func (c ClientIdentity) GetMSPID() (string, error)
- func (c ClientIdentity) GetX509Certificate() (*x509.Certificate, error)
- type FabricStub
- type TransactionContext
- type UnimplementedStub
- func (s UnimplementedStub) CreateCompositeKey(objectType string, attributes []string) (string, error)
- func (s UnimplementedStub) DelPrivateData(collection string, key string) error
- func (s UnimplementedStub) FinishWriteBatch() error
- func (s UnimplementedStub) GetAllStatesCompositeKeyWithPagination(pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- func (s UnimplementedStub) GetArgs() [][]byte
- func (s UnimplementedStub) GetArgsSlice() ([]byte, error)
- func (s UnimplementedStub) GetBinding() ([]byte, error)
- func (s UnimplementedStub) GetChannelID() string
- func (s UnimplementedStub) GetCreator() ([]byte, error)
- func (s UnimplementedStub) GetDecorations() map[string][]byte
- func (s UnimplementedStub) GetFunctionAndParameters() (string, []string)
- func (s UnimplementedStub) GetHistoryForKey(key string) (shim.HistoryQueryIteratorInterface, error)
- func (s UnimplementedStub) GetMultiplePrivateData(collection string, keys ...string) ([][]byte, error)
- func (s UnimplementedStub) GetMultipleStates(keys ...string) ([][]byte, error)
- func (s UnimplementedStub) GetPrivateData(collection string, key string) ([]byte, error)
- func (s UnimplementedStub) GetPrivateDataByPartialCompositeKey(collection string, objectType string, keys []string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetPrivateDataByRange(collection string, startKey string, endKey string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetPrivateDataHash(collection string, key string) ([]byte, error)
- func (s UnimplementedStub) GetPrivateDataQueryResult(collection string, query string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetPrivateDataValidationParameter(collection string, key string) ([]byte, error)
- func (s UnimplementedStub) GetQueryResult(query string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetQueryResultWithPagination(query string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- func (s UnimplementedStub) GetSignedProposal() (*peer.SignedProposal, error)
- func (s UnimplementedStub) GetStateByPartialCompositeKey(objectType string, keys []string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetStateByPartialCompositeKeyWithPagination(objectType string, keys []string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- func (s UnimplementedStub) GetStateByRange(startKey string, endKey string) (shim.StateQueryIteratorInterface, error)
- func (s UnimplementedStub) GetStateByRangeWithPagination(startKey string, endKey string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- func (s UnimplementedStub) GetStateValidationParameter(key string) ([]byte, error)
- func (s UnimplementedStub) GetStringArgs() []string
- func (s UnimplementedStub) GetTransient() (map[string][]byte, error)
- func (s UnimplementedStub) GetTxID() string
- func (s UnimplementedStub) GetTxTimestamp() (*timestamppb.Timestamp, error)
- func (s UnimplementedStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response
- func (s UnimplementedStub) PurgePrivateData(collection string, key string) error
- func (s UnimplementedStub) PutPrivateData(collection string, key string, value []byte) error
- func (s UnimplementedStub) SetEvent(name string, payload []byte) error
- func (s UnimplementedStub) SetPrivateDataValidationParameter(collection string, key string, ep []byte) error
- func (s UnimplementedStub) SetStateValidationParameter(key string, ep []byte) error
- func (s UnimplementedStub) SplitCompositeKey(compositeKey string) (string, []string, error)
- func (s UnimplementedStub) StartWriteBatch()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChaincodeExecutor ¶
type ChaincodeExecutor struct {
// contains filtered or unexported fields
}
func NewChaincodeExecutor ¶
func NewChaincodeExecutor(namespace string, db *storage.VersionedDB) *ChaincodeExecutor
func (ChaincodeExecutor) NewTransaction ¶
func (e ChaincodeExecutor) NewTransaction() (*TransactionContext, error)
type Client ¶
type Client struct {
Peer *comm.Peer
Orderer *comm.Orderer
Committer *committer.Committer
DB *storage.VersionedDB
Submitter fabrictx.Signer
Endorsers []fabrictx.Signer
}
func NewClientForFabricSamples ¶
func NewClientForFabricSamples(ctx context.Context, samplesDir string, db *storage.VersionedDB, logger committer.Logger) (*Client, error)
NewClientForFabricSamples returns a client for integration testing with access to a peer, orderer and local committer. It follows the directory structure of a fabric samples test network.
func (Client) EndorseAndSubmit ¶
EndorseAndSubmit creates a transaction out of a read/write set and endorses it with the configured endorser keys.
func (Client) TransactionByID ¶
func (c Client) TransactionByID(channel, id string) (*peer.ProcessedTransaction, error)
TransactionByID retrieves a specific transaction from the peer.
type ClientIdentity ¶
type ClientIdentity struct{}
ClientIdentity would be extracted from the input EndorserTransaction. See: github.com/hyperledger/fabric-chaincode-go/shim/stub.go
func (ClientIdentity) AssertAttributeValue ¶
func (c ClientIdentity) AssertAttributeValue(attrName string, attrValue string) error
AssertAttributeValue implements cid.ClientIdentity.
func (ClientIdentity) GetAttributeValue ¶
func (c ClientIdentity) GetAttributeValue(attrName string) (value string, found bool, err error)
GetAttributeValue implements cid.ClientIdentity.
func (ClientIdentity) GetID ¶
func (c ClientIdentity) GetID() (string, error)
GetID implements cid.ClientIdentity.
func (ClientIdentity) GetMSPID ¶
func (c ClientIdentity) GetMSPID() (string, error)
GetMSPID implements cid.ClientIdentity.
func (ClientIdentity) GetX509Certificate ¶
func (c ClientIdentity) GetX509Certificate() (*x509.Certificate, error)
GetX509Certificate implements cid.ClientIdentity.
type FabricStub ¶
type FabricStub struct {
storage.SimulationStore
UnimplementedStub
}
type TransactionContext ¶
type TransactionContext struct {
Stub *FabricStub
ClientIdentity cid.ClientIdentity
}
func (TransactionContext) GetClientIdentity ¶
func (t TransactionContext) GetClientIdentity() cid.ClientIdentity
GetClientIdentity implements contractapi.TransactionContextInterface.
func (TransactionContext) GetStub ¶
func (t TransactionContext) GetStub() shim.ChaincodeStubInterface
GetStub implements contractapi.TransactionContextInterface.
func (TransactionContext) Rwset ¶
func (t TransactionContext) Rwset() *kvrwset.KVRWSet
type UnimplementedStub ¶
type UnimplementedStub struct{}
UnimplementedStub has functions to fulfil shim.ChaincodeStubInterface. See: github.com/hyperledger/fabric-chaincode-go/shim/stub.go
func (UnimplementedStub) CreateCompositeKey ¶
func (s UnimplementedStub) CreateCompositeKey(objectType string, attributes []string) (string, error)
CreateCompositeKey implements shim.ChaincodeStubInterface.
func (UnimplementedStub) DelPrivateData ¶
func (s UnimplementedStub) DelPrivateData(collection string, key string) error
DelPrivateData implements shim.ChaincodeStubInterface.
func (UnimplementedStub) FinishWriteBatch ¶
func (s UnimplementedStub) FinishWriteBatch() error
FinishWriteBatch implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetAllStatesCompositeKeyWithPagination ¶
func (s UnimplementedStub) GetAllStatesCompositeKeyWithPagination(pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
GetAllStatesCompositeKeyWithPagination implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetArgs ¶
func (s UnimplementedStub) GetArgs() [][]byte
GetArgs implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetArgsSlice ¶
func (s UnimplementedStub) GetArgsSlice() ([]byte, error)
GetArgsSlice implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetBinding ¶
func (s UnimplementedStub) GetBinding() ([]byte, error)
GetBinding implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetChannelID ¶
func (s UnimplementedStub) GetChannelID() string
GetChannelID implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetCreator ¶
func (s UnimplementedStub) GetCreator() ([]byte, error)
GetCreator implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetDecorations ¶
func (s UnimplementedStub) GetDecorations() map[string][]byte
GetDecorations implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetFunctionAndParameters ¶
func (s UnimplementedStub) GetFunctionAndParameters() (string, []string)
GetFunctionAndParameters implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetHistoryForKey ¶
func (s UnimplementedStub) GetHistoryForKey(key string) (shim.HistoryQueryIteratorInterface, error)
GetHistoryForKey implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetMultiplePrivateData ¶
func (s UnimplementedStub) GetMultiplePrivateData(collection string, keys ...string) ([][]byte, error)
GetMultiplePrivateData implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetMultipleStates ¶
func (s UnimplementedStub) GetMultipleStates(keys ...string) ([][]byte, error)
GetMultipleStates implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateData ¶
func (s UnimplementedStub) GetPrivateData(collection string, key string) ([]byte, error)
GetPrivateData implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateDataByPartialCompositeKey ¶
func (s UnimplementedStub) GetPrivateDataByPartialCompositeKey(collection string, objectType string, keys []string) (shim.StateQueryIteratorInterface, error)
GetPrivateDataByPartialCompositeKey implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateDataByRange ¶
func (s UnimplementedStub) GetPrivateDataByRange(collection string, startKey string, endKey string) (shim.StateQueryIteratorInterface, error)
GetPrivateDataByRange implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateDataHash ¶
func (s UnimplementedStub) GetPrivateDataHash(collection string, key string) ([]byte, error)
GetPrivateDataHash implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateDataQueryResult ¶
func (s UnimplementedStub) GetPrivateDataQueryResult(collection string, query string) (shim.StateQueryIteratorInterface, error)
GetPrivateDataQueryResult implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetPrivateDataValidationParameter ¶
func (s UnimplementedStub) GetPrivateDataValidationParameter(collection string, key string) ([]byte, error)
GetPrivateDataValidationParameter implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetQueryResult ¶
func (s UnimplementedStub) GetQueryResult(query string) (shim.StateQueryIteratorInterface, error)
GetQueryResult implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetQueryResultWithPagination ¶
func (s UnimplementedStub) GetQueryResultWithPagination(query string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
GetQueryResultWithPagination implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetSignedProposal ¶
func (s UnimplementedStub) GetSignedProposal() (*peer.SignedProposal, error)
GetSignedProposal implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStateByPartialCompositeKey ¶
func (s UnimplementedStub) GetStateByPartialCompositeKey(objectType string, keys []string) (shim.StateQueryIteratorInterface, error)
GetStateByPartialCompositeKey implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStateByPartialCompositeKeyWithPagination ¶
func (s UnimplementedStub) GetStateByPartialCompositeKeyWithPagination(objectType string, keys []string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
GetStateByPartialCompositeKeyWithPagination implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStateByRange ¶
func (s UnimplementedStub) GetStateByRange(startKey string, endKey string) (shim.StateQueryIteratorInterface, error)
GetStateByRange implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStateByRangeWithPagination ¶
func (s UnimplementedStub) GetStateByRangeWithPagination(startKey string, endKey string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
GetStateByRangeWithPagination implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStateValidationParameter ¶
func (s UnimplementedStub) GetStateValidationParameter(key string) ([]byte, error)
GetStateValidationParameter implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetStringArgs ¶
func (s UnimplementedStub) GetStringArgs() []string
GetStringArgs implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetTransient ¶
func (s UnimplementedStub) GetTransient() (map[string][]byte, error)
GetTransient implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetTxID ¶
func (s UnimplementedStub) GetTxID() string
GetTxID implements shim.ChaincodeStubInterface.
func (UnimplementedStub) GetTxTimestamp ¶
func (s UnimplementedStub) GetTxTimestamp() (*timestamppb.Timestamp, error)
GetTxTimestamp implements shim.ChaincodeStubInterface.
func (UnimplementedStub) InvokeChaincode ¶
func (s UnimplementedStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response
InvokeChaincode implements shim.ChaincodeStubInterface.
func (UnimplementedStub) PurgePrivateData ¶
func (s UnimplementedStub) PurgePrivateData(collection string, key string) error
PurgePrivateData implements shim.ChaincodeStubInterface.
func (UnimplementedStub) PutPrivateData ¶
func (s UnimplementedStub) PutPrivateData(collection string, key string, value []byte) error
PutPrivateData implements shim.ChaincodeStubInterface.
func (UnimplementedStub) SetEvent ¶
func (s UnimplementedStub) SetEvent(name string, payload []byte) error
SetEvent implements shim.ChaincodeStubInterface.
func (UnimplementedStub) SetPrivateDataValidationParameter ¶
func (s UnimplementedStub) SetPrivateDataValidationParameter(collection string, key string, ep []byte) error
SetPrivateDataValidationParameter implements shim.ChaincodeStubInterface.
func (UnimplementedStub) SetStateValidationParameter ¶
func (s UnimplementedStub) SetStateValidationParameter(key string, ep []byte) error
SetStateValidationParameter implements shim.ChaincodeStubInterface.
func (UnimplementedStub) SplitCompositeKey ¶
func (s UnimplementedStub) SplitCompositeKey(compositeKey string) (string, []string, error)
SplitCompositeKey source: github.com/hyperledger/fabric-chaincode-go/shim/shim.go
func (UnimplementedStub) StartWriteBatch ¶
func (s UnimplementedStub) StartWriteBatch()
StartWriteBatch implements shim.ChaincodeStubInterface.