Documentation
¶
Index ¶
- Constants
- func DiscoveredIdentities(d []DiscoveredPeer) []view.Identity
- func GetChannel(sp services.Provider, network, channel string) (*NetworkService, *Channel, error)
- func GetDefaultChannel(sp services.Provider) (*NetworkService, *Channel, error)
- func GetFabricNetworkNames(sp services.Provider) ([]string, error)
- type Block
- type BlockCallback
- type Chaincode
- func (c *Chaincode) Discover() *ChaincodeDiscover
- func (c *Chaincode) Endorse(function string, args ...interface{}) *ChaincodeEndorse
- func (c *Chaincode) Invoke(function string, args ...interface{}) *ChaincodeInvocation
- func (c *Chaincode) IsAvailable() (bool, error)
- func (c *Chaincode) IsPrivate() bool
- func (c *Chaincode) Query(function string, args ...interface{}) *ChaincodeQuery
- func (c *Chaincode) Version() (string, error)
- type ChaincodeDiscover
- type ChaincodeEndorse
- func (i *ChaincodeEndorse) Call() (*Envelope, error)
- func (i *ChaincodeEndorse) WithContext(context context.Context) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithEndorsersFromMyOrg() *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithImplicitCollections(mspIDs ...string) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithInvokerIdentity(id view.Identity) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithNumRetries(numRetries uint) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithRetrySleep(duration time.Duration) *ChaincodeEndorse
- func (i *ChaincodeEndorse) WithTransientEntries(entries map[string]interface{}) (*ChaincodeEndorse, error)
- func (i *ChaincodeEndorse) WithTransientEntry(k string, v interface{}) (*ChaincodeEndorse, error)
- func (i *ChaincodeEndorse) WithTxID(id TxID) *ChaincodeEndorse
- type ChaincodeInvocation
- func (i *ChaincodeInvocation) Call() (string, []byte, error)
- func (i *ChaincodeInvocation) WithContext(context context.Context) *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithEndorsersFromMyOrg() *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithInvokerIdentity(id view.Identity) *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithNumRetries(numRetries uint) *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithRetrySleep(duration time.Duration) *ChaincodeInvocation
- func (i *ChaincodeInvocation) WithTransientEntry(k string, v interface{}) (*ChaincodeInvocation, error)
- type ChaincodeQuery
- func (i *ChaincodeQuery) Call() ([]byte, error)
- func (i *ChaincodeQuery) WithContext(context context.Context) *ChaincodeQuery
- func (i *ChaincodeQuery) WithDiscoveredEndorsersByEndpoints(endpoints ...string) *ChaincodeQuery
- func (i *ChaincodeQuery) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeQuery
- func (i *ChaincodeQuery) WithEndorsersFromMyOrg() *ChaincodeQuery
- func (i *ChaincodeQuery) WithInvokerIdentity(id view.Identity) *ChaincodeQuery
- func (i *ChaincodeQuery) WithMatchEndorsementPolicy() *ChaincodeQuery
- func (i *ChaincodeQuery) WithNumRetries(numRetries uint) *ChaincodeQuery
- func (i *ChaincodeQuery) WithRetrySleep(duration time.Duration) *ChaincodeQuery
- func (i *ChaincodeQuery) WithTransientEntry(k string, v interface{}) (*ChaincodeQuery, error)
- func (i *ChaincodeQuery) WithTxID(id TxID) *ChaincodeQuery
- type Channel
- func (c *Channel) Chaincode(name string) *Chaincode
- func (c *Channel) Committer() *Committer
- func (c *Channel) Delivery() *Delivery
- func (c *Channel) EnvelopeService() *EnvelopeService
- func (c *Channel) Finality() *Finality
- func (c *Channel) Ledger() *Ledger
- func (c *Channel) MSPManager() *MSPManager
- func (c *Channel) MetadataService() *MetadataService
- func (c *Channel) Name() string
- func (c *Channel) Vault() *Vault
- type Committer
- func (c *Committer) AddFinalityListener(txID driver2.TxID, listener FinalityListener) error
- func (c *Committer) AddTransactionFilter(tf TransactionFilter) error
- func (c *Committer) ProcessNamespace(nss ...driver2.Namespace) error
- func (c *Committer) RemoveFinalityListener(txID driver2.TxID, listener FinalityListener) error
- func (c *Committer) Status(ctx context.Context, txID driver2.TxID) (driver.ValidationCode, string, error)
- type ConfigService
- type Delivery
- func (d *Delivery) Scan(ctx context.Context, txID string, callback DeliveryCallback) error
- func (d *Delivery) ScanBlock(ctx context.Context, callback BlockCallback) error
- func (d *Delivery) ScanBlockFrom(ctx context.Context, block uint64, callback BlockCallback) error
- func (d *Delivery) ScanFromBlock(ctx context.Context, block uint64, callback DeliveryCallback) error
- type DeliveryCallback
- type DiscoveredPeer
- type Envelope
- func (e *Envelope) Bytes() ([]byte, error)
- func (e *Envelope) Creator() []byte
- func (e *Envelope) FromBytes(raw []byte) error
- func (e *Envelope) MarshalJSON() ([]byte, error)
- func (e *Envelope) Nonce() []byte
- func (e *Envelope) Results() []byte
- func (e *Envelope) String() string
- func (e *Envelope) TxID() string
- func (e *Envelope) UnmarshalJSON(raw []byte) error
- type EnvelopeService
- type EventListener
- type Finality
- type FinalityListener
- type GetIdentityFunc
- type IdentityInfo
- type IdentityOption
- type IdentityOptions
- type IdentityProvider
- type Ledger
- type LedgerInfo
- type LocalMembership
- func (s *LocalMembership) AnonymousIdentity() (view.Identity, error)
- func (s *LocalMembership) DefaultIdentity() view.Identity
- func (s *LocalMembership) DefaultSigningIdentity() SigningIdentity
- func (s *LocalMembership) GetIdentityByID(id string) (view.Identity, error)
- func (s *LocalMembership) GetIdentityInfoByIdentity(mspType string, id view.Identity) *IdentityInfo
- func (s *LocalMembership) GetIdentityInfoByLabel(mspType string, label string) *IdentityInfo
- func (s *LocalMembership) IsMe(ctx context.Context, id view.Identity) bool
- func (s *LocalMembership) Refresh() error
- func (s *LocalMembership) RegisterIdemixMSP(id string, path string, mspID string) error
- func (s *LocalMembership) RegisterX509MSP(id string, path string, mspID string) error
- type MSPManager
- type MetadataService
- type NetworkService
- func (n *NetworkService) Channel(id string) (*Channel, error)
- func (n *NetworkService) ConfigService() *ConfigService
- func (n *NetworkService) IdentityProvider() *IdentityProvider
- func (n *NetworkService) LocalMembership() *LocalMembership
- func (n *NetworkService) Name() string
- func (n *NetworkService) Ordering() *Ordering
- func (n *NetworkService) ProcessorManager() *ProcessorManager
- func (n *NetworkService) SignerService() *SignerService
- func (n *NetworkService) TransactionManager() *TransactionManager
- type NetworkServiceProvider
- type Ordering
- type ProcessTransaction
- type ProcessedTransaction
- type Processor
- type ProcessorManager
- type Proposal
- type ProposalResponse
- func (r *ProposalResponse) Bytes() ([]byte, error)
- func (r *ProposalResponse) Endorser() []byte
- func (r *ProposalResponse) EndorserSignature() []byte
- func (r *ProposalResponse) Payload() []byte
- func (r *ProposalResponse) ResponseMessage() string
- func (r *ProposalResponse) ResponseStatus() int32
- func (r *ProposalResponse) Results() []byte
- func (r *ProposalResponse) VerifyEndorsement(provider VerifierProvider) error
- type RWSet
- type Request
- type SignedProposal
- type Signer
- type SignerService
- type SigningIdentity
- type Transaction
- func (t *Transaction) AppendParameter(p []byte)
- func (t *Transaction) AppendProposalResponse(response *ProposalResponse) error
- func (t *Transaction) Bytes() ([]byte, error)
- func (t *Transaction) BytesNoTransient() ([]byte, error)
- func (t *Transaction) Chaincode() string
- func (t *Transaction) ChaincodeVersion() string
- func (t *Transaction) Channel() string
- func (t *Transaction) Close()
- func (t *Transaction) Creator() view.Identity
- func (t *Transaction) Done() error
- func (t *Transaction) Endorse() error
- func (t *Transaction) EndorseProposal() error
- func (t *Transaction) EndorseProposalResponse() error
- func (t *Transaction) EndorseProposalResponseWithIdentity(identity view.Identity) error
- func (t *Transaction) EndorseProposalWithIdentity(identity view.Identity) error
- func (t *Transaction) EndorseWithIdentity(identity view.Identity) error
- func (t *Transaction) EndorseWithSigner(identity view.Identity, s Signer) error
- func (t *Transaction) Envelope() (*Envelope, error)
- func (t *Transaction) FabricNetworkService() *NetworkService
- func (t *Transaction) From(payload *Transaction) (err error)
- func (t *Transaction) Function() string
- func (t *Transaction) GetRWSet() (*RWSet, error)
- func (t *Transaction) ID() string
- func (t *Transaction) Network() string
- func (t *Transaction) Nonce() []byte
- func (t *Transaction) Parameters() [][]byte
- func (t *Transaction) Proposal() *Proposal
- func (t *Transaction) ProposalHasBeenEndorsedBy(party view.Identity) error
- func (t *Transaction) ProposalResponse() ([]byte, error)
- func (t *Transaction) ProposalResponses() ([]*ProposalResponse, error)
- func (t *Transaction) RWS() *RWSet
- func (t *Transaction) Raw() ([]byte, error)
- func (t *Transaction) ResetTransient()
- func (t *Transaction) Results() ([]byte, error)
- func (t *Transaction) SetFromBytes(raw []byte) error
- func (t *Transaction) SetFromEnvelopeBytes(raw []byte) error
- func (t *Transaction) SetParameterAt(i int, p []byte) error
- func (t *Transaction) SetProposal(chaincode string, version string, function string, params ...string)
- func (t *Transaction) SetRWSet() error
- func (t *Transaction) SignedProposal() *SignedProposal
- func (t *Transaction) StoreTransient() error
- func (t *Transaction) Transient() TransientMap
- type TransactionFilter
- type TransactionManager
- func (t *TransactionManager) ComputeTxID(id *TxID) string
- func (t *TransactionManager) NewEnvelope() *Envelope
- func (t *TransactionManager) NewProposalResponseFromBytes(raw []byte) (*ProposalResponse, error)
- func (t *TransactionManager) NewTransaction(opts ...TransactionOption) (*Transaction, error)
- func (t *TransactionManager) NewTransactionFromBytes(raw []byte, opts ...TransactionOption) (*Transaction, error)
- func (t *TransactionManager) NewTransactionFromEnvelopeBytes(raw []byte, opts ...TransactionOption) (*Transaction, error)
- type TransactionOption
- func WithChannel(channel string) TransactionOption
- func WithContext(ctx context.Context) TransactionOption
- func WithCreator(creator view.Identity) TransactionOption
- func WithNonce(nonce []byte) TransactionOption
- func WithRawRequest(rawRequest []byte) TransactionOption
- func WithTransactionType(tt TransactionType) TransactionOption
- func WithTxID(txid string) TransactionOption
- type TransactionOptions
- type TransactionType
- type TransientMap
- func (m TransientMap) Exists(key string) bool
- func (m TransientMap) Get(id string) []byte
- func (m TransientMap) GetState(key driver.PKey, state interface{}) error
- func (m TransientMap) IsEmpty() bool
- func (m TransientMap) Set(key string, raw []byte) error
- func (m TransientMap) SetState(key string, state interface{}) error
- type TxID
- type Vault
- func (c *Vault) CommitTX(ctx context.Context, txID driver.TxID, block driver.BlockNum, ...) error
- func (c *Vault) DiscardTx(ctx context.Context, txID driver.TxID, message string) error
- func (c *Vault) GetLastTxID(ctx context.Context) (string, error)
- func (c *Vault) InspectRWSet(ctx context.Context, rwset []byte, namespaces ...driver.Namespace) (*RWSet, error)
- func (c *Vault) NewQueryExecutor(ctx context.Context) (driver.QueryExecutor, error)
- func (c *Vault) NewRWSet(ctx context.Context, txID driver.TxID) (*RWSet, error)
- func (c *Vault) NewRWSetFromBytes(ctx context.Context, txid driver.TxID, rwset []byte) (*RWSet, error)
- func (c *Vault) Status(ctx context.Context, id driver.TxID) (fdriver.ValidationCode, string, error)
- func (c *Vault) StoreEnvelope(ctx context.Context, id driver.TxID, env []byte) error
- func (c *Vault) StoreTransaction(ctx context.Context, id driver.TxID, raw []byte) error
- func (c *Vault) StoreTransient(ctx context.Context, id driver.TxID, tm TransientMap) error
- type Verifier
- type VerifierProvider
Constants ¶
const (
EndorserTransaction = driver.EndorserTransaction
)
Variables ¶
This section is empty.
Functions ¶
func DiscoveredIdentities ¶
func DiscoveredIdentities(d []DiscoveredPeer) []view.Identity
DiscoveredIdentities extract the identities of the discovered peers
func GetChannel ¶
GetChannel returns the requested channel for the passed network
func GetDefaultChannel ¶
func GetDefaultChannel(sp services.Provider) (*NetworkService, *Channel, error)
GetDefaultChannel returns the default channel of the default fns
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block models a Fabric block
type BlockCallback ¶ added in v0.4.0
type Chaincode ¶
type Chaincode struct { EventListener *EventListener // contains filtered or unexported fields }
func (*Chaincode) Discover ¶
func (c *Chaincode) Discover() *ChaincodeDiscover
func (*Chaincode) Endorse ¶
func (c *Chaincode) Endorse(function string, args ...interface{}) *ChaincodeEndorse
func (*Chaincode) Invoke ¶
func (c *Chaincode) Invoke(function string, args ...interface{}) *ChaincodeInvocation
Invoke returns a chaincode invocation proxy struct for the passed function and arguments
func (*Chaincode) IsAvailable ¶
func (*Chaincode) Query ¶
func (c *Chaincode) Query(function string, args ...interface{}) *ChaincodeQuery
type ChaincodeDiscover ¶
type ChaincodeDiscover struct {
driver.ChaincodeDiscover
}
func (*ChaincodeDiscover) Call ¶
func (i *ChaincodeDiscover) Call() ([]DiscoveredPeer, error)
Call invokes discovery service and returns the discovered peers
func (*ChaincodeDiscover) WithFilterByMSPIDs ¶
func (i *ChaincodeDiscover) WithFilterByMSPIDs(mspIDs ...string) *ChaincodeDiscover
type ChaincodeEndorse ¶
type ChaincodeEndorse struct {
ChaincodeInvocation driver.ChaincodeInvocation
}
func (*ChaincodeEndorse) Call ¶
func (i *ChaincodeEndorse) Call() (*Envelope, error)
func (*ChaincodeEndorse) WithContext ¶ added in v0.3.0
func (i *ChaincodeEndorse) WithContext(context context.Context) *ChaincodeEndorse
func (*ChaincodeEndorse) WithEndorsersByMSPIDs ¶
func (i *ChaincodeEndorse) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeEndorse
func (*ChaincodeEndorse) WithEndorsersFromMyOrg ¶
func (i *ChaincodeEndorse) WithEndorsersFromMyOrg() *ChaincodeEndorse
func (*ChaincodeEndorse) WithImplicitCollections ¶
func (i *ChaincodeEndorse) WithImplicitCollections(mspIDs ...string) *ChaincodeEndorse
func (*ChaincodeEndorse) WithInvokerIdentity ¶
func (i *ChaincodeEndorse) WithInvokerIdentity(id view.Identity) *ChaincodeEndorse
func (*ChaincodeEndorse) WithNumRetries ¶ added in v0.2.0
func (i *ChaincodeEndorse) WithNumRetries(numRetries uint) *ChaincodeEndorse
WithNumRetries sets the number of times the chaincode operation should be retried before returning a failure
func (*ChaincodeEndorse) WithRetrySleep ¶ added in v0.2.0
func (i *ChaincodeEndorse) WithRetrySleep(duration time.Duration) *ChaincodeEndorse
WithRetrySleep sets the time interval between each retry
func (*ChaincodeEndorse) WithTransientEntries ¶ added in v0.4.0
func (i *ChaincodeEndorse) WithTransientEntries(entries map[string]interface{}) (*ChaincodeEndorse, error)
func (*ChaincodeEndorse) WithTransientEntry ¶
func (i *ChaincodeEndorse) WithTransientEntry(k string, v interface{}) (*ChaincodeEndorse, error)
func (*ChaincodeEndorse) WithTxID ¶
func (i *ChaincodeEndorse) WithTxID(id TxID) *ChaincodeEndorse
type ChaincodeInvocation ¶
type ChaincodeInvocation struct {
driver.ChaincodeInvocation
}
func (*ChaincodeInvocation) Call ¶
func (i *ChaincodeInvocation) Call() (string, []byte, error)
Call invokes the chaincode function with the passed arguments, and any additional parameter set with the other functions on this struct. It no error occurs, it returns the transaction id and the response payload of the chaincode invocation.
func (*ChaincodeInvocation) WithContext ¶ added in v0.3.0
func (i *ChaincodeInvocation) WithContext(context context.Context) *ChaincodeInvocation
func (*ChaincodeInvocation) WithEndorsersByMSPIDs ¶
func (i *ChaincodeInvocation) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeInvocation
func (*ChaincodeInvocation) WithEndorsersFromMyOrg ¶
func (i *ChaincodeInvocation) WithEndorsersFromMyOrg() *ChaincodeInvocation
func (*ChaincodeInvocation) WithInvokerIdentity ¶
func (i *ChaincodeInvocation) WithInvokerIdentity(id view.Identity) *ChaincodeInvocation
func (*ChaincodeInvocation) WithNumRetries ¶ added in v0.2.0
func (i *ChaincodeInvocation) WithNumRetries(numRetries uint) *ChaincodeInvocation
WithNumRetries sets the number of times the chaincode operation should be retried before returning a failure
func (*ChaincodeInvocation) WithRetrySleep ¶ added in v0.2.0
func (i *ChaincodeInvocation) WithRetrySleep(duration time.Duration) *ChaincodeInvocation
WithRetrySleep sets the time interval between each retry
func (*ChaincodeInvocation) WithTransientEntry ¶
func (i *ChaincodeInvocation) WithTransientEntry(k string, v interface{}) (*ChaincodeInvocation, error)
type ChaincodeQuery ¶
type ChaincodeQuery struct {
driver.ChaincodeInvocation
}
func (*ChaincodeQuery) Call ¶
func (i *ChaincodeQuery) Call() ([]byte, error)
func (*ChaincodeQuery) WithContext ¶ added in v0.3.0
func (i *ChaincodeQuery) WithContext(context context.Context) *ChaincodeQuery
func (*ChaincodeQuery) WithDiscoveredEndorsersByEndpoints ¶
func (i *ChaincodeQuery) WithDiscoveredEndorsersByEndpoints(endpoints ...string) *ChaincodeQuery
WithDiscoveredEndorsersByEndpoints sets the endpoints to be used to filter the result of discovery. Discovery is used to identify the chaincode's endorsers, if not set otherwise.
func (*ChaincodeQuery) WithEndorsersByMSPIDs ¶
func (i *ChaincodeQuery) WithEndorsersByMSPIDs(mspIDs ...string) *ChaincodeQuery
func (*ChaincodeQuery) WithEndorsersFromMyOrg ¶
func (i *ChaincodeQuery) WithEndorsersFromMyOrg() *ChaincodeQuery
func (*ChaincodeQuery) WithInvokerIdentity ¶
func (i *ChaincodeQuery) WithInvokerIdentity(id view.Identity) *ChaincodeQuery
func (*ChaincodeQuery) WithMatchEndorsementPolicy ¶ added in v0.2.0
func (i *ChaincodeQuery) WithMatchEndorsementPolicy() *ChaincodeQuery
WithMatchEndorsementPolicy enforces that the query is perfomed against a set of peers that satisfy the endorsement policy of the chaincode
func (*ChaincodeQuery) WithNumRetries ¶ added in v0.2.0
func (i *ChaincodeQuery) WithNumRetries(numRetries uint) *ChaincodeQuery
WithNumRetries sets the number of times the chaincode operation should be retried before returning a failure
func (*ChaincodeQuery) WithRetrySleep ¶ added in v0.2.0
func (i *ChaincodeQuery) WithRetrySleep(duration time.Duration) *ChaincodeQuery
WithRetrySleep sets the time interval between each retry
func (*ChaincodeQuery) WithTransientEntry ¶
func (i *ChaincodeQuery) WithTransientEntry(k string, v interface{}) (*ChaincodeQuery, error)
func (*ChaincodeQuery) WithTxID ¶
func (i *ChaincodeQuery) WithTxID(id TxID) *ChaincodeQuery
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func NewChannel ¶
func NewChannel(subscriber events.Subscriber, fns driver.FabricNetworkService, ch driver.Channel) *Channel
func (*Channel) EnvelopeService ¶
func (c *Channel) EnvelopeService() *EnvelopeService
func (*Channel) MSPManager ¶
func (c *Channel) MSPManager() *MSPManager
func (*Channel) MetadataService ¶
func (c *Channel) MetadataService() *MetadataService
type Committer ¶
type Committer struct {
// contains filtered or unexported fields
}
func NewCommitter ¶
func (*Committer) AddFinalityListener ¶ added in v0.4.0
func (c *Committer) AddFinalityListener(txID driver2.TxID, listener FinalityListener) error
AddFinalityListener registers a listener for transaction status for the passed transaction id. If the status is already valid or invalid, the listener is called immediately. When the listener is invoked, then it is also removed. The transaction id must not be empty.
func (*Committer) AddTransactionFilter ¶ added in v0.4.0
func (c *Committer) AddTransactionFilter(tf TransactionFilter) error
AddTransactionFilter adds a new transaction filter to this commit pipeline. The transaction filter is used to check if an unknown transaction needs to be processed anyway
func (*Committer) ProcessNamespace ¶
ProcessNamespace registers namespaces that will be committed even if the rwset is not known
func (*Committer) RemoveFinalityListener ¶ added in v0.4.0
func (c *Committer) RemoveFinalityListener(txID driver2.TxID, listener FinalityListener) error
RemoveFinalityListener unregisters the passed listener.
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
func (*ConfigService) DefaultChannel ¶ added in v0.4.0
func (s *ConfigService) DefaultChannel() string
func (*ConfigService) DriverName ¶ added in v0.4.0
func (s *ConfigService) DriverName() string
func (*ConfigService) GetString ¶
func (s *ConfigService) GetString(key string) string
type Delivery ¶
type Delivery struct {
// contains filtered or unexported fields
}
Delivery models the Fabric's delivery service
func (*Delivery) Scan ¶
Scan iterates over all transactions in block starting from the block containing the passed transaction id. If txID is empty, the iterations starts from the first block. On each transaction, the callback function is invoked.
func (*Delivery) ScanBlock ¶ added in v0.4.0
func (d *Delivery) ScanBlock(ctx context.Context, callback BlockCallback) error
ScanBlock iterates over all blocks. On each block, the callback function is invoked.
func (*Delivery) ScanBlockFrom ¶ added in v0.4.1
ScanBlockFrom iterates over all blocks starting from the block with the passed number. On each block, the callback function is invoked.
func (*Delivery) ScanFromBlock ¶ added in v0.4.1
func (d *Delivery) ScanFromBlock(ctx context.Context, block uint64, callback DeliveryCallback) error
ScanFromBlock iterates over all transactions in block starting from the block with the passed number. On each transaction, the callback function is invoked.
type DeliveryCallback ¶
type DeliveryCallback func(tx *ProcessedTransaction) (bool, error)
type DiscoveredPeer ¶
type DiscoveredPeer = driver.DiscoveredPeer
DiscoveredPeer contains the information of a discovered peer
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func (*Envelope) MarshalJSON ¶
func (*Envelope) UnmarshalJSON ¶
type EnvelopeService ¶
type EnvelopeService struct {
// contains filtered or unexported fields
}
type EventListener ¶
EventListener models the parameters to use for chaincode listening.
func (*EventListener) ChaincodeEvents ¶
func (e *EventListener) ChaincodeEvents() chan *committer.ChaincodeEvent
ChaincodeEvents returns a channel from which chaincode events emitted by transaction functions in the specified chaincode can be read.
func (*EventListener) CloseChaincodeEvents ¶
func (e *EventListener) CloseChaincodeEvents()
CloseChaincodeEvents closes the channel from which chaincode events are read.
func (*EventListener) OnReceive ¶
func (e *EventListener) OnReceive(event events.Event)
OnReceive pushes events to the listener
type FinalityListener ¶ added in v0.4.0
type FinalityListener = driver.FinalityListener
FinalityListener is the interface that must be implemented to receive transaction status notifications
type GetIdentityFunc ¶
type GetIdentityFunc func(opts ...IdentityOption) (view.Identity, []byte, error)
type IdentityInfo ¶
type IdentityInfo struct { ID string EnrollmentID string GetIdentity GetIdentityFunc }
type IdentityOption ¶
type IdentityOption func(*IdentityOptions) error
func WithAuditInfo ¶
func WithAuditInfo(ai []byte) IdentityOption
func WithIdemixEIDExtension ¶
func WithIdemixEIDExtension() IdentityOption
type IdentityOptions ¶
func CompileIdentityOptions ¶
func CompileIdentityOptions(opts ...IdentityOption) (*IdentityOptions, error)
type IdentityProvider ¶
type IdentityProvider struct {
// contains filtered or unexported fields
}
func (*IdentityProvider) DefaultIdentity ¶
func (i *IdentityProvider) DefaultIdentity() view.Identity
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger models the ledger stored at a remote Fabric peer
func (*Ledger) GetBlockByNumber ¶
GetBlockByNumber fetches a block by number
func (*Ledger) GetBlockNumberByTxID ¶
GetBlockNumberByTxID returns the number of the block where the passed transaction appears
func (*Ledger) GetLedgerInfo ¶ added in v0.4.1
func (l *Ledger) GetLedgerInfo() (*LedgerInfo, error)
func (*Ledger) GetTransactionByID ¶
func (l *Ledger) GetTransactionByID(txID string) (*ProcessedTransaction, error)
GetTransactionByID retrieves a transaction by id
type LedgerInfo ¶ added in v0.4.1
type LedgerInfo = driver.LedgerInfo
type LocalMembership ¶
type LocalMembership struct {
// contains filtered or unexported fields
}
func (*LocalMembership) AnonymousIdentity ¶
func (s *LocalMembership) AnonymousIdentity() (view.Identity, error)
func (*LocalMembership) DefaultIdentity ¶
func (s *LocalMembership) DefaultIdentity() view.Identity
func (*LocalMembership) DefaultSigningIdentity ¶
func (s *LocalMembership) DefaultSigningIdentity() SigningIdentity
func (*LocalMembership) GetIdentityByID ¶
func (s *LocalMembership) GetIdentityByID(id string) (view.Identity, error)
func (*LocalMembership) GetIdentityInfoByIdentity ¶
func (s *LocalMembership) GetIdentityInfoByIdentity(mspType string, id view.Identity) *IdentityInfo
func (*LocalMembership) GetIdentityInfoByLabel ¶
func (s *LocalMembership) GetIdentityInfoByLabel(mspType string, label string) *IdentityInfo
func (*LocalMembership) Refresh ¶
func (s *LocalMembership) Refresh() error
func (*LocalMembership) RegisterIdemixMSP ¶
func (s *LocalMembership) RegisterIdemixMSP(id string, path string, mspID string) error
func (*LocalMembership) RegisterX509MSP ¶
func (s *LocalMembership) RegisterX509MSP(id string, path string, mspID string) error
type MSPManager ¶
type MSPManager struct {
// contains filtered or unexported fields
}
func (*MSPManager) GetMSPIDs ¶
func (c *MSPManager) GetMSPIDs() []string
func (*MSPManager) GetMSPIdentifier ¶
func (c *MSPManager) GetMSPIdentifier(sid []byte) (string, error)
func (*MSPManager) GetVerifier ¶
func (c *MSPManager) GetVerifier(identity view.Identity) (Verifier, error)
type MetadataService ¶
type MetadataService struct {
// contains filtered or unexported fields
}
func (*MetadataService) Exists ¶
func (m *MetadataService) Exists(ctx context.Context, txid string) bool
func (*MetadataService) LoadTransient ¶
func (m *MetadataService) LoadTransient(ctx context.Context, txid string) (TransientMap, error)
func (*MetadataService) StoreTransient ¶
func (m *MetadataService) StoreTransient(ctx context.Context, txid string, transientMap TransientMap) error
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
NetworkService models a Fabric Network
func GetDefaultFNS ¶
func GetDefaultFNS(sp services.Provider) (*NetworkService, error)
GetDefaultFNS returns the default Fabric Network Service
func GetFabricNetworkService ¶
func GetFabricNetworkService(sp services.Provider, id string) (*NetworkService, error)
GetFabricNetworkService returns the Fabric Network Service for the passed id, nil if not found
func NewNetworkService ¶
func NewNetworkService(subscriber events.Subscriber, fns driver.FabricNetworkService, name string) *NetworkService
func (*NetworkService) Channel ¶
func (n *NetworkService) Channel(id string) (*Channel, error)
Channel returns the channel service for the passed id
func (*NetworkService) ConfigService ¶
func (n *NetworkService) ConfigService() *ConfigService
func (*NetworkService) IdentityProvider ¶
func (n *NetworkService) IdentityProvider() *IdentityProvider
IdentityProvider returns the identity provider of this network
func (*NetworkService) LocalMembership ¶
func (n *NetworkService) LocalMembership() *LocalMembership
LocalMembership returns the local membership of this network
func (*NetworkService) Ordering ¶
func (n *NetworkService) Ordering() *Ordering
Ordering returns the list of known Orderer nodes
func (*NetworkService) ProcessorManager ¶
func (n *NetworkService) ProcessorManager() *ProcessorManager
ProcessorManager returns the processor manager of this network
func (*NetworkService) SignerService ¶
func (n *NetworkService) SignerService() *SignerService
SignerService returns the signature service of this network
func (*NetworkService) TransactionManager ¶
func (n *NetworkService) TransactionManager() *TransactionManager
TransactionManager returns the transaction manager of this network
type NetworkServiceProvider ¶
type NetworkServiceProvider struct {
// contains filtered or unexported fields
}
func GetNetworkServiceProvider ¶
func GetNetworkServiceProvider(sp services.Provider) (*NetworkServiceProvider, error)
func NewNetworkServiceProvider ¶
func NewNetworkServiceProvider(fnsProvider driver.FabricNetworkServiceProvider, subscriber events.Subscriber) *NetworkServiceProvider
func (*NetworkServiceProvider) FabricNetworkService ¶
func (nsp *NetworkServiceProvider) FabricNetworkService(id string) (*NetworkService, error)
type ProcessTransaction ¶
type ProcessedTransaction ¶
type ProcessedTransaction struct {
// contains filtered or unexported fields
}
ProcessedTransaction models a transaction that has been processed by Fabric
func (*ProcessedTransaction) Results ¶
func (pt *ProcessedTransaction) Results() []byte
Results returns the rwset marshaled
func (*ProcessedTransaction) TxID ¶
func (pt *ProcessedTransaction) TxID() string
TxID returns the transaction's id
func (*ProcessedTransaction) ValidationCode ¶
func (pt *ProcessedTransaction) ValidationCode() int32
ValidationCode of this transaction
type Processor ¶
type Processor interface {
Process(req Request, tx ProcessTransaction, rws *RWSet, ns string) error
}
type ProcessorManager ¶
type ProcessorManager struct {
// contains filtered or unexported fields
}
func (*ProcessorManager) AddChannelProcessor ¶
func (pm *ProcessorManager) AddChannelProcessor(channel, ns string, p Processor) error
func (*ProcessorManager) AddProcessor ¶
func (pm *ProcessorManager) AddProcessor(ns string, p Processor) error
func (*ProcessorManager) SetDefaultProcessor ¶
func (pm *ProcessorManager) SetDefaultProcessor(p Processor) error
type ProposalResponse ¶
type ProposalResponse struct {
// contains filtered or unexported fields
}
func (*ProposalResponse) Bytes ¶ added in v0.2.0
func (r *ProposalResponse) Bytes() ([]byte, error)
func (*ProposalResponse) Endorser ¶
func (r *ProposalResponse) Endorser() []byte
func (*ProposalResponse) EndorserSignature ¶
func (r *ProposalResponse) EndorserSignature() []byte
func (*ProposalResponse) Payload ¶
func (r *ProposalResponse) Payload() []byte
func (*ProposalResponse) ResponseMessage ¶
func (r *ProposalResponse) ResponseMessage() string
func (*ProposalResponse) ResponseStatus ¶
func (r *ProposalResponse) ResponseStatus() int32
func (*ProposalResponse) Results ¶
func (r *ProposalResponse) Results() []byte
func (*ProposalResponse) VerifyEndorsement ¶ added in v0.4.0
func (r *ProposalResponse) VerifyEndorsement(provider VerifierProvider) error
type SignedProposal ¶
type SignedProposal struct {
// contains filtered or unexported fields
}
func (*SignedProposal) ChaincodeName ¶
func (p *SignedProposal) ChaincodeName() string
func (*SignedProposal) ChaincodeVersion ¶
func (p *SignedProposal) ChaincodeVersion() string
func (*SignedProposal) ProposalBytes ¶
func (p *SignedProposal) ProposalBytes() []byte
func (*SignedProposal) ProposalHash ¶
func (p *SignedProposal) ProposalHash() []byte
func (*SignedProposal) Signature ¶
func (p *SignedProposal) Signature() []byte
type SignerService ¶
type SignerService struct {
// contains filtered or unexported fields
}
type SigningIdentity ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) AppendParameter ¶
func (t *Transaction) AppendParameter(p []byte)
func (*Transaction) AppendProposalResponse ¶
func (t *Transaction) AppendProposalResponse(response *ProposalResponse) error
func (*Transaction) Bytes ¶
func (t *Transaction) Bytes() ([]byte, error)
func (*Transaction) BytesNoTransient ¶
func (t *Transaction) BytesNoTransient() ([]byte, error)
func (*Transaction) Chaincode ¶
func (t *Transaction) Chaincode() string
func (*Transaction) ChaincodeVersion ¶
func (t *Transaction) ChaincodeVersion() string
func (*Transaction) Channel ¶
func (t *Transaction) Channel() string
func (*Transaction) Close ¶
func (t *Transaction) Close()
func (*Transaction) Creator ¶
func (t *Transaction) Creator() view.Identity
func (*Transaction) Done ¶
func (t *Transaction) Done() error
func (*Transaction) Endorse ¶
func (t *Transaction) Endorse() error
func (*Transaction) EndorseProposal ¶
func (t *Transaction) EndorseProposal() error
func (*Transaction) EndorseProposalResponse ¶
func (t *Transaction) EndorseProposalResponse() error
func (*Transaction) EndorseProposalResponseWithIdentity ¶
func (t *Transaction) EndorseProposalResponseWithIdentity(identity view.Identity) error
func (*Transaction) EndorseProposalWithIdentity ¶
func (t *Transaction) EndorseProposalWithIdentity(identity view.Identity) error
func (*Transaction) EndorseWithIdentity ¶
func (t *Transaction) EndorseWithIdentity(identity view.Identity) error
func (*Transaction) EndorseWithSigner ¶
func (t *Transaction) EndorseWithSigner(identity view.Identity, s Signer) error
func (*Transaction) Envelope ¶ added in v0.2.0
func (t *Transaction) Envelope() (*Envelope, error)
func (*Transaction) FabricNetworkService ¶
func (t *Transaction) FabricNetworkService() *NetworkService
func (*Transaction) From ¶
func (t *Transaction) From(payload *Transaction) (err error)
func (*Transaction) Function ¶
func (t *Transaction) Function() string
func (*Transaction) GetRWSet ¶
func (t *Transaction) GetRWSet() (*RWSet, error)
func (*Transaction) ID ¶
func (t *Transaction) ID() string
func (*Transaction) Network ¶
func (t *Transaction) Network() string
func (*Transaction) Nonce ¶
func (t *Transaction) Nonce() []byte
func (*Transaction) Parameters ¶
func (t *Transaction) Parameters() [][]byte
func (*Transaction) Proposal ¶
func (t *Transaction) Proposal() *Proposal
func (*Transaction) ProposalHasBeenEndorsedBy ¶
func (t *Transaction) ProposalHasBeenEndorsedBy(party view.Identity) error
func (*Transaction) ProposalResponse ¶
func (t *Transaction) ProposalResponse() ([]byte, error)
func (*Transaction) ProposalResponses ¶
func (t *Transaction) ProposalResponses() ([]*ProposalResponse, error)
func (*Transaction) RWS ¶
func (t *Transaction) RWS() *RWSet
func (*Transaction) Raw ¶
func (t *Transaction) Raw() ([]byte, error)
func (*Transaction) ResetTransient ¶
func (t *Transaction) ResetTransient()
func (*Transaction) Results ¶
func (t *Transaction) Results() ([]byte, error)
func (*Transaction) SetFromBytes ¶
func (t *Transaction) SetFromBytes(raw []byte) error
func (*Transaction) SetFromEnvelopeBytes ¶
func (t *Transaction) SetFromEnvelopeBytes(raw []byte) error
func (*Transaction) SetParameterAt ¶
func (t *Transaction) SetParameterAt(i int, p []byte) error
func (*Transaction) SetProposal ¶
func (t *Transaction) SetProposal(chaincode string, version string, function string, params ...string)
func (*Transaction) SetRWSet ¶
func (t *Transaction) SetRWSet() error
func (*Transaction) SignedProposal ¶
func (t *Transaction) SignedProposal() *SignedProposal
func (*Transaction) StoreTransient ¶
func (t *Transaction) StoreTransient() error
func (*Transaction) Transient ¶
func (t *Transaction) Transient() TransientMap
type TransactionFilter ¶ added in v0.4.0
type TransactionFilter = driver.TransactionFilter
TransactionFilter is used to filter unknown transactions. If the filter accepts, the transaction is processed by the commit pipeline anyway.
type TransactionManager ¶
type TransactionManager struct {
// contains filtered or unexported fields
}
func (*TransactionManager) ComputeTxID ¶
func (t *TransactionManager) ComputeTxID(id *TxID) string
func (*TransactionManager) NewEnvelope ¶
func (t *TransactionManager) NewEnvelope() *Envelope
func (*TransactionManager) NewProposalResponseFromBytes ¶
func (t *TransactionManager) NewProposalResponseFromBytes(raw []byte) (*ProposalResponse, error)
func (*TransactionManager) NewTransaction ¶
func (t *TransactionManager) NewTransaction(opts ...TransactionOption) (*Transaction, error)
func (*TransactionManager) NewTransactionFromBytes ¶
func (t *TransactionManager) NewTransactionFromBytes(raw []byte, opts ...TransactionOption) (*Transaction, error)
func (*TransactionManager) NewTransactionFromEnvelopeBytes ¶ added in v0.4.0
func (t *TransactionManager) NewTransactionFromEnvelopeBytes(raw []byte, opts ...TransactionOption) (*Transaction, error)
type TransactionOption ¶
type TransactionOption func(*TransactionOptions) error
func WithChannel ¶
func WithChannel(channel string) TransactionOption
func WithContext ¶ added in v0.4.1
func WithContext(ctx context.Context) TransactionOption
func WithCreator ¶
func WithCreator(creator view.Identity) TransactionOption
func WithNonce ¶
func WithNonce(nonce []byte) TransactionOption
func WithRawRequest ¶ added in v0.4.0
func WithRawRequest(rawRequest []byte) TransactionOption
func WithTransactionType ¶ added in v0.4.0
func WithTransactionType(tt TransactionType) TransactionOption
func WithTxID ¶
func WithTxID(txid string) TransactionOption
type TransactionOptions ¶
type TransactionOptions struct { Creator view.Identity Nonce []byte TxID string Channel string RawRequest []byte TransactionType TransactionType Context context.Context }
func CompileTransactionOptions ¶ added in v0.2.0
func CompileTransactionOptions(opts ...TransactionOption) (*TransactionOptions, error)
type TransactionType ¶ added in v0.4.0
type TransactionType = driver.TransactionType
type TransientMap ¶
func (TransientMap) Exists ¶
func (m TransientMap) Exists(key string) bool
func (TransientMap) Get ¶
func (m TransientMap) Get(id string) []byte
func (TransientMap) GetState ¶
func (m TransientMap) GetState(key driver.PKey, state interface{}) error
func (TransientMap) IsEmpty ¶
func (m TransientMap) IsEmpty() bool
func (TransientMap) SetState ¶
func (m TransientMap) SetState(key string, state interface{}) error
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault models a key-value store that can be updated by committing rwsets
func (*Vault) DiscardTx ¶
DiscardTx discards the transaction with the given transaction id. If no error occurs, invoking Status on the same transaction id will return the Invalid flag.
func (*Vault) InspectRWSet ¶ added in v0.4.0
func (c *Vault) InspectRWSet(ctx context.Context, rwset []byte, namespaces ...driver.Namespace) (*RWSet, error)
InspectRWSet returns an ephemeral RWSet for this ledger whose content is unmarshalled from the passed bytes. If namespaces is not empty, the returned RWSet will be filtered by the passed namespaces
func (*Vault) NewQueryExecutor ¶
func (*Vault) NewRWSet ¶
NewRWSet returns a RWSet for this ledger. A client may obtain more than one such simulator; they are made unique by way of the supplied txid
func (*Vault) NewRWSetFromBytes ¶ added in v0.4.1
func (c *Vault) NewRWSetFromBytes(ctx context.Context, txid driver.TxID, rwset []byte) (*RWSet, error)
NewRWSetFromBytes returns a RWSet for this ledger whose content is unmarshalled from the passed bytes. A client may obtain more than one such simulator; they are made unique by way of the supplied txid
func (*Vault) StoreEnvelope ¶
func (*Vault) StoreTransaction ¶
func (*Vault) StoreTransient ¶
type VerifierProvider ¶ added in v0.4.0
type VerifierProvider = driver.VerifierProvider
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
generic/msp/driver/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
sdk
|
|
services
|
|
storage/vault/mocks
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
state/cc/query
module
|