Documentation ¶
Overview ¶
Copyright IBM Corp. 2016-2017 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. 2016-2017 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. 2016-2017 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func AddOrdererFlags(cmd *cobra.Command)
- func CheckLogLevel(level string) error
- func GetAdminClient() (pb.AdminClient, error)
- func GetDefaultSigner() (msp.SigningIdentity, error)
- func GetEndorserClient() (pb.EndorserClient, error)
- func GetMockAdminClient(err error) pb.AdminClient
- func GetMockEndorserClient(response *pb.ProposalResponse, err error) pb.EndorserClient
- func GetOrdererEndpointOfChain(chainID string, signer msp.SigningIdentity, endorserClient pb.EndorserClient) ([]string, error)
- func InitConfig(cmdRoot string) error
- func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error
- func SetBCCSPKeystorePath()
- func SetLogLevelFromViper(module string) error
- func SetOrdererEnv(cmd *cobra.Command, args []string)
- type BroadcastClient
- type OrdererClient
- type PeerClient
Constants ¶
const UndefinedParamValue = ""
UndefinedParamValue defines what undefined parameters in the command line will initialise to
Variables ¶
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() (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) )
var (
OrderingEndpoint string
)
Functions ¶
func AddOrdererFlags ¶ added in v1.1.0
AddOrdererFlags adds flags for orderer-related commands
func CheckLogLevel ¶
CheckLogLevel checks that a given log level string is valid
func GetAdminClient ¶
func GetAdminClient() (pb.AdminClient, error)
GetAdminClient returns a new admin client. The target address for the client is taken from the configuration setting "peer.address"
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. The target address for the client is taken from the configuration setting "peer.address"
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 InitCrypto ¶
InitCrypto initializes crypto for this peer
func SetBCCSPKeystorePath ¶ added in v1.1.0
func SetBCCSPKeystorePath()
SetBCCSPKeystorePath sets the file keystore path for the SW BCCSP provider to an absolute path relative to the config file
func SetLogLevelFromViper ¶
SetLogLevelFromViper sets the log level for 'module' logger to the value in core.yaml
func SetOrdererEnv ¶ added in v1.1.0
SetOrdererEnv adds orderer-specific settings to the global Viper environment
Types ¶
type BroadcastClient ¶
type BroadcastClient interface { //Send data to orderer Send(env *cb.Envelope) error Close() error }
func GetBroadcastClient ¶
func GetBroadcastClient() (BroadcastClient, error)
GetBroadcastClient creates a simple instance of the BroadcastClient interface
func GetMockBroadcastClient ¶
func GetMockBroadcastClient(err error) BroadcastClient
type OrdererClient ¶ added in v1.1.0
type OrdererClient struct {
// contains filtered or unexported fields
}
OrdererClient represents a client for communicating with an ordering service
func NewOrdererClientFromEnv ¶ added in v1.1.0
func NewOrdererClientFromEnv() (*OrdererClient, error)
NewOrdererClientFromEnv creates an instance of an OrdererClient from the global Viper instance
func (*OrdererClient) Broadcast ¶ added in v1.1.0
func (oc *OrdererClient) Broadcast() (ab.AtomicBroadcast_BroadcastClient, error)
Broadcast returns a broadcast client for the AtomicBroadcast service
func (*OrdererClient) Certificate ¶ added in v1.1.0
func (oc *OrdererClient) Certificate() tls.Certificate
Certificate returns the TLS client certificate (if available)
func (*OrdererClient) Deliver ¶ added in v1.1.0
func (oc *OrdererClient) Deliver() (ab.AtomicBroadcast_DeliverClient, error)
Deliver returns a deliver client for the AtomicBroadcast service
type PeerClient ¶ added in v1.1.0
type PeerClient struct {
// contains filtered or unexported fields
}
PeerClient represents a client for communicating with a peer
func NewPeerClientFromEnv ¶ added in v1.1.0
func NewPeerClientFromEnv() (*PeerClient, error)
NewPeerClientFromEnv creates an instance of a PeerClient from the global Viper instance
func (*PeerClient) Admin ¶ added in v1.1.0
func (pc *PeerClient) Admin() (pb.AdminClient, error)
Admin returns a client for the Admin service
func (*PeerClient) Endorser ¶ added in v1.1.0
func (pc *PeerClient) Endorser() (pb.EndorserClient, error)
Endorser returns a client for the Endorser service