deliverclient

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultABCFactory

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

func DefaultConnectionFactory

func DefaultConnectionFactory(channelID string) func(endpoint string) (*grpc.ClientConn, error)

func NewBroadcastClient

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

newbroadcastclient返回具有给定参数的广播客户端

Types

type Config

type Config struct {
	//connfactory返回一个函数,该函数创建到端点的连接
	ConnFactory func(channelID string) func(endpoint string) (*grpc.ClientConn, error)
	//abcfactory通过连接创建AtomicBroadcastClient
	ABCFactory func(*grpc.ClientConn) orderer.AtomicBroadcastClient
	//Cryptosvc执行加密操作,如消息验证和签名
	//和身份验证
	CryptoSvc api.MessageCryptoService
	//八卦可以列举频道中的同龄人,向同龄人发送信息,
	//并向八卦状态传输层添加块
	Gossip blocksprovider.GossipServiceAdapter
	//端点指定排序服务的端点
	Endpoints []string
}

config指示deliveryService的属性, 也就是说,它如何连接到订购服务端点, 它如何验证从它接收到的消息, 以及它如何将消息传播给其他对等方

type DeliverService

type DeliverService interface {
	//StartDeliverForChannel从订购服务动态启动新块的交付
	//以引导同行。
	//传递完成后,将调用终结器func
	StartDeliverForChannel(chainID string, ledgerInfo blocksprovider.LedgerInfo, finalizer func()) error

	//StopDeliverForChannel从订购服务动态停止新块的交付
	//以引导同行。
	StopDeliverForChannel(chainID string) error

	//更新端点
	UpdateEndpoints(chainID string, endpoints []string) error

	//停止终止传递服务并关闭连接
	Stop()
}

DeliverService用于与订购方通信以获取 新块并将其发送到提交者服务

func NewDeliverService

func NewDeliverService(conf *Config) (DeliverService, error)

要创建和初始化的NewDeliverService构造函数 传递服务实例。它试图建立与 配置订购服务中指定的,以防 没有拨号,返回零

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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