Documentation ¶
Index ¶
- Constants
- Variables
- func NewChannel(nw driver.FabricNetworkService, name string, quiet bool) (driver.Channel, error)
- func NewEndpointResolver(resolver Resolver, es EndpointService) (*endpointResolver, error)
- type Block
- type Channel
- func (c *Channel) ApplyBundle(bundle *channelconfig.Bundle) error
- func (c *Channel) Chaincode(name string) driver.Chaincode
- func (c *Channel) Close() error
- func (c *Channel) CommitConfig(blockNumber uint64, raw []byte, env *common.Envelope) error
- func (c *Channel) CommitTX(txid string, block uint64, indexInBlock int, envelope *common.Envelope) (err error)
- func (c *Channel) Config() *config2.Channel
- func (c *Channel) DefaultSigner() discovery.Signer
- func (c *Channel) DiscardTx(txid string) error
- func (c *Channel) EnvelopeService() driver.EnvelopeService
- func (c *Channel) FetchAndStoreEnvelope(txID string) error
- func (c *Channel) GetBlockByNumber(number uint64) (driver.Block, error)
- func (c *Channel) GetBlockNumberByTxID(txID string) (uint64, error)
- func (c *Channel) GetClientConfig(tlsRootCerts [][]byte, UseTLS bool) (*grpc.ClientConfig, string, error)
- func (c *Channel) GetEphemeralRWSet(rwset []byte, namespaces ...string) (driver.RWSet, error)
- func (c *Channel) GetMSPIDs() []string
- func (c *Channel) GetProcessNamespace() []string
- func (c *Channel) GetRWSet(txid string, rwset []byte) (driver.RWSet, error)
- func (c *Channel) GetRWSetFromETx(txID string) (driver.RWSet, driver.ProcessTransaction, error)
- func (c *Channel) GetRWSetFromEvn(txID string) (driver.RWSet, driver.ProcessTransaction, error)
- func (c *Channel) GetTransactionByID(txID string) (driver.ProcessedTransaction, error)
- func (c *Channel) GetVerifier(identity view.Identity) (api2.Verifier, error)
- func (c *Channel) Init() error
- func (c *Channel) IsFinal(ctx context.Context, txID string) error
- func (c *Channel) IsFinalForParties(txID string, parties ...view.Identity) error
- func (c *Channel) IsValid(identity view.Identity) error
- func (c *Channel) MSPManager() driver.MSPManager
- func (c *Channel) MetadataService() driver.MetadataService
- func (c *Channel) Name() string
- func (c *Channel) NewPeerClientForAddress(cc grpc.ConnectionConfig) (peer2.Client, error)
- func (c *Channel) NewQueryExecutor() (driver.QueryExecutor, error)
- func (c *Channel) NewRWSet(txid string) (driver.RWSet, error)
- func (c *Channel) ProcessNamespace(nss ...string) error
- func (c *Channel) ReloadConfigTransactions() error
- func (c *Channel) Resources() channelconfig.Resources
- func (c *Channel) Scan(ctx context.Context, txID string, callback driver.DeliveryCallback) error
- func (c *Channel) StartDelivery(ctx context.Context) error
- func (c *Channel) Status(txid string) (driver.ValidationCode, []string, error)
- func (c *Channel) SubscribeTxStatusChanges(txID string, listener driver.TxStatusChangeListener) error
- func (c *Channel) TransactionService() driver.EndorserTransactionService
- func (c *Channel) UnsubscribeTxStatusChanges(txID string, listener driver.TxStatusChangeListener) error
- type Delivery
- type EndpointService
- type MSPManager
- type Network
- func (f *Network) Broadcast(context context.Context, blob interface{}) error
- func (f *Network) Channel(name string) (driver.Channel, error)
- func (f *Network) Channels() []string
- func (f *Network) Committer(name string) (driver.Committer, error)
- func (f *Network) Config() *config2.Config
- func (f *Network) ConfigService() driver.ConfigService
- func (f *Network) DefaultChannel() string
- func (f *Network) IdentityProvider() driver.IdentityProvider
- func (f *Network) Init() error
- func (f *Network) Ledger(name string) (driver.Ledger, error)
- func (f *Network) LocalMembership() driver.LocalMembership
- func (f *Network) Name() string
- func (f *Network) Orderers() []*grpc.ConnectionConfig
- func (f *Network) Peers() []*grpc.ConnectionConfig
- func (f *Network) PickOrderer() *grpc.ConnectionConfig
- func (f *Network) PickPeer(ft driver.PeerFunctionType) *grpc.ConnectionConfig
- func (f *Network) ProcessorManager() driver.ProcessorManager
- func (f *Network) SetConfigOrderers(o channelconfig.Orderer, orderers []*grpc.ConnectionConfig) error
- func (f *Network) SetConsensusType(consensusType string) error
- func (f *Network) SignerService() driver.SignerService
- func (f *Network) TransactionManager() driver.TransactionManager
- type NewChannelFunc
- type RWSetLoader
- type Resolver
- type SerializableSigner
- type SigService
- func (s *SigService) GetSigner(id view.Identity) (driver.Signer, error)
- func (s *SigService) GetSigningIdentity(id view.Identity) (driver.SigningIdentity, error)
- func (s *SigService) GetVerifier(id view.Identity) (driver.Verifier, error)
- func (s *SigService) RegisterSigner(identity view.Identity, signer driver.Signer, verifier driver.Verifier) error
- type TXIDStore
- type TxEventsListener
- type ValidationFlags
Constants ¶
const ( GetBlockByNumber string = "GetBlockByNumber" GetTransactionByID string = "GetTransactionByID" GetBlockByTxID string = "GetBlockByTxID" DefaultNumRetries = 3 DefaultRetrySleep = 1 * time.Second )
These are function names from Invoke first parameter
Variables ¶
var ( WaitForEventTimeout = 300 * time.Second FinalityWaitTimeout = 20 * time.Second )
Functions ¶
func NewChannel ¶ added in v0.3.0
func NewEndpointResolver ¶
func NewEndpointResolver(resolver Resolver, es EndpointService) (*endpointResolver, error)
Types ¶
type Block ¶
Block wraps a Fabric block
func (*Block) ProcessedTransaction ¶
func (b *Block) ProcessedTransaction(i int) (driver.ProcessedTransaction, error)
ProcessedTransaction returns the ProcessedTransaction at passed index
type Channel ¶ added in v0.3.0
type Channel struct { SP view2.ServiceProvider ChannelConfig *config2.Channel NetworkConfig *config2.Config Network *Network ChannelName string Finality driver.Finality Vault *vault.Vault ProcessNamespaces []string ExternalCommitter *committer.ExternalCommitter ES driver.EnvelopeService TS driver.EndorserTransactionService MS driver.MetadataService DeliveryService Delivery driver.TXIDStore RWSetLoader driver.RWSetLoader // ResourcesApplyLock is used to serialize calls to CommitConfig and bundle update processing. ResourcesApplyLock sync.Mutex // ResourcesLock is used to serialize access to resources ResourcesLock sync.RWMutex // resources is used to acquire configuration bundle resources. ChannelResources channelconfig.Resources // chaincodes ChaincodesLock sync.RWMutex Chaincodes map[string]driver.Chaincode // connection pool ConnCache common2.CachingEndorserPool // events Subscribers *events.Subscribers EventsSubscriber events.Subscriber EventsPublisher events.Publisher }
func (*Channel) ApplyBundle ¶ added in v0.3.0
func (c *Channel) ApplyBundle(bundle *channelconfig.Bundle) error
func (*Channel) Chaincode ¶ added in v0.3.0
Chaincode returns a chaincode handler for the passed chaincode name
func (*Channel) CommitConfig ¶ added in v0.3.0
CommitConfig is used to validate and apply configuration transactions for a Channel.
func (*Channel) DefaultSigner ¶ added in v0.3.0
func (*Channel) EnvelopeService ¶ added in v0.3.0
func (c *Channel) EnvelopeService() driver.EnvelopeService
func (*Channel) FetchAndStoreEnvelope ¶ added in v0.3.0
FetchAndStoreEnvelope fetches from the ledger and stores the enveloped correspoding to the passed id
func (*Channel) GetBlockByNumber ¶ added in v0.3.0
GetBlockByNumber fetches a block by number
func (*Channel) GetBlockNumberByTxID ¶ added in v0.3.0
func (*Channel) GetClientConfig ¶ added in v0.3.0
func (*Channel) GetEphemeralRWSet ¶ added in v0.3.0
GetEphemeralRWSet 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 (*Channel) GetMSPIDs ¶ added in v0.3.0
GetMSPIDs retrieves the MSP IDs of the organizations in the current Channel configuration.
func (*Channel) GetProcessNamespace ¶ added in v0.3.0
func (*Channel) GetRWSet ¶ added in v0.3.0
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 (*Channel) GetRWSetFromETx ¶ added in v0.3.0
func (*Channel) GetRWSetFromEvn ¶ added in v0.3.0
func (*Channel) GetTransactionByID ¶ added in v0.3.0
func (c *Channel) GetTransactionByID(txID string) (driver.ProcessedTransaction, error)
func (*Channel) GetVerifier ¶ added in v0.3.0
func (*Channel) IsFinalForParties ¶ added in v0.3.0
func (*Channel) MSPManager ¶ added in v0.3.0
func (c *Channel) MSPManager() driver.MSPManager
MSPManager returns the msp.MSPManager that reflects the current Channel configuration. Users should not memoize references to this object.
func (*Channel) MetadataService ¶ added in v0.3.0
func (c *Channel) MetadataService() driver.MetadataService
func (*Channel) NewPeerClientForAddress ¶ added in v0.3.0
func (*Channel) NewQueryExecutor ¶ added in v0.3.0
func (c *Channel) NewQueryExecutor() (driver.QueryExecutor, error)
NewQueryExecutor gives handle to a query executor. A client can obtain more than one 'QueryExecutor's for parallel execution. Any synchronization should be performed at the implementation level if required
func (*Channel) NewRWSet ¶ added in v0.3.0
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 (*Channel) ProcessNamespace ¶ added in v0.3.0
func (*Channel) ReloadConfigTransactions ¶ added in v0.3.0
func (*Channel) Resources ¶ added in v0.3.0
func (c *Channel) Resources() channelconfig.Resources
Resources returns the active Channel configuration bundle.
func (*Channel) StartDelivery ¶ added in v0.3.0
func (*Channel) SubscribeTxStatusChanges ¶ added in v0.3.0
func (c *Channel) SubscribeTxStatusChanges(txID string, listener driver.TxStatusChangeListener) error
SubscribeTxStatusChanges registers a listener for transaction status changes for the passed transaction id. If the transaction id is empty, the listener will be called for all transactions.
func (*Channel) TransactionService ¶ added in v0.3.0
func (c *Channel) TransactionService() driver.EndorserTransactionService
func (*Channel) UnsubscribeTxStatusChanges ¶ added in v0.3.0
func (c *Channel) UnsubscribeTxStatusChanges(txID string, listener driver.TxStatusChangeListener) error
UnsubscribeTxStatusChanges unregisters a listener for transaction status changes for the passed transaction id. If the transaction id is empty, the listener will be called for all transactions.
type EndpointService ¶
type MSPManager ¶
type Network ¶ added in v0.3.0
type Network struct { SP view2.ServiceProvider ConsensusType string Metrics *metrics.Metrics Ordering driver.Ordering NewChannel NewChannelFunc ChannelMap map[string]driver.Channel ChannelMutex sync.RWMutex // contains filtered or unexported fields }
func NewNetwork ¶
func NewNetwork( sp view2.ServiceProvider, name string, config *config2.Config, idProvider driver.IdentityProvider, localMembership driver.LocalMembership, sigService driver.SignerService, metrics *metrics.Metrics, newChannel NewChannelFunc, ) (*Network, error)
func (*Network) ConfigService ¶ added in v0.3.0
func (f *Network) ConfigService() driver.ConfigService
func (*Network) DefaultChannel ¶ added in v0.3.0
func (*Network) IdentityProvider ¶ added in v0.3.0
func (f *Network) IdentityProvider() driver.IdentityProvider
func (*Network) LocalMembership ¶ added in v0.3.0
func (f *Network) LocalMembership() driver.LocalMembership
func (*Network) Orderers ¶ added in v0.3.0
func (f *Network) Orderers() []*grpc.ConnectionConfig
func (*Network) Peers ¶ added in v0.3.0
func (f *Network) Peers() []*grpc.ConnectionConfig
func (*Network) PickOrderer ¶ added in v0.3.0
func (f *Network) PickOrderer() *grpc.ConnectionConfig
func (*Network) PickPeer ¶ added in v0.3.0
func (f *Network) PickPeer(ft driver.PeerFunctionType) *grpc.ConnectionConfig
func (*Network) ProcessorManager ¶ added in v0.3.0
func (f *Network) ProcessorManager() driver.ProcessorManager
func (*Network) SetConfigOrderers ¶ added in v0.3.0
func (f *Network) SetConfigOrderers(o channelconfig.Orderer, orderers []*grpc.ConnectionConfig) error
func (*Network) SetConsensusType ¶ added in v0.3.0
SetConsensusType sets the consensus type the ordering service should use
func (*Network) SignerService ¶ added in v0.3.0
func (f *Network) SignerService() driver.SignerService
func (*Network) TransactionManager ¶ added in v0.3.0
func (f *Network) TransactionManager() driver.TransactionManager
type NewChannelFunc ¶ added in v0.3.0
type RWSetLoader ¶ added in v0.3.0
type RWSetLoader struct { Network string Channel string EnvelopeService driver.EnvelopeService TransactionService driver.EndorserTransactionService TransactionManager driver.TransactionManager Vault *vault.Vault }
func NewRWSetLoader ¶ added in v0.3.0
func NewRWSetLoader(network string, channel string, envelopeService driver.EnvelopeService, transactionService driver.EndorserTransactionService, transactionManager driver.TransactionManager, vault *vault.Vault) *RWSetLoader
func (*RWSetLoader) GetRWSetFromETx ¶ added in v0.3.0
func (c *RWSetLoader) GetRWSetFromETx(txID string) (driver.RWSet, driver.ProcessTransaction, error)
func (*RWSetLoader) GetRWSetFromEvn ¶ added in v0.3.0
func (c *RWSetLoader) GetRWSetFromEvn(txID string) (driver.RWSet, driver.ProcessTransaction, error)
type SerializableSigner ¶
type SigService ¶
type SigService struct {
// contains filtered or unexported fields
}
func NewSigService ¶
func NewSigService(sp view2.ServiceProvider) *SigService
func (*SigService) GetSigningIdentity ¶
func (s *SigService) GetSigningIdentity(id view.Identity) (driver.SigningIdentity, error)
func (*SigService) GetVerifier ¶
func (*SigService) RegisterSigner ¶
type TXIDStore ¶
type TXIDStore interface { fdriver.TXIDStore Get(txid string) (fdriver.ValidationCode, error) Set(txid string, code fdriver.ValidationCode) error }
type TxEventsListener ¶
type TxEventsListener struct {
// contains filtered or unexported fields
}
func (*TxEventsListener) OnReceive ¶
func (l *TxEventsListener) OnReceive(event events.Event)
type ValidationFlags ¶
type ValidationFlags []uint8