fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/channel Index | Files | Directories

package channel

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/channel"

Index

Package Files

cscc.go ledger.go qscc.go responsevalidator.go transactor.go

type Ledger Uses

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

Ledger is a client that provides access to the underlying ledger of a channel.

func NewLedger Uses

func NewLedger(chName string) (*Ledger, error)

NewLedger constructs a Ledger client for the current context and named channel.

func (*Ledger) QueryBlock Uses

func (c *Ledger) QueryBlock(reqCtx reqContext.Context, blockNumber uint64, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*common.Block, error)

QueryBlock queries the ledger for Block by block number. This query will be made to specified targets. blockNumber: The number which is the ID of the Block. It returns the block.

func (*Ledger) QueryBlockByHash Uses

func (c *Ledger) QueryBlockByHash(reqCtx reqContext.Context, blockHash []byte, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*common.Block, error)

QueryBlockByHash queries the ledger for Block by block hash. This query will be made to specified targets. Returns the block.

func (*Ledger) QueryBlockByTxID Uses

func (c *Ledger) QueryBlockByTxID(reqCtx reqContext.Context, txID fab.TransactionID, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*common.Block, error)

QueryBlockByTxID returns a block which contains a transaction This query will be made to specified targets. Returns the block.

func (*Ledger) QueryCollectionsConfig Uses

func (c *Ledger) QueryCollectionsConfig(reqCtx reqContext.Context, chaincodeName string, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*common.CollectionConfigPackage, error)

QueryCollectionsConfig queries the collections config for a chaincode on this channel.

func (*Ledger) QueryConfigBlock Uses

func (c *Ledger) QueryConfigBlock(reqCtx reqContext.Context, targets []fab.ProposalProcessor, verifier ResponseVerifier) (*common.Block, error)

QueryConfigBlock returns the current configuration block for the specified channel. If the peer doesn't belong to the channel, return error

func (*Ledger) QueryInfo Uses

func (c *Ledger) QueryInfo(reqCtx reqContext.Context, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*fab.BlockchainInfoResponse, error)

QueryInfo queries for various useful information on the state of the channel (height, known peers).

func (*Ledger) QueryInstantiatedChaincodes Uses

func (c *Ledger) QueryInstantiatedChaincodes(reqCtx reqContext.Context, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*pb.ChaincodeQueryResponse, error)

QueryInstantiatedChaincodes queries the instantiated chaincodes on this channel. This query will be made to specified targets.

func (*Ledger) QueryTransaction Uses

func (c *Ledger) QueryTransaction(reqCtx reqContext.Context, transactionID fab.TransactionID, targets []fab.ProposalProcessor, verifier ResponseVerifier) ([]*pb.ProcessedTransaction, error)

QueryTransaction queries the ledger for Transaction by number. This query will be made to specified targets. Returns the ProcessedTransaction information containing the transaction.

type ResponseVerifier Uses

type ResponseVerifier interface {
    Verify(response *fab.TransactionProposalResponse) error
    Match(response []*fab.TransactionProposalResponse) error
}

ResponseVerifier checks transaction proposal response(s)

type TransactionProposalResponseVerifier Uses

type TransactionProposalResponseVerifier struct {
    MinResponses int
}

TransactionProposalResponseVerifier struct is for verifying TransactionProposalResponse and matches config blocks

func (*TransactionProposalResponseVerifier) Match Uses

func (tprv *TransactionProposalResponseVerifier) Match(transactionProposalResponses []*fab.TransactionProposalResponse) error

Match verifies and matches transaction proposal responses

func (*TransactionProposalResponseVerifier) Verify Uses

func (tprv *TransactionProposalResponseVerifier) Verify(response *fab.TransactionProposalResponse) error

Verify checks transaction proposal response (empty)

type Transactor Uses

type Transactor struct {
    ChannelID string
    // contains filtered or unexported fields
}

Transactor enables sending transactions and transaction proposals on the channel.

func NewTransactor Uses

func NewTransactor(reqCtx reqContext.Context, cfg fab.ChannelCfg) (*Transactor, error)

NewTransactor returns a Transactor for the current context and channel config.

func (*Transactor) CreateTransaction Uses

func (t *Transactor) CreateTransaction(request fab.TransactionRequest) (*fab.Transaction, error)

CreateTransaction create a transaction with proposal response. TODO: should this be removed as it is purely a wrapper?

func (*Transactor) CreateTransactionHeader Uses

func (t *Transactor) CreateTransactionHeader(opts ...fab.TxnHeaderOpt) (fab.TransactionHeader, error)

CreateTransactionHeader creates a Transaction Header based on the current context.

func (*Transactor) SendTransaction Uses

func (t *Transactor) SendTransaction(tx *fab.Transaction) (*fab.TransactionResponse, error)

SendTransaction send a transaction to the chain’s orderer service (one or more orderer endpoints) for consensus and committing to the ledger.

func (*Transactor) SendTransactionProposal Uses

func (t *Transactor) SendTransactionProposal(proposal *fab.TransactionProposal, targets []fab.ProposalProcessor) ([]*fab.TransactionProposalResponse, error)

SendTransactionProposal sends a TransactionProposal to the target peers.

Directories

PathSynopsis
membership

Package channel imports 16 packages (graph) and is imported by 4 packages. Updated 2019-08-28. Refresh now. Tools for package owners.