fabric: github.com/hyperledger/fabric/core/deliverservice Index | Files | Directories

package deliverclient

import "github.com/hyperledger/fabric/core/deliverservice"

Index

Package Files

client.go deliveryclient.go requester.go

func DefaultABCFactory Uses

func DefaultABCFactory(conn *grpc.ClientConn) orderer.AtomicBroadcastClient

func DefaultConnectionFactory Uses

func DefaultConnectionFactory(channelID string) func(endpointCriteria comm.EndpointCriteria) (*grpc.ClientConn, error)

func NewBroadcastClient Uses

func NewBroadcastClient(prod comm.ConnectionProducer, clFactory clientFactory, onConnect broadcastSetup, bos retryPolicy) *broadcastClient

NewBroadcastClient returns a broadcastClient with the given params

func NewDeliverService Uses

func NewDeliverService(conf *Config, connConfig ConnectionCriteria) (*deliverServiceImpl, error)

NewDeliverService construction function to create and initialize delivery service instance. It tries to establish connection to the specified in the configuration ordering service, in case it fails to dial to it, return nil

type Config Uses

type Config struct {
    // ConnFactory returns a function that creates a connection to an endpoint
    ConnFactory func(channelID string) func(endpointCriteria comm.EndpointCriteria) (*grpc.ClientConn, error)
    // ABCFactory creates an AtomicBroadcastClient out of a connection
    ABCFactory func(*grpc.ClientConn) orderer.AtomicBroadcastClient
    // CryptoSvc performs cryptographic actions like message verification and signing
    // and identity validation
    CryptoSvc api.MessageCryptoService
    // Gossip enables to enumerate peers in the channel, send a message to peers,
    // and add a block to the gossip state transfer layer
    Gossip blocksprovider.GossipServiceAdapter
}

Config dictates the DeliveryService's properties, namely how it connects to an ordering service endpoint, how it verifies messages received from it, and how it disseminates the messages to other peers

type ConnectionCriteria Uses

type ConnectionCriteria struct {
    // Endpoints specifies the endpoints of the ordering service.
    OrdererEndpoints []string
    // Organizations denotes a list of organizations
    Organizations []string
    // OrdererEndpointsByOrg specifies the endpoints of the ordering service grouped by orgs.
    OrdererEndpointsByOrg map[string][]string
}

ConnectionCriteria defines how to connect to ordering service nodes.

type DeliverService Uses

type DeliverService interface {
    // StartDeliverForChannel dynamically starts delivery of new blocks from ordering service
    // to channel peers.
    // When the delivery finishes, the finalizer func is called
    StartDeliverForChannel(chainID string, ledgerInfo blocksprovider.LedgerInfo, finalizer func()) error

    // StopDeliverForChannel dynamically stops delivery of new blocks from ordering service
    // to channel peers.
    StopDeliverForChannel(chainID string) error

    // UpdateEndpoints updates the ordering endpoints for the given chain.
    UpdateEndpoints(chainID string, connCriteria ConnectionCriteria) error

    // Stop terminates delivery service and closes the connection
    Stop()
}

DeliverService used to communicate with orderers to obtain new blocks and send them to the committer service

Directories

PathSynopsis
blocksprovider
mocks

Package deliverclient imports 19 packages (graph) and is imported by 1 packages. Updated 2019-06-15. Refresh now. Tools for package owners.