fabric

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryPublicParamsFunction = "queryPublicParams"
	QueryTokensFunctions      = "queryTokens"
	AreTokensSpent            = "areTokensSpent"
)

Variables

This section is empty.

Functions

func NewChaincodePublicParamsFetcher added in v0.4.0

func NewChaincodePublicParamsFetcher(viewManager *view.Manager) *chaincodePublicParamsFetcher

func NewGenericDriver added in v0.4.0

func NewGenericDriver(
	fnsProvider *fabric.NetworkServiceProvider,
	vaultProvider *vault2.Provider,
	tokensManager *tokens.Manager,
	configProvider *config.Service,
	viewManager *view.Manager,
	viewRegistry driver2.Registry,
	filterProvider *common.AcceptTxInDBFilterProvider,
	tmsProvider *token.ManagementServiceProvider,
	tracerProvider trace.TracerProvider,
	identityProvider driver2.IdentityProvider,
	configService driver2.ConfigService,
) driver.Driver

func NewSpentTokenExecutorProvider added in v0.4.0

func NewSpentTokenExecutorProvider(fnsProvider *fabric.NetworkServiceProvider, keyTranslator translator.KeyTranslator) *spentTokenFetcherProvider

func NewTokenExecutorProvider added in v0.4.0

func NewTokenExecutorProvider(fnsProvider *fabric.NetworkServiceProvider) *tokenFetcherProvider

Types

type Driver

type Driver struct {
	EndorsementServiceProvider EndorsementServiceProvider
	// contains filtered or unexported fields
}

func NewDriver added in v0.4.0

func NewDriver(
	fnsProvider *fabric.NetworkServiceProvider,
	vaultProvider *vault2.Provider,
	tokensManager *tokens.Manager,
	configService *config.Service,
	viewManager *view.Manager,
	viewRegistry driver2.Registry,
	filterProvider *common.AcceptTxInDBFilterProvider,
	tmsProvider *token.ManagementServiceProvider,
	tracerProvider trace.TracerProvider,
	identityProvider driver2.IdentityProvider,
	defaultPublicParamsFetcher driver3.NetworkPublicParamsFetcher,
	tokenQueryExecutorProvider driver.TokenQueryExecutorProvider,
	spentTokenQueryExecutorProvider driver.SpentTokenQueryExecutorProvider,
	keyTranslator translator.KeyTranslator,
	flmProvider finality.ListenerManagerProvider,
	endorsementServiceProvider EndorsementServiceProvider,
	supportedDrivers ...string,
) *Driver

func (*Driver) New

func (d *Driver) New(network, channel string) (driver.Network, error)

type EndorsementService added in v0.4.0

type EndorsementService = endorsement.Service

type EndorsementServiceProvider added in v0.4.0

type EndorsementServiceProvider = lazy.Provider[token2.TMSID, EndorsementService]

type GetTMSProviderFunc added in v0.4.0

type GetTMSProviderFunc = func() *token.ManagementServiceProvider

type GetTokensFunc added in v0.4.0

type GetTokensFunc = func() (*tokens.Tokens, error)

type Network

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

func NewNetwork

func NewNetwork(
	n *fabric.NetworkService,
	ch *fabric.Channel,
	newVault NewVaultFunc,
	configuration common2.Configuration,
	filterProvider common2.TransactionFilterProvider[*common2.AcceptTxInDBsFilter],
	tokensProvider *tokens2.Manager,
	viewManager ViewManager,
	tmsProvider *token2.ManagementServiceProvider,
	endorsementServiceProvider EndorsementServiceProvider,
	tokenQueryExecutor driver.TokenQueryExecutor,
	tracerProvider trace.TracerProvider,
	defaultPublicParamsFetcher driver3.NetworkPublicParamsFetcher,
	spentTokenQueryExecutor driver.SpentTokenQueryExecutor,
	keyTranslator translator.KeyTranslator,
	flm finality.ListenerManager,
) *Network

func (*Network) AddFinalityListener added in v0.4.0

func (n *Network) AddFinalityListener(namespace string, txID string, listener driver.FinalityListener) error

func (*Network) AreTokensSpent

func (n *Network) AreTokensSpent(ctx context.Context, namespace string, tokenIDs []*token.ID, meta []string) ([]bool, error)

func (*Network) Broadcast

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

func (*Network) Channel

func (n *Network) Channel() string

func (*Network) ComputeTxID

func (n *Network) ComputeTxID(id *driver.TxID) string

func (*Network) Connect added in v0.4.0

func (n *Network) Connect(ns string) ([]token2.ServiceOption, error)

func (*Network) FetchPublicParameters

func (n *Network) FetchPublicParameters(namespace string) ([]byte, error)

func (*Network) Ledger

func (n *Network) Ledger() (driver.Ledger, error)

func (*Network) LocalMembership

func (n *Network) LocalMembership() driver.LocalMembership

func (*Network) LookupTransferMetadataKey

func (n *Network) LookupTransferMetadataKey(namespace string, startingTxID string, key string, timeout time.Duration, stopOnLastTx bool) ([]byte, error)

func (*Network) Name

func (n *Network) Name() string

func (*Network) NewEnvelope

func (n *Network) NewEnvelope() driver.Envelope

func (*Network) Normalize added in v0.4.0

func (n *Network) Normalize(opt *token2.ServiceOptions) (*token2.ServiceOptions, error)

func (*Network) ProcessNamespace added in v0.3.0

func (n *Network) ProcessNamespace(namespace string) error

func (*Network) QueryTokens

func (n *Network) QueryTokens(ctx context.Context, namespace string, IDs []*token.ID) ([][]byte, error)

func (*Network) RemoveFinalityListener added in v0.4.0

func (n *Network) RemoveFinalityListener(txID string, listener driver.FinalityListener) error

func (*Network) RequestApproval

func (n *Network) RequestApproval(context view.Context, tms *token2.ManagementService, requestRaw []byte, signer view.Identity, txID driver.TxID) (driver.Envelope, error)

func (*Network) TokenVault added in v0.4.0

func (n *Network) TokenVault(namespace string) (driver.TokenVault, error)

type NewVaultFunc added in v0.4.0

type NewVaultFunc = func(network, channel, namespace string) (driver.TokenVault, error)

type RWSWrapper

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

func NewRWSWrapper

func NewRWSWrapper(r *fabric.RWSet) *RWSWrapper

func (*RWSWrapper) Bytes

func (rwset *RWSWrapper) Bytes() ([]byte, error)

func (*RWSWrapper) DeleteState

func (rwset *RWSWrapper) DeleteState(namespace string, key string) error

func (*RWSWrapper) Done

func (rwset *RWSWrapper) Done()

func (*RWSWrapper) Equals

func (rwset *RWSWrapper) Equals(r interface{}, namespace string) error

func (*RWSWrapper) GetState

func (rwset *RWSWrapper) GetState(namespace string, key string) ([]byte, error)

func (*RWSWrapper) SetState

func (rwset *RWSWrapper) SetState(namespace string, key string, value []byte) error

type RWSetProcessor

type RWSetProcessor struct {
	GetTokens      GetTokensFunc
	GetTMSProvider GetTMSProviderFunc
	KeyTranslator  translator.KeyTranslator
	// contains filtered or unexported fields
}

func NewTokenRWSetProcessor

func NewTokenRWSetProcessor(network string, ns string, GetTokens GetTokensFunc, GetTMSProvider GetTMSProviderFunc, KeyTranslator translator.KeyTranslator) *RWSetProcessor

func (*RWSetProcessor) Process

type ViewManager added in v0.4.0

type ViewManager interface {
	InitiateView(view view2.View, ctx context.Context) (interface{}, error)
}

type ViewRegistry added in v0.4.0

type ViewRegistry interface {
	RegisterResponder(responder view.View, initiatedBy interface{}) error
}

Directories

Path Synopsis
tcc
mock
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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