{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package peer\n\n## Variables\n\n```go\nvar ConfigTxProcessors = customtx.Processors{\n\tcommon.HeaderType_CONFIG:            configTxProcessor,\n\tcommon.HeaderType_TOKEN_TRANSACTION: tokenTxProcessor,\n}\n```\n\n```go\nvar TransientStoreFactory = \u0026storeProvider{stores: make(map[string]transientstore.Store)}\n```\n\n## Functions\n\n```go\nfunc CacheConfiguration() (err error)\n```\nCacheConfiguration computes and caches commonly-used constants and computed constants as package variables. Routines which were previously global have been embedded here to preserve the original abstraction.\n\n```go\nfunc CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error\n```\nCreateChainFromBlock creates a new chain from config block\n\n```go\nfunc GetChannelConfig(cid string) channelconfig.Resources\n```\nGetChannelConfig returns the channel configuration of the chain with channel ID. Note that this call returns nil if chain cid has not been created.\n\n```go\nfunc GetChannelsInfo() []*pb.ChannelInfo\n```\nGetChannelsInfo returns an array with information about all channels for this peer\n\n```go\nfunc GetClientCertificate() (tls.Certificate, error)\n```\nGetClientCertificate returns the TLS certificate to use for gRPC client connections\n\n```go\nfunc GetCurrConfigBlock(cid string) *common.Block\n```\nGetCurrConfigBlock returns the cached config block of the specified chain. Note that this call returns nil if chain cid has not been created.\n\n```go\nfunc GetLedger(cid string) ledger.PeerLedger\n```\nGetLedger returns the ledger of the chain with chain ID. Note that this call returns nil if chain cid has not been created.\n\n```go\nfunc GetLocalAddress() (string, error)\n```\nGetLocalAddress returns the peer.address property\n\n```go\nfunc GetLocalIP() string\n```\nGetLocalIP returns the non loopback local IP of the host\n\n```go\nfunc GetMSPIDs(cid string) []string\n```\nGetMSPIDs returns the ID of each application MSP defined on this chain\n\n```go\nfunc GetOrdererAddressOverrides() (map[string]*comm.OrdererEndpoint, error)\n```\n\n```go\nfunc GetPeerEndpoint() (*pb.PeerEndpoint, error)\n```\nGetPeerEndpoint returns peerEndpoint from cached configuration\n\n```go\nfunc GetPolicyManager(cid string) policies.Manager\n```\nGetPolicyManager returns the policy manager of the chain with chain ID. Note that this call returns nil if chain cid has not been created.\n\n```go\nfunc GetServerConfig() (comm.ServerConfig, error)\n```\nGetServerConfig returns the gRPC server configuration for the peer\n\n```go\nfunc GetServerRootCAs() ([][]byte, error)\n```\nGetServerRootCAs returns the root certificates which will be trusted for gRPC client connections to peers and orderers.\n\n```go\nfunc GetStableChannelConfig(cid string) channelconfig.Resources\n```\nGetStableChannelConfig returns the stable channel configuration of the chain with channel ID. Note that this call returns nil if chain cid has not been created.\n\n```go\nfunc InitChain(cid string)\n```\nInitChain takes care to initialize chain after peer joined, for example deploys system CCs\n\n```go\nfunc Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider,\n\tpm txvalidator.PluginMapper, pr *platforms.Registry, deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider,\n\tmembershipProvider ledger.MembershipInfoProvider, metricsProvider metrics.Provider)\n```\nInitialize sets up any chains that the peer has from the persistence. This function should be called at the start up when the ledger and gossip ready\n\n```go\nfunc MockCreateChain(cid string) error\n```\nMockCreateChain used for creating a ledger for a chain for tests without having to join\n\n```go\nfunc MockInitialize()\n```\nMockInitialize resets chains for test env\n\n```go\nfunc MockSetMSPIDGetter(mspIDGetter func(string) []string)\n```\n\n```go\nfunc NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter\n```\nNewChannelPolicyManagerGetter returns a new instance of ChannelPolicyManagerGetter\n\n```go\nfunc NewConfigSupport() cc.Manager\n```\nNewConfigSupport returns\n\n```go\nfunc NewDeliverEventsServer(mutualTLS bool, policyCheckerProvider PolicyCheckerProvider, chainManager deliver.ChainManager, metricsProvider metrics.Provider) peer.DeliverServer\n```\nNewDeliverEventsServer creates a peer.Deliver server to deliver block and filtered block events\n\n```go\nfunc NewPeerServer(listenAddress string, serverConfig comm.ServerConfig) (*comm.GRPCServer, error)\n```\nNewPeerServer creates an instance of comm.GRPCServer This server is used for peer communications\n\n```go\nfunc SetCurrConfigBlock(block *common.Block, cid string) error\n```\nSetCurrConfigBlock sets the current config block of the specified channel\n\n## Types\n\n```go\ntype CollectionSupport struct {\n\tledger.PeerLedger\n}\n```\nTODO: Remove CollectionSupport and respective methonds on them. CollectionSupport is created per chain and is passed to the simple collection store and the gossip. As it is created per chain, there is no need to pass the channelID for both GetQueryExecutorForLedger() and GetIdentityDeserializer(). Note that the cid passed to GetQueryExecutorForLedger is never used. Instead, we can directly pass the ledger.PeerLedger and msp.IdentityDeserializer to the simpleCollectionStore and pass only the msp.IdentityDeserializer to the gossip in createChain() -- FAB-13037\n\n```go\nfunc (*CollectionSupport) GetIdentityDeserializer(chainID string) msp.IdentityDeserializer\n```\n\n```go\nfunc (cs *CollectionSupport) GetQueryExecutorForLedger(cid string) (ledger.QueryExecutor, error)\n```\n\n```go\ntype DeliverChainManager struct {\n}\n```\nDeliverChainManager provides access to a channel for performing deliver\n\n```go\nfunc (DeliverChainManager) GetChain(chainID string) deliver.Chain\n```\n\n```go\ntype Operations interface {\n\tCreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error\n\tGetChannelConfig(cid string) channelconfig.Resources\n\tGetChannelsInfo() []*pb.ChannelInfo\n\tGetCurrConfigBlock(cid string) *common.Block\n\tGetLedger(cid string) ledger.PeerLedger\n\tGetMSPIDs(cid string) []string\n\tGetPolicyManager(cid string) policies.Manager\n\tInitChain(cid string)\n\tInitialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider, pm txvalidator.PluginMapper, pr *platforms.Registry, deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider, membershipProvider ledger.MembershipInfoProvider, metricsProvider metrics.Provider)\n}\n```\nOperations exposes an interface to the package level functions that operated on singletons in the package. This is a step towards moving from package level data for the peer to instance level data.\n\n```go\nvar Default Operations = \u0026peerImpl{\n\tcreateChainFromBlock: CreateChainFromBlock,\n\tgetChannelConfig:     GetChannelConfig,\n\tgetChannelsInfo:      GetChannelsInfo,\n\tgetCurrConfigBlock:   GetCurrConfigBlock,\n\tgetLedger:            GetLedger,\n\tgetMSPIDs:            GetMSPIDs,\n\tgetPolicyManager:     GetPolicyManager,\n\tinitChain:            InitChain,\n\tinitialize:           Initialize,\n}\n```\nDefault provides in implementation of the Peer interface that provides access to the package level state.\n\n```go\ntype OrdererEndpoint struct {\n\tAddress string\n\tPEMs    []byte\n}\n```\n\n```go\ntype OrdererOrg interface {\n\tchannelconfig.Org\n\n\t// Endpoints returns the endpoints of orderer nodes.\n\tEndpoints() []string\n}\n```\nOrdererOrg stores the per org orderer config.\n\n```go\ntype PolicyCheckerProvider func(resourceName string) deliver.PolicyCheckerFunc\n```\nPolicyCheckerProvider provides the corresponding policy checker for a given resource name\n\n```go\ntype Support interface {\n\t// GetApplicationConfig returns the configtxapplication.SharedConfig for the channel\n\t// and whether the Application config exists\n\tGetApplicationConfig(cid string) (channelconfig.Application, bool)\n}\n```\nSupport gives access to peer resources and avoids calls to static methods\n\n```go\nvar DefaultSupport Support = \u0026supportImpl{operations: Default}\n```\n\n```go\ntype SupportFactory interface {\n\t// NewSupport returns a Support interface\n\tNewSupport() Support\n}\n```\nSupportFactory is a factory of Support interfaces\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/peer","name":"peer","synopsis":"","isRedistributable":true}
