Documentation ¶
Index ¶
- Constants
- Variables
- func AddOrdererFlags(cmd *cobra.Command)
- func CheckLogLevel(level string) error
- func GetAdminClient() (pb.AdminClient, error)
- func GetCertificate() (tls.Certificate, error)
- func GetDefaultSigner() (msp.SigningIdentity, error)
- func GetDeliverClient(address, tlsRootCertFile string) (pb.Deliver_DeliverClient, error)
- func GetEndorserClient(address, tlsRootCertFile string) (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 GetPeerDeliverClient(address, tlsRootCertFile string) (api.PeerDeliverClient, error)
- func InitCmd(cmd *cobra.Command, args []string)
- func InitConfig(cmdRoot string) error
- func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error
- func SetBCCSPKeystorePath()
- func SetOrdererEnv(cmd *cobra.Command, args []string)
- type BroadcastClient
- type CAConfig
- type CCType
- type ChannelNetworkConfig
- type ClientConfig
- type CredentialStoreType
- type DeliverClient
- type EnrollCredentials
- type LoggingType
- type MutualTLSConfig
- type NetworkConfig
- type OrdererClient
- type OrdererConfig
- type OrganizationConfig
- type PeerChannelConfig
- type PeerClient
- type PeerConfig
- type PeerDeliverClient
- type TLSConfig
- type TLSKeyPair
- type TLSType
Constants ¶
const CmdRoot = "core"
const UndefinedParamValue = ""
UndefinedParamValue定义命令行中未定义的参数将初始化为什么
Variables ¶
var ( //Get背书器Clientfnc是一个返回新背书器客户端连接的函数 //到使用tls根证书文件提供的对等地址, //默认情况下,它设置为Get背书客户端函数 GetEndorserClientFnc func(address, tlsRootCertFile string) (pb.EndorserClient, error) //GetPeerDeliverClientFnc是一个返回新的传递客户端连接的函数 //到使用tls根证书文件提供的对等地址, //默认设置为GetDeliverClient函数 GetPeerDeliverClientFnc func(address, tlsRootCertFile string) (api.PeerDeliverClient, error) //GetDeliverClientFnc是一个返回新的传递客户端连接的函数 //到使用tls根证书文件提供的对等地址, //默认设置为GetDeliverClient函数 GetDeliverClientFnc func(address, tlsRootCertFile string) (pb.Deliver_DeliverClient, error) //GetDefaultSignerFnc是一个返回默认签名者(default/perr)的函数。 //默认设置为GetDefaultSigner函数 GetDefaultSignerFnc func() (msp.SigningIdentity, error) //GetBroadcastClientFnc返回BroadcastClient接口的实例 //默认设置为getBroadcastClient函数 GetBroadcastClientFnc func() (BroadcastClient, error) //getorderendpointtochainfnc返回给定链的排序器端点 //默认情况下,它被设置为getorderendpointtochain函数 GetOrdererEndpointOfChainFnc func(chainID string, signer msp.SigningIdentity, endorserClient pb.EndorserClient) ([]string, error) //getCertificateFnc是返回客户端TLS证书的函数 GetCertificateFnc func() (tls.Certificate, error) )
var (
OrderingEndpoint string
)
Functions ¶
func GetAdminClient ¶
func GetAdminClient() (pb.AdminClient, error)
GetAdminClient返回新的管理客户端。的目标地址 客户端取自配置设置“peer.address”
func GetDefaultSigner ¶
func GetDefaultSigner() (msp.SigningIdentity, error)
getdefaultsigner为cli返回默认签名者(default/perr)
func GetDeliverClient ¶
func GetDeliverClient(address, tlsRootCertFile string) (pb.Deliver_DeliverClient, error)
GetDeliverClient返回新的传递客户端。如果地址和 未提供tlsrootcertfile,将获取客户端的目标值 从“peer.address”和的配置设置 “对等.tls.rootcert.file”
func GetEndorserClient ¶
func GetEndorserClient(address, tlsRootCertFile string) (pb.EndorserClient, error)
Get背书人客户端返回新的背书人客户端。如果地址和 未提供tlsrootcertfile,将获取客户端的目标值 从“peer.address”和的配置设置 “对等.tls.rootcert.file”
func GetMockAdminClient ¶
func GetMockAdminClient(err error) pb.AdminClient
func GetMockEndorserClient ¶
func GetMockEndorserClient(response *pb.ProposalResponse, err error) pb.EndorserClient
GetMock背书客户端返回背书客户端返回指定的ProposalResponse和Err(零或错误)
func GetOrdererEndpointOfChain ¶
func GetOrdererEndpointOfChain(chainID string, signer msp.SigningIdentity, endorserClient pb.EndorserClient) ([]string, error)
getorderEndpointToChain返回给定链的排序器终结点
func GetPeerDeliverClient ¶
func GetPeerDeliverClient(address, tlsRootCertFile string) (api.PeerDeliverClient, error)
GetPeerDeliverClient返回新的传递客户端。如果地址和 未提供tlsrootcertfile,将获取客户端的目标值 从“peer.address”和的配置设置 “对等.tls.rootcert.file”
func InitCrypto ¶
InitCrypto初始化此对等机的加密
func SetBCCSPKeystorePath ¶
func SetBCCSPKeystorePath()
setbccspkeystorepath为sw bccsp提供程序设置文件密钥库路径 相对于配置文件的绝对路径
func SetOrdererEnv ¶
setorderenv将特定于医嘱者的设置添加到全局viper环境中
Types ¶
type BroadcastClient ¶
func GetBroadcastClient ¶
func GetBroadcastClient() (BroadcastClient, error)
GetBroadcastClient创建BroadcastClient接口的简单实例
func GetMockBroadcastClient ¶
func GetMockBroadcastClient(err error) BroadcastClient
type CAConfig ¶
type CAConfig struct { URL string `yaml:"url"` HTTPOptions map[string]interface{} `yaml:"httpOptions"` TLSCACerts MutualTLSConfig `yaml:"tlsCACerts"` Registrar EnrollCredentials `yaml:"registrar"` CaName string `yaml:"caName"` }
caconfig定义CA配置 当前未被CLI使用
type ChannelNetworkConfig ¶
type ChannelNetworkConfig struct { //订购者订购服务节点列表 Orderers []string `yaml:"orderers"` //对等端此组织中的对等通道列表 //要获取真正的对等配置对象,请使用名称字段并获取networkconfig.peers[名称] Peers map[string]PeerChannelConfig `yaml:"peers"` //链码服务清单 Chaincodes []string `yaml:"chaincodes"` }
channelnetworkconfig提供网络的通道定义
type ClientConfig ¶
type ClientConfig struct { Organization string `yaml:"organization"` Logging LoggingType `yaml:"logging"` CryptoConfig CCType `yaml:"cryptoconfig"` TLS TLSType `yaml:"tls"` CredentialStore CredentialStoreType `yaml:"credentialStore"` }
clientconfig-当前未被cli使用
type CredentialStoreType ¶
type CredentialStoreType struct { Path string `yaml:"path"` CryptoStore struct { Path string `yaml:"path"` } Wallet string `yaml:"wallet"` }
CredentialStoreType-当前未由CLI使用
type DeliverClient ¶
type DeliverClient struct { Service api.DeliverService ChannelID string TLSCertHash []byte }
DeliverClient保存连接客户端所需的信息 到订购方/对等交付服务
func NewDeliverClientForOrderer ¶
func NewDeliverClientForOrderer(channelID string) (*DeliverClient, error)
newdeliverclientfororder从orderclient创建新的deliverclient
func NewDeliverClientForPeer ¶
func NewDeliverClientForPeer(channelID string) (*DeliverClient, error)
NewDeliverClientforPeer从对等客户端创建新的DeliverClient
func (*DeliverClient) GetNewestBlock ¶
func (d *DeliverClient) GetNewestBlock() (*cb.Block, error)
getnewestblock从对等方/订购方的传递服务获取最新的块
func (*DeliverClient) GetOldestBlock ¶
func (d *DeliverClient) GetOldestBlock() (*cb.Block, error)
GetOldestBlock从对等方/订购方的传递服务获取最旧的块
func (*DeliverClient) GetSpecifiedBlock ¶
func (d *DeliverClient) GetSpecifiedBlock(num uint64) (*cb.Block, error)
GetSpecifiedBlock从对等方/订购方的交货中获取指定的块 服务
type EnrollCredentials ¶
type EnrollCredentials struct { EnrollID string `yaml:"enrollId"` EnrollSecret string `yaml:"enrollSecret"` }
注册凭据保留用于注册的凭据 当前未被CLI使用
type MutualTLSConfig ¶
type MutualTLSConfig struct { Pem []string `yaml:"pem"` //certfiles用于TLS验证的根证书(逗号分隔的路径列表) Path string `yaml:"path"` //客户端TLS信息 Client TLSKeyPair `yaml:"client"` }
MutualTlsConfig相互TLS配置 当前未被CLI使用
type NetworkConfig ¶
type NetworkConfig struct { Name string `yaml:"name"` Xtype string `yaml:"x-type"` Description string `yaml:"description"` Version string `yaml:"version"` Channels map[string]ChannelNetworkConfig `yaml:"channels"` Organizations map[string]OrganizationConfig `yaml:"organizations"` Peers map[string]PeerConfig `yaml:"peers"` Client ClientConfig `yaml:"client"` Orderers map[string]OrdererConfig `yaml:"orderers"` CertificateAuthorities map[string]CAConfig `yaml:"certificateAuthorities"` }
networkconfig提供了超级账本结构网络的静态定义
func GetConfig ¶
func GetConfig(fileName string) (*NetworkConfig, error)
getconfig将提供的连接配置文件取消标记到网络中 配置结构
type OrdererClient ¶
type OrdererClient struct {
// contains filtered or unexported fields
}
OrdererClient表示用于与订单通信的客户端 服务
func NewOrdererClientFromEnv ¶
func NewOrdererClientFromEnv() (*OrdererClient, error)
NewOrdererClientfromenv从 全局毒蛇实例
func (*OrdererClient) Broadcast ¶
func (oc *OrdererClient) Broadcast() (ab.AtomicBroadcast_BroadcastClient, error)
广播返回原子广播服务的广播客户端
func (*OrdererClient) Certificate ¶
func (oc *OrdererClient) Certificate() tls.Certificate
证书返回TLS客户端证书(如果可用)
func (*OrdererClient) Deliver ¶
func (oc *OrdererClient) Deliver() (ab.AtomicBroadcast_DeliverClient, error)
Deliver返回AtomicBroadcast服务的Deliver客户端
type OrdererConfig ¶
type OrdererConfig struct { URL string `yaml:"url"` GrpcOptions map[string]interface{} `yaml:"grpcOptions"` TLSCACerts TLSConfig `yaml:"tlsCACerts"` }
orderconfig定义了一个order配置 当前未被CLI使用
type OrganizationConfig ¶
type OrganizationConfig struct { MspID string `yaml:"mspid"` Peers []string `yaml:"peers"` CryptoPath string `yaml:"cryptoPath"` CertificateAuthorities []string `yaml:"certificateAuthorities"` AdminPrivateKey TLSConfig `yaml:"adminPrivateKey"` SignedCert TLSConfig `yaml:"signedCert"` }
OrganizationConfig提供网络中组织的定义 当前未被CLI使用
type PeerChannelConfig ¶
type PeerChannelConfig struct { EndorsingPeer bool `yaml:"endorsingPeer"` ChaincodeQuery bool `yaml:"chaincodeQuery"` LedgerQuery bool `yaml:"ledgerQuery"` EventSource bool `yaml:"eventSource"` }
peerchannelconfig定义对等功能
type PeerClient ¶
type PeerClient struct {
// contains filtered or unexported fields
}
PeerClient表示与对等机通信的客户端
func NewPeerClientForAddress ¶
func NewPeerClientForAddress(address, tlsRootCertFile string) (*PeerClient, error)
newpeerclientforaddress使用 提供对等地址,如果启用了tls,则提供tls根证书文件
func NewPeerClientFromEnv ¶
func NewPeerClientFromEnv() (*PeerClient, error)
newpeerclientfromenv从全局创建peerclient的实例 蝰蛇实例
func (*PeerClient) Certificate ¶
func (pc *PeerClient) Certificate() tls.Certificate
证书返回TLS客户端证书(如果可用)
func (*PeerClient) Deliver ¶
func (pc *PeerClient) Deliver() (pb.Deliver_DeliverClient, error)
Deliver返回Deliver服务的客户端
func (*PeerClient) Endorser ¶
func (pc *PeerClient) Endorser() (pb.EndorserClient, error)
背书人返回背书人服务的客户
func (*PeerClient) PeerDeliver ¶
func (pc *PeerClient) PeerDeliver() (api.PeerDeliverClient, error)
PeerDeliver返回用于传递服务的客户端以供对等端特定使用 案例(即筛选的交付)
type PeerConfig ¶
type PeerConfig struct { URL string `yaml:"url"` EventURL string `yaml:"eventUrl"` GRPCOptions map[string]interface{} `yaml:"grpcOptions"` TLSCACerts TLSConfig `yaml:"tlsCACerts"` }
peerconfig定义对等配置
type PeerDeliverClient ¶
type PeerDeliverClient struct {
Client pb.DeliverClient
}
PeerDeliverClient保存连接客户端所需的信息 到对等交付服务
func (PeerDeliverClient) Deliver ¶
func (dc PeerDeliverClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (ccapi.Deliver, error)
传递将客户端连接到传递RPC
func (PeerDeliverClient) DeliverFiltered ¶
func (dc PeerDeliverClient) DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (ccapi.Deliver, error)
deliverfiltered将客户端连接到deliverfiltered rpc
type TLSConfig ¶
type TLSConfig struct { //以下两个字段可以互换。 //如果路径可用,则它将用于加载证书 //如果PEM可用,则它具有证书的原始数据,将按原样使用。 //证书根证书路径 Path string `yaml:"path"` //证书实际内容 Pem string `yaml:"pem"` }
tlsconfig tls配置
type TLSKeyPair ¶
tlskeypair包含用于tls加密的私钥和证书 当前未被CLI使用
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 伪造者生成的代码。
|
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 伪造者生成的代码。 |