{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package deliverclient\n\n## Functions\n\n```go\nfunc DefaultABCFactory(conn *grpc.ClientConn) orderer.AtomicBroadcastClient\n```\n\n```go\nfunc DefaultConnectionFactory(channelID string, endpointOverrides map[string]*comm.OrdererEndpoint) func(endpointCriteria comm.EndpointCriteria) (*grpc.ClientConn, error)\n```\n\n```go\nfunc NewBroadcastClient(prod comm.ConnectionProducer, clFactory clientFactory, onConnect broadcastSetup, bos retryPolicy) *broadcastClient\n```\nNewBroadcastClient returns a broadcastClient with the given params\n\n```go\nfunc NewDeliverService(conf *Config, connConfig ConnectionCriteria) (*deliverServiceImpl, error)\n```\nNewDeliverService 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\n\n## Types\n\n```go\ntype Config struct {\n\t// ConnFactory returns a function that creates a connection to an endpoint\n\tConnFactory func(channelID string, endpointOverrides map[string]*comm.OrdererEndpoint) func(endpointCriteria comm.EndpointCriteria) (*grpc.ClientConn, error)\n\t// ABCFactory creates an AtomicBroadcastClient out of a connection\n\tABCFactory func(*grpc.ClientConn) orderer.AtomicBroadcastClient\n\t// CryptoSvc performs cryptographic actions like message verification and signing\n\t// and identity validation\n\tCryptoSvc api.MessageCryptoService\n\t// Gossip enables to enumerate peers in the channel, send a message to peers,\n\t// and add a block to the gossip state transfer layer\n\tGossip blocksprovider.GossipServiceAdapter\n}\n```\nConfig 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\n\n```go\ntype ConnectionCriteria struct {\n\t// Endpoints specifies the endpoints of the ordering service.\n\tOrdererEndpoints []string\n\t// Organizations denotes a list of organizations\n\tOrganizations []string\n\t// OrdererEndpointsByOrg specifies the endpoints of the ordering service grouped by orgs.\n\tOrdererEndpointsByOrg map[string][]string\n\t// OrdererEndpointOverrides specifies a map of endpoints to override.  The map\n\t// key is the configured endpoint address to match and the value is the\n\t// endpoint to use instead.\n\tOrdererEndpointOverrides map[string]*comm.OrdererEndpoint\n}\n```\nConnectionCriteria defines how to connect to ordering service nodes.\n\n```go\ntype DeliverService interface {\n\t// StartDeliverForChannel dynamically starts delivery of new blocks from ordering service\n\t// to channel peers.\n\t// When the delivery finishes, the finalizer func is called\n\tStartDeliverForChannel(chainID string, ledgerInfo blocksprovider.LedgerInfo, finalizer func()) error\n\n\t// StopDeliverForChannel dynamically stops delivery of new blocks from ordering service\n\t// to channel peers.\n\tStopDeliverForChannel(chainID string) error\n\n\t// UpdateEndpoints updates the ordering endpoints for the given chain.\n\tUpdateEndpoints(chainID string, connCriteria ConnectionCriteria) error\n\n\t// Stop terminates delivery service and closes the connection\n\tStop()\n}\n```\nDeliverService used to communicate with orderers to obtain new blocks and send them to the committer service\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/deliverservice","name":"deliverclient","synopsis":"","isRedistributable":true}
