common

package
v0.0.0-...-40f2d1d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const UndefinedParamValue = ""

UndefinedParamValue defines what undefined parameters in the command line will initialise to

Variables

View Source
var (

	// GetEndorserClientFnc is a function that returns a new endorser client connection,
	// by default it is set to GetEndorserClient function
	GetEndorserClientFnc func() (pb.EndorserClient, error)

	// GetDefaultSignerFnc is a function that returns a default Signer(Default/PERR)
	// by default it is set to GetDefaultSigner function
	GetDefaultSignerFnc func() (msp.SigningIdentity, error)

	// GetBroadcastClientFnc returns an instance of the BroadcastClient interface
	// by default it is set to GetBroadcastClient function
	GetBroadcastClientFnc func(orderingEndpoint string, tlsEnabled bool,
		caFile string) (BroadcastClient, error)

	// GetOrdererEndpointOfChainFnc returns orderer endpoints of given chain
	// by default it is set to GetOrdererEndpointOfChain function
	GetOrdererEndpointOfChainFnc func(chainID string, signer msp.SigningIdentity,
		endorserClient pb.EndorserClient) ([]string, error)
)

Functions

func CheckLogLevel

func CheckLogLevel(level string) error

CheckLogLevel checks that a given log level string is valid

func GetAdminClient

func GetAdminClient() (pb.AdminClient, error)

GetAdminClient returns a new admin client connection for this peer

func GetDefaultSigner

func GetDefaultSigner() (msp.SigningIdentity, error)

GetDefaultSigner return a default Signer(Default/PERR) for cli

func GetEndorserClient

func GetEndorserClient() (pb.EndorserClient, error)

GetEndorserClient returns a new endorser client connection for this peer

func GetMockAdminClient

func GetMockAdminClient(err error) pb.AdminClient

func GetMockEndorserClient

func GetMockEndorserClient(response *pb.ProposalResponse, err error) pb.EndorserClient

GetMockEndorserClient return a endorser client return specified ProposalResponse and err(nil or error)

func GetOrdererEndpointOfChain

func GetOrdererEndpointOfChain(chainID string, signer msp.SigningIdentity, endorserClient pb.EndorserClient) ([]string, error)

GetOrdererEndpointOfChain returns orderer endpoints of given chain

func InitConfig

func InitConfig(cmdRoot string) error

InitConfig initializes viper config

func InitCrypto

func InitCrypto(mspMgrConfigDir string, localMSPID string) error

InitCrypto initializes crypto for this peer

func SetLogLevelFromViper

func SetLogLevelFromViper(module string) error

SetLogLevelFromViper sets the log level for 'module' logger to the value in core.yaml

Types

type BroadcastClient

type BroadcastClient interface {
	//Send data to orderer
	Send(env *cb.Envelope) error
	Close() error
}

func GetBroadcastClient

func GetBroadcastClient(orderingEndpoint string, tlsEnabled bool, caFile string) (BroadcastClient, error)

GetBroadcastClient creates a simple instance of the BroadcastClient interface

func GetMockBroadcastClient

func GetMockBroadcastClient(err error) BroadcastClient

Jump to

Keyboard shortcuts

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