peer

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigTxProcessors = customtx.Processors{
	common.HeaderType_CONFIG:            configTxProcessor,
	common.HeaderType_TOKEN_TRANSACTION: tokenTxProcessor,
}
View Source
var TransientStoreFactory = &storeProvider{stores: make(map[string]transientstore.Store)}

Functions

func CacheConfiguration

func CacheConfiguration() (err error)

cacheconfiguration计算并缓存常用常量和 计算常量作为包变量。以前的程序 这里嵌入了全局以保留原始抽象。

func CreateChainFromBlock

CreateChainFromBlock从配置块创建新链

func GetChannelConfig

func GetChannelConfig(cid string) channelconfig.Resources

getchannelconfig返回具有通道ID的链的通道配置。请注意 如果尚未创建链cid,则调用返回nil。

func GetChannelsInfo

func GetChannelsInfo() []*pb.ChannelInfo

getchannelsinfo返回一个数组,其中包含有关 这个对等体

func GetClientCertificate

func GetClientCertificate() (tls.Certificate, error)

getclientCertificate返回要用于GRPC客户端的TLS证书 连接

func GetCurrConfigBlock

func GetCurrConfigBlock(cid string) *common.Block

getcurrconfigblock返回指定链的缓存配置块。 注意,如果尚未创建链cid,则此调用返回nil。

func GetLedger

func GetLedger(cid string) ledger.PeerLedger

GetLedger返回具有链ID的链的分类帐。请注意 如果尚未创建链cid,则调用返回nil。

func GetLocalAddress

func GetLocalAddress() (string, error)

GetLocalAddress返回peer.address属性

func GetLocalIP

func GetLocalIP() string

getlocalip返回主机的非环回本地IP

func GetMSPIDs

func GetMSPIDs(cid string) []string

getmspids返回在此链上定义的每个应用程序msp的ID

func GetPeerEndpoint

func GetPeerEndpoint() (*pb.PeerEndpoint, error)

GetPeerEndpoint从缓存配置返回PeerEndpoint

func GetPolicyManager

func GetPolicyManager(cid string) policies.Manager

GetPolicyManager返回具有链ID的链的策略管理器。请注意 如果尚未创建链cid,则调用返回nil。

func GetServerConfig

func GetServerConfig() (comm.ServerConfig, error)

GetServerConfig返回对等服务器的GRPC服务器配置

func GetStableChannelConfig

func GetStableChannelConfig(cid string) channelconfig.Resources

getstablechannelconfig返回具有通道ID的链的稳定通道配置。 注意,如果尚未创建链cid,则此调用返回nil。

func InitChain

func InitChain(cid string)

initchain负责在对等连接后初始化链,例如部署系统ccs

func Initialize

func Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider,
	pm txvalidator.PluginMapper, pr *platforms.Registry, deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider,
	membershipProvider ledger.MembershipInfoProvider, metricsProvider metrics.Provider)

初始化设置对等机从持久性中拥有的任何链。这个 当分类帐和闲话发生时,应在启动时调用函数 准备好的

func MockCreateChain

func MockCreateChain(cid string) error

mockCreateChain用于为测试链创建分类帐 不必加入

func MockInitialize

func MockInitialize()

mockinitialize为测试env重置链

func MockSetMSPIDGetter

func MockSetMSPIDGetter(mspIDGetter func(string) []string)

func NewChannelPolicyManagerGetter

func NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter

NewChannelPolicyManagergetter返回ChannelPolicyManagergetter的新实例

func NewConfigSupport

func NewConfigSupport() cc.Manager

NewConfigSupport返回

func NewDeliverEventsServer

func NewDeliverEventsServer(mutualTLS bool, policyCheckerProvider PolicyCheckerProvider, chainManager deliver.ChainManager, metricsProvider metrics.Provider) peer.DeliverServer

NewDeliverEventsServer创建一个对等端。传递服务器以传递块和 筛选的块事件

func NewPeerServer

func NewPeerServer(listenAddress string, serverConfig comm.ServerConfig) (*comm.GRPCServer, error)

newpeerserver创建comm.grpcserver的实例 此服务器用于对等通信

func SetCurrConfigBlock

func SetCurrConfigBlock(block *common.Block, cid string) error

setcurrconfigblock设置指定通道的当前配置块

Types

type CollectionSupport

type CollectionSupport struct {
	ledger.PeerLedger
}

TODO:删除集合支持及其各自的方法数。 CollectionSupport是按链创建的,并传递给Simple collection store and the gossip. As it is created per chain, there 不需要为getQueryExecutorForLedger()传递channelID 和GetIdentityDeserializer()。注意,CID传递给 从未使用GetQueryExecutorForLedger。相反,我们可以直接 将ledger.peerledger和msp.identityDeserializer传递给 SimpleCollectionStore并仅将msp.IdentityDeserializer传递给 createchain()中的流言--fab-13037

func (*CollectionSupport) GetIdentityDeserializer

func (*CollectionSupport) GetIdentityDeserializer(chainID string) msp.IdentityDeserializer

func (*CollectionSupport) GetQueryExecutorForLedger

func (cs *CollectionSupport) GetQueryExecutorForLedger(cid string) (ledger.QueryExecutor, error)

type DeliverChainManager

type DeliverChainManager struct {
}

DeliverChainManager提供对执行传递的通道的访问

func (DeliverChainManager) GetChain

func (DeliverChainManager) GetChain(chainID string) deliver.Chain

type Operations

type Operations interface {
	CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error
	GetChannelConfig(cid string) channelconfig.Resources
	GetChannelsInfo() []*pb.ChannelInfo
	GetCurrConfigBlock(cid string) *common.Block
	GetLedger(cid string) ledger.PeerLedger
	GetMSPIDs(cid string) []string
	GetPolicyManager(cid string) policies.Manager
	InitChain(cid string)
	Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider, pm txvalidator.PluginMapper, pr *platforms.Registry, deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider, membershipProvider ledger.MembershipInfoProvider, metricsProvider metrics.Provider)
}

操作向运行的包级函数公开接口 单件包装上。这是迈向从包装开始的一步 对等实例级数据的级别数据。

var Default Operations = &peerImpl{
	createChainFromBlock: CreateChainFromBlock,
	getChannelConfig:     GetChannelConfig,
	getChannelsInfo:      GetChannelsInfo,
	getCurrConfigBlock:   GetCurrConfigBlock,
	getLedger:            GetLedger,
	getMSPIDs:            GetMSPIDs,
	getPolicyManager:     GetPolicyManager,
	initChain:            InitChain,
	initialize:           Initialize,
}

默认设置在对等接口的实现中提供 访问包级别状态。

type PolicyCheckerProvider

type PolicyCheckerProvider func(resourceName string) deliver.PolicyCheckerFunc

PolicyCheckerProvider为 给定资源名称

type Support

type Support interface {
	//GETAPPLICATIOFIGG返回通道的CONTXXAPPLATION.SARDCONFIGG
	//以及应用程序配置是否存在
	GetApplicationConfig(cid string) (channelconfig.Application, bool)
}

支持允许访问对等资源并避免调用静态方法

var DefaultSupport Support = &supportImpl{operations: Default}

type SupportFactory

type SupportFactory interface {
	//NewSupport返回支持接口
	NewSupport() Support
}

SupportFactory是支持接口的工厂

Jump to

Keyboard shortcuts

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