peer

package
v0.0.0-...-94b13b5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheConfiguration

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

func CreateChainFromBlock(cb *common.Block) error

CreateChainFromBlock creates a new chain from config block

func CreatePeerServer

func CreatePeerServer(listenAddress string,
	secureConfig comm.SecureServerConfig) (comm.GRPCServer, error)

CreatePeerServer creates an instance of comm.GRPCServer This server is used for peer communications

func GetChannelsInfo

func GetChannelsInfo() []*pb.ChannelInfo

GetChannelsInfo returns an array with information about all channels for this peer

func GetCurrConfigBlock

func GetCurrConfigBlock(cid string) *common.Block

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

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

func GetLocalAddress() (string, error)

GetLocalAddress returns the peer.address property

func GetLocalIP

func GetLocalIP() string

GetLocalIP returns the non loopback local IP of the host

func GetMSPIDs

func GetMSPIDs(cid string) []string

GetMSPIDs returns the ID of each application MSP defined on this chain

func GetPeerEndpoint

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

GetPeerEndpoint returns peerEndpoint from cached configuration

func GetPeerServer

func GetPeerServer() comm.GRPCServer

GetPeerServer returns the peer server instance

func GetPolicyManager

func GetPolicyManager(cid string) policies.Manager

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 GetSecureConfig

func GetSecureConfig() (comm.SecureServerConfig, error)

GetSecureConfig returns the secure server configuration for the peer

func InitChain

func InitChain(cid string)

Take care to initialize chain after peer joined, for example deploys system CCs

func Initialize

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

func MockCreateChain(cid string) error

MockCreateChain used for creating a ledger for a chain for tests without havin to join

func MockInitialize

func MockInitialize()

MockInitialize resets chains for test env

func MockSetMSPIDGetter

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

func NewChannelPolicyManagerGetter

func NewChannelPolicyManagerGetter() policies.ChannelPolicyManagerGetter

NewChannelPolicyManagerGetter returns a new instance of ChannelPolicyManagerGetter

func NewPeerClientConnection

func NewPeerClientConnection() (*grpc.ClientConn, error)

NewPeerClientConnection Returns a new grpc.ClientConn to the configured local PEER.

func NewPeerClientConnectionWithAddress

func NewPeerClientConnectionWithAddress(peerAddress string) (*grpc.ClientConn, error)

NewPeerClientConnectionWithAddress Returns a new grpc.ClientConn to the configured local PEER.

func SetCurrConfigBlock

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

SetCurrConfigBlock sets the current config block of the specified chain

Types

This section is empty.

Jump to

Keyboard shortcuts

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