Documentation ¶
Index ¶
- Variables
- func CacheConfiguration() (err error)
- func CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, ...) error
- func GetChannelConfig(cid string) channelconfig.Resources
- func GetChannelsInfo() []*pb.ChannelInfo
- func GetClientCertificate() (tls.Certificate, error)
- func GetCurrConfigBlock(cid string) *common.Block
- func GetLedger(cid string) ledger.PeerLedger
- func GetLocalAddress() (string, error)
- func GetLocalIP() string
- func GetMSPIDs(cid string) []string
- func GetPeerEndpoint() (*pb.PeerEndpoint, error)
- func GetPolicyManager(cid string) policies.Manager
- func GetServerConfig() (comm.ServerConfig, error)
- func GetStableChannelConfig(cid string) channelconfig.Resources
- func InitChain(cid string)
- func Initialize(init func(string), ccp ccprovider.ChaincodeProvider, ...)
- func MockCreateChain(cid string) error
- func MockInitialize()
- func MockSetMSPIDGetter(mspIDGetter func(string) []string)
- func NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter
- func NewConfigSupport() cc.Manager
- func NewDeliverEventsServer(mutualTLS bool, policyCheckerProvider PolicyCheckerProvider, ...) peer.DeliverServer
- func NewPeerServer(listenAddress string, serverConfig comm.ServerConfig) (*comm.GRPCServer, error)
- func SetCurrConfigBlock(block *common.Block, cid string) error
- type CollectionSupport
- type DeliverChainManager
- type Operations
- type PolicyCheckerProvider
- type Support
- type SupportFactory
Constants ¶
This section is empty.
Variables ¶
var ConfigTxProcessors = customtx.Processors{ common.HeaderType_CONFIG: configTxProcessor, common.HeaderType_TOKEN_TRANSACTION: tokenTxProcessor, }
var TransientStoreFactory = &storeProvider{stores: make(map[string]transientstore.Store)}
Functions ¶
func CacheConfiguration ¶
func CacheConfiguration() (err error)
cacheconfiguration计算并缓存常用常量和 计算常量作为包变量。以前的程序 这里嵌入了全局以保留原始抽象。
func CreateChainFromBlock ¶
func CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error
CreateChainFromBlock从配置块创建新链
func GetChannelConfig ¶
func GetChannelConfig(cid string) channelconfig.Resources
getchannelconfig返回具有通道ID的链的通道配置。请注意 如果尚未创建链cid,则调用返回nil。
func GetClientCertificate ¶
func GetClientCertificate() (tls.Certificate, error)
getclientCertificate返回要用于GRPC客户端的TLS证书 连接
func GetCurrConfigBlock ¶
getcurrconfigblock返回指定链的缓存配置块。 注意,如果尚未创建链cid,则此调用返回nil。
func GetLedger ¶
func GetLedger(cid string) ledger.PeerLedger
GetLedger返回具有链ID的链的分类帐。请注意 如果尚未创建链cid,则调用返回nil。
func GetPeerEndpoint ¶
func GetPeerEndpoint() (*pb.PeerEndpoint, error)
GetPeerEndpoint从缓存配置返回PeerEndpoint
func GetPolicyManager ¶
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 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 MockSetMSPIDGetter ¶
func NewChannelPolicyManagerGetter ¶
func NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter
NewChannelPolicyManagergetter返回ChannelPolicyManagergetter的新实例
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的实例 此服务器用于对等通信
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 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) }
支持允许访问对等资源并避免调用静态方法
type SupportFactory ¶
type SupportFactory interface { //NewSupport返回支持接口 NewSupport() Support }
SupportFactory是支持接口的工厂