fabric

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Index

Constants

View Source
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

func GetChannel(sp view2.ServiceProvider, network, channel string) (*NetworkService, *Channel, error)

GetChannel returns the requested channel for the passed network

func GetDefaultChannel

func GetDefaultChannel(sp view2.ServiceProvider) (*NetworkService, *Channel, error)

GetDefaultChannel returns the default channel of the default fns

func GetFabricNetworkNames

func GetFabricNetworkNames(sp view2.ServiceProvider) ([]string, error)

Types

type Block

type Block struct {
	// contains filtered or unexported fields
}

Block models a Fabric block

func (*Block) DataAt

func (b *Block) DataAt(i int) []byte

DataAt returns the data stored at the passed index

type BlockCallback added in v0.4.0

type BlockCallback func(context.Context, *common.Block) (bool, error)

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 (c *Chaincode) IsAvailable() (bool, error)

func (*Chaincode) IsPrivate

func (c *Chaincode) IsPrivate() bool

func (*Chaincode) Query

func (c *Chaincode) Query(function string, args ...interface{}) *ChaincodeQuery

func (*Chaincode) Version

func (c *Chaincode) Version() (string, error)

Version returns the version of this chaincode. It returns an error if a failure happens during the computation.

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) Chaincode

func (c *Channel) Chaincode(name string) *Chaincode

func (*Channel) Committer

func (c *Channel) Committer() *Committer

func (*Channel) Delivery

func (c *Channel) Delivery() *Delivery

func (*Channel) EnvelopeService

func (c *Channel) EnvelopeService() *EnvelopeService

func (*Channel) Finality

func (c *Channel) Finality() *Finality

func (*Channel) Ledger

func (c *Channel) Ledger() *Ledger

func (*Channel) MSPManager

func (c *Channel) MSPManager() *MSPManager

func (*Channel) MetadataService

func (c *Channel) MetadataService() *MetadataService

func (*Channel) Name

func (c *Channel) Name() string

func (*Channel) Vault

func (c *Channel) Vault() *Vault

type Committer

type Committer struct {
	// contains filtered or unexported fields
}

func NewCommitter

func NewCommitter(ch driver.Channel) *Committer

func (*Committer) AddFinalityListener added in v0.4.0

func (c *Committer) AddFinalityListener(txID string, 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

func (c *Committer) ProcessNamespace(nss ...string) error

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 string, listener FinalityListener) error

RemoveFinalityListener unregisters the passed listener.

func (*Committer) Status

func (c *Committer) Status(txID string) (ValidationCode, string, error)

Status returns a validation code this committer bind to the passed transaction id, plus a list of dependant transaction ids if they exist.

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

func (d *Delivery) Scan(ctx context.Context, txID string, callback DeliveryCallback) error

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

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) Bytes

func (e *Envelope) Bytes() ([]byte, error)

func (*Envelope) Creator

func (e *Envelope) Creator() []byte

func (*Envelope) FromBytes

func (e *Envelope) FromBytes(raw []byte) error

func (*Envelope) MarshalJSON

func (e *Envelope) MarshalJSON() ([]byte, error)

func (*Envelope) Nonce

func (e *Envelope) Nonce() []byte

func (*Envelope) Results

func (e *Envelope) Results() []byte

func (*Envelope) String

func (e *Envelope) String() string

func (*Envelope) TxID

func (e *Envelope) TxID() string

func (*Envelope) UnmarshalJSON

func (e *Envelope) UnmarshalJSON(raw []byte) error

type EnvelopeService

type EnvelopeService struct {
	// contains filtered or unexported fields
}

func (*EnvelopeService) Exists

func (m *EnvelopeService) Exists(txid string) bool

type EventListener

type EventListener struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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 Finality

type Finality struct {
	// contains filtered or unexported fields
}

func (*Finality) IsFinal

func (c *Finality) IsFinal(ctx context.Context, txID string) error

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

type IdentityOptions struct {
	IdemixEIDExtension bool
	AuditInfo          []byte
}

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

func (*IdentityProvider) Identity

func (i *IdentityProvider) Identity(label string) (view.Identity, error)

type Ledger

type Ledger struct {
	// contains filtered or unexported fields
}

Ledger models the ledger stored at a remote Fabric peer

func (*Ledger) GetBlockByNumber

func (l *Ledger) GetBlockByNumber(number uint64) (*Block, error)

GetBlockByNumber fetches a block by number

func (*Ledger) GetBlockNumberByTxID

func (l *Ledger) GetBlockNumberByTxID(txID string) (uint64, error)

GetBlockNumberByTxID returns the number of the block where the passed transaction appears

func (*Ledger) GetTransactionByID

func (l *Ledger) GetTransactionByID(txID string) (*ProcessedTransaction, error)

GetTransactionByID retrieves a transaction by id

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) IsMe

func (s *LocalMembership) IsMe(id view.Identity) bool

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)

func (*MSPManager) IsValid

func (c *MSPManager) IsValid(identity view.Identity) error

type MetadataService

type MetadataService struct {
	// contains filtered or unexported fields
}

func (*MetadataService) Exists

func (m *MetadataService) Exists(txid string) bool

func (*MetadataService) LoadTransient

func (m *MetadataService) LoadTransient(txid string) (TransientMap, error)

func (*MetadataService) StoreTransient

func (m *MetadataService) StoreTransient(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 view2.ServiceProvider) (*NetworkService, error)

GetDefaultFNS returns the default Fabric Network Service

func GetFabricNetworkService

func GetFabricNetworkService(sp view2.ServiceProvider, 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) Name

func (n *NetworkService) Name() string

Name 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 view2.ServiceProvider) (*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 Ordering

type Ordering struct {
	// contains filtered or unexported fields
}

func (*Ordering) Broadcast

func (n *Ordering) Broadcast(context context.Context, blob interface{}) error

type ProcessTransaction

type ProcessTransaction interface {
	Network() string
	Channel() string
	ID() string
	FunctionAndParameters() (string, []string)
}

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 Proposal

type Proposal struct {
	// contains filtered or unexported fields
}

func (*Proposal) Header

func (p *Proposal) Header() []byte

func (*Proposal) Payload

func (p *Proposal) Payload() []byte

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 RWSet

type RWSet struct {
	driver.RWSet
}

func NewRWSet added in v0.4.0

func NewRWSet(rws driver.RWSet) *RWSet

func (*RWSet) Equals

func (r *RWSet) Equals(rws interface{}, nss ...string) error

func (*RWSet) KeyExist

func (r *RWSet) KeyExist(key string, ns string) (bool, error)

KeyExist returns true if a key exist in the rwset otherwise false.

type Read

type Read = vault.VersionedRead

type Request

type Request interface {
	ID() string
}

type ResultsIterator

type ResultsIterator = vault.VersionedResultsIterator

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 Signer

type Signer interface {
	Sign(message []byte) ([]byte, error)
}

type SignerService

type SignerService struct {
	// contains filtered or unexported fields
}

func (*SignerService) GetSigner

func (s *SignerService) GetSigner(id view.Identity) (Signer, error)

type SigningIdentity

type SigningIdentity interface {
	Serialize() ([]byte, error)
	Sign(msg []byte) ([]byte, error)
}

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 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
}

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

type TransientMap map[string][]byte

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) Set

func (m TransientMap) Set(key string, raw []byte) error

func (TransientMap) SetState

func (m TransientMap) SetState(key string, state interface{}) error

type TxID

type TxID struct {
	Nonce   []byte
	Creator []byte
}

func (*TxID) String

func (t *TxID) String() string

type TxIDEntry

type TxIDEntry = driver.ByNum[ValidationCode]

type TxIDIterator

type TxIDIterator = fdriver.TxIDIterator

type ValidationCode

type ValidationCode = fdriver.ValidationCode

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) CommitTX

func (c *Vault) CommitTX(ctx context.Context, txID string, block driver.BlockNum, indexInBlock driver.TxNum) error

func (*Vault) DiscardTx

func (c *Vault) DiscardTx(txID string, message string) error

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) GetLastTxID

func (c *Vault) GetLastTxID() (string, error)

func (*Vault) GetRWSet

func (c *Vault) GetRWSet(txid string, rwset []byte) (*RWSet, error)

GetRWSet 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) InspectRWSet added in v0.4.0

func (c *Vault) InspectRWSet(rwset []byte, namespaces ...string) (*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 (c *Vault) NewQueryExecutor() (driver.QueryExecutor, error)

func (*Vault) NewRWSet

func (c *Vault) NewRWSet(txid string) (*RWSet, error)

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) Status

func (c *Vault) Status(id string) (ValidationCode, string, error)

func (*Vault) StoreEnvelope

func (c *Vault) StoreEnvelope(id string, env []byte) error

func (*Vault) StoreTransaction

func (c *Vault) StoreTransaction(id string, raw []byte) error

func (*Vault) StoreTransient

func (c *Vault) StoreTransient(id string, tm TransientMap) error

type Verifier

type Verifier = driver.Verifier

Verifier is an interface which wraps the Verify method.

type VerifierProvider added in v0.4.0

type VerifierProvider = driver.VerifierProvider

Jump to

Keyboard shortcuts

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