...

Package comm

import "github.com/hyperledger/fabric/cmd/common/comm"
Overview
Index

Overview ▾

type Client

Client deals with TLS connections to the discovery server

type Client struct {
    TLSCertHash []byte
    *comm.GRPCClient
}

func NewClient

func NewClient(conf Config) (*Client, error)

NewClient creates a new comm client out of the given configuration

func (*Client) NewDialer

func (c *Client) NewDialer(endpoint string) func() (*grpc.ClientConn, error)

NewDialer creates a new dialer from the given endpoint

type Config

Config defines configuration of a Client

type Config struct {
    CertPath       string
    KeyPath        string
    PeerCACertPath string
    Timeout        time.Duration
}

func (Config) ToSecureOptions

func (conf Config) ToSecureOptions(newSelfSignedTLSCert genTLSCertFunc) (*comm.SecureOptions, error)

ToSecureOptions converts this Config to SecureOptions. The given function generates a self signed client TLS certificate if the TLS certificate and key aren't present at the config