Documentation ¶
Overview ¶
Copyright IBM Corp. 2017 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func CacheConfiguration() (err error)
- func CreateChainFromBlock(cb *common.Block) error
- func CreatePeerServer(listenAddress string, serverConfig comm.ServerConfig) (comm.GRPCServer, 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 GetPeerServer() comm.GRPCServer
- func GetPolicyManager(cid string) policies.Manager
- func GetResourcesConfig(cid string) resourcesconfig.Resources
- func GetServerConfig() (comm.ServerConfig, error)
- func InitChain(cid string)
- func Initialize(init func(string))
- 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 RegisterSupportFactory(ccfact SupportFactory)
- func SetCurrConfigBlock(block *common.Block, cid string) error
- type DeliverSupportManager
- type PolicyCheckerProvider
- type Support
- type SupportFactory
- type SupportFactoryImpl
Constants ¶
This section is empty.
Variables ¶
var ConfigTxProcessors = customtx.Processors{ common.HeaderType_CONFIG: configTxProcessor, common.HeaderType_PEER_RESOURCE_UPDATE: configTxProcessor, }
Functions ¶
func CacheConfiguration ¶ added in v1.0.0
func CacheConfiguration() (err error)
CacheConfiguration 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.
func CreateChainFromBlock ¶ added in v1.0.0
CreateChainFromBlock creates a new chain from config block
func CreatePeerServer ¶ added in v1.0.0
func CreatePeerServer(listenAddress string, serverConfig comm.ServerConfig) (comm.GRPCServer, error)
CreatePeerServer creates an instance of comm.GRPCServer This server is used for peer communications
func GetChannelConfig ¶ added in v1.1.0
func GetChannelConfig(cid string) channelconfig.Resources
GetChannelConfig returns the channel configuration of the chain with channel ID. Note that this call returns nil if chain cid has not been created.
func GetChannelsInfo ¶ added in v1.0.0
func GetChannelsInfo() []*pb.ChannelInfo
GetChannelsInfo returns an array with information about all channels for this peer
func GetClientCertificate ¶
func GetClientCertificate() (tls.Certificate, error)
GetClientCertificate returns the TLS certificate to use for gRPC client connections
func GetCurrConfigBlock ¶ added in v1.0.0
GetCurrConfigBlock returns the cached config block of the specified chain. Note that this call returns nil if chain cid has not been created.
func GetLedger ¶ added in v1.0.0
func GetLedger(cid string) ledger.PeerLedger
GetLedger returns the ledger of the chain with chain ID. Note that this call returns nil if chain cid has not been created.
func GetLocalAddress ¶ added in v1.0.0
GetLocalAddress returns the peer.address property
func GetLocalIP ¶ added in v1.0.0
func GetLocalIP() string
GetLocalIP returns the non loopback local IP of the host
func GetMSPIDs ¶ added in v1.0.0
GetMSPIDs returns the ID of each application MSP defined on this chain
func GetPeerEndpoint ¶ added in v1.0.0
func GetPeerEndpoint() (*pb.PeerEndpoint, error)
GetPeerEndpoint returns peerEndpoint from cached configuration
func GetPeerServer ¶ added in v1.0.0
func GetPeerServer() comm.GRPCServer
GetPeerServer returns the peer server instance
func GetPolicyManager ¶ added in v1.0.0
GetPolicyManager returns the policy manager of the chain with chain ID. Note that this call returns nil if chain cid has not been created.
func GetResourcesConfig ¶ added in v1.1.0
func GetResourcesConfig(cid string) resourcesconfig.Resources
GetResourcesConfig returns the resources configuration of the chain with channel ID. Note that this call returns nil if chain cid has not been created.
func GetServerConfig ¶
func GetServerConfig() (comm.ServerConfig, error)
GetServerConfig returns the gRPC server configuration for the peer
func InitChain ¶ added in v1.0.0
func InitChain(cid string)
InitChain takes care to initialize chain after peer joined, for example deploys system CCs
func Initialize ¶ added in v1.0.0
func Initialize(init func(string))
Initialize 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
func MockCreateChain ¶ added in v1.0.0
MockCreateChain used for creating a ledger for a chain for tests without having to join
func MockInitialize ¶ added in v1.0.0
func MockInitialize()
MockInitialize resets chains for test env
func MockSetMSPIDGetter ¶ added in v1.0.0
func NewChannelPolicyManagerGetter ¶ added in v1.0.0
func NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter
NewChannelPolicyManagerGetter returns a new instance of ChannelPolicyManagerGetter
func NewDeliverEventsServer ¶ added in v1.1.0
func NewDeliverEventsServer(mutualTLS bool, policyCheckerProvider PolicyCheckerProvider, supportManager deliver.SupportManager) peer.DeliverServer
NewDeliverEventsServer creates a peer.Deliver server to deliver block and filtered block events
func RegisterSupportFactory ¶ added in v1.1.0
func RegisterSupportFactory(ccfact SupportFactory)
RegisterSupportFactory should be called to specify which factory should be used to serve GetSupport calls
Types ¶
type DeliverSupportManager ¶ added in v1.1.0
type DeliverSupportManager struct { }
DeliverSupportManager provides access to a channel for performing deliver
type PolicyCheckerProvider ¶
type PolicyCheckerProvider func(resourceName string) deliver.PolicyChecker
PolicyCheckerProvider given resource name provides corresponding poicy checker
type Support ¶ added in v1.1.0
type Support interface { // GetApplicationConfig returns the configtxapplication.SharedConfig for the channel // and whether the Application config exists GetApplicationConfig(cid string) (channelconfig.Application, bool) // ChaincodeByName returns the definition (and whether they exist) // for a chaincode in a specific channel ChaincodeByName(chainname, ccname string) (resourcesconfig.ChaincodeDefinition, bool) }
Support gives access to peer resources and avoids calls to static methods
func GetSupport ¶ added in v1.1.0
func GetSupport() Support
GetSupport returns a new Support instance by calling the factory
type SupportFactory ¶ added in v1.1.0
type SupportFactory interface { // NewSupport returns a Support interface NewSupport() Support }
SupportFactory is a factory of Support interfaces
type SupportFactoryImpl ¶ added in v1.1.0
type SupportFactoryImpl struct { }
func (*SupportFactoryImpl) NewSupport ¶ added in v1.1.0
func (c *SupportFactoryImpl) NewSupport() Support