Documentation ¶
Index ¶
- Constants
- type Cert
- type CertificateAuthority
- type CertificateAuthorityRegistrar
- type CertificateAuthorityTLSCACerts
- type CertificateAuthorityTLSCACertsClient
- type CertificateAuthorityTLSCACertsClientCert
- type CertificateAuthorityTLSCACertsClientKey
- type Channel
- type ChannelPeer
- type Client
- type ClientBCCSP
- type ClientBCCSPSecurity
- type ClientBCCSPSecurityDefault
- type ClientCredentialStore
- type ClientCredentialStoreCryptoStore
- type ClientCryptoConfig
- type ClientEventService
- type ClientEventServiceTimeout
- type ClientGlobal
- type ClientGlobalCache
- type ClientGlobalTimeout
- type ClientLogging
- type ClientOrder
- type ClientOrderTimeout
- type ClientPeer
- type ClientPeerTimeout
- type ClientPeerTimeoutDiscovery
- type ClientTLSCerts
- type ClientTLSCertsClient
- type ClientTLSCertsClientCert
- type ClientTLSCertsClientKey
- type Config
- func (c *Config) AddOrSetCertificateAuthority(...)
- func (c *Config) AddOrSetDiscoveryPolicyForChannel(channelName, initialBackOff, maxBackOff string, maxTargets, attempts int32, ...)
- func (c *Config) AddOrSetEventServicePolicyForChannel(channelName, resolverStrategy, balancer, peerMonitorPeriod string, ...)
- func (c *Config) AddOrSetOrderer(...)
- func (c *Config) AddOrSetOrdererForOrganizations(orderName, mspID, cryptoPath string, users map[string]string)
- func (c *Config) AddOrSetOrgForOrganizations(orgName, mspid, cryptoPath string, users map[string]string, ...)
- func (c *Config) AddOrSetPeer(peerName, url, eventUrl, sslTargetNameOverride, keepAliveTime, ... string, ...)
- func (c *Config) AddOrSetPeerForChannel(channelName, peerName string, ...)
- func (c *Config) AddOrSetQueryChannelPolicyForChannel(channelName, initialBackOff, maxBackOff string, ...)
- func (c *Config) AddOrSetSelfCertificateAuthority(leagueName, certName, url, caName, enrollId, enrollSecret string)
- func (c *Config) AddOrSetSelfOrderer(leagueName, ordererName, url, keepAliveTime, keepAliveTimeout string, ...)
- func (c *Config) AddOrSetSelfOrdererForOrganizations(leagueName string)
- func (c *Config) AddOrSetSelfOrgForOrganizations(leagueName string, peers, certificateAuthorities []string)
- func (c *Config) AddOrSetSelfPeer(leagueName, peerName, url, eventUrl, keepAliveTime, keepAliveTimeout string, ...)
- func (c *Config) GetPBConfig() *pb.Config
- func (c *Config) InitClient(tls bool, orgName, level, cryptoConfig, keyPath, certPath string)
- func (c *Config) InitCustomClient(tls bool, orgName, level, cryptoConfig, keyPath, certPath string, ...)
- func (c *Config) InitSelfClient(tls bool, leagueName, orgName, userName, level string)
- type Orderer
- type OrdererGRPCOptions
- type OrdererTLSCACerts
- type Organization
- type Peer
- type PeerGRPCOptions
- type PeerTLSCACerts
- type Policy
- type PolicyCommonRetryOpts
- type PolicyDiscovery
- type PolicyEventService
- type PolicyQueryChannelConfig
- type User
Constants ¶
View Source
const (
OrderOrgKey = "OrdererOrg"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateAuthority ¶
type CertificateAuthority struct { URL string `yaml:"url"` CAName string `yaml:"caName"` TLSCACerts *CertificateAuthorityTLSCACerts `yaml:"tlsCACerts"` Registrar *CertificateAuthorityRegistrar `yaml:"registrar"` }
type CertificateAuthorityTLSCACerts ¶
type CertificateAuthorityTLSCACerts struct { Path string `yaml:"path"` Client *CertificateAuthorityTLSCACertsClient `yaml:"client"` }
type CertificateAuthorityTLSCACertsClient ¶
type CertificateAuthorityTLSCACertsClient struct { Key *CertificateAuthorityTLSCACertsClientKey `yaml:"key"` Cert *CertificateAuthorityTLSCACertsClientCert `yaml:"cert"` }
type CertificateAuthorityTLSCACertsClientCert ¶
type CertificateAuthorityTLSCACertsClientCert struct {
Path string `yaml:"path"` // /fabric/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/client.crt
}
type CertificateAuthorityTLSCACertsClientKey ¶
type CertificateAuthorityTLSCACertsClientKey struct {
Path string `yaml:"path"` // /fabric/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/client.key
}
type Channel ¶
type Channel struct { Peers map[string]*ChannelPeer `yaml:"peers"` Policies *Policy `yaml:"policies"` }
type ChannelPeer ¶
type Client ¶
type Client struct { // Organization 这个应用程序实例属于哪个组织?值必须是在“组织”下定义的组织的名称,如:Org1或league-org1 Organization string `yaml:"organization"` // Logging 日志级别,debug、info、warn、error等 Logging *ClientLogging `yaml:"logging"` // 节点超时的全局配置,如果省略此部分,则将使用缺省值 Peer *ClientPeer `yaml:"peer"` // 事件服务超时的全局配置,如果省略此部分,则将使用缺省值 EventService *ClientEventService `yaml:"eventService"` // orderer超时的全局配置,如果省略此部分,则将使用缺省值 Order *ClientOrder `yaml:"orderer"` // 超时的全局配置,如果省略此部分,则将使用缺省值 Global *ClientGlobal `yaml:"global"` CryptoConfig *ClientCryptoConfig `yaml:"cryptoconfig"` CredentialStore *ClientCredentialStore `yaml:"credentialStore"` // BCCSP 客户端的BCCSP配置 BCCSP *ClientBCCSP `yaml:"BCCSP"` TLSCerts *ClientTLSCerts `yaml:"tlsCerts"` }
Client go sdk 使用的客户端
type ClientBCCSP ¶
type ClientBCCSP struct {
Security *ClientBCCSPSecurity `yaml:"security"`
}
type ClientBCCSPSecurity ¶
type ClientBCCSPSecurity struct { Enabled bool `yaml:"enabled"` Default *ClientBCCSPSecurityDefault `yaml:"default"` HashAlgorithm string `yaml:"hashAlgorithm"` SoftVerify bool `yaml:"softVerify"` Level int32 `yaml:"level"` }
type ClientBCCSPSecurityDefault ¶
type ClientBCCSPSecurityDefault struct {
Provider string `yaml:"provider"`
}
type ClientCredentialStore ¶
type ClientCredentialStore struct { Path string `yaml:"path"` // /tmp/state-store" CryptoStore *ClientCredentialStoreCryptoStore `yaml:"cryptoStore"` }
type ClientCredentialStoreCryptoStore ¶
type ClientCredentialStoreCryptoStore struct {
Path string `yaml:"path"` // /tmp/msp
}
type ClientCryptoConfig ¶
type ClientCryptoConfig struct { // Path 带有密钥和证书的MSP目录的根目录 Path string `yaml:"path"` // /Users/Documents/fabric/crypto-config }
ClientCryptoConfig 客户端
type ClientEventService ¶
type ClientEventService struct {
Timeout *ClientEventServiceTimeout `yaml:"timeout"`
}
type ClientEventServiceTimeout ¶
type ClientEventServiceTimeout struct {
RegistrationResponse string `yaml:"registrationResponse"`
}
type ClientGlobal ¶
type ClientGlobal struct { Timeout *ClientGlobalTimeout `yaml:"timeout"` Cache *ClientGlobalCache `yaml:"cache"` }
type ClientGlobalCache ¶
type ClientGlobalTimeout ¶
type ClientLogging ¶
type ClientLogging struct {
Level string `yaml:"level"` // info
}
ClientLogging 客户端日志设置对象
type ClientOrder ¶
type ClientOrder struct {
Timeout *ClientOrderTimeout `yaml:"timeout"`
}
type ClientOrderTimeout ¶
type ClientPeer ¶
type ClientPeer struct {
Timeout *ClientPeerTimeout `yaml:"timeout"`
}
type ClientPeerTimeout ¶
type ClientPeerTimeout struct { Connection string `yaml:"connection"` Response string `yaml:"response"` Discovery *ClientPeerTimeoutDiscovery `yaml:"discovery"` }
type ClientPeerTimeoutDiscovery ¶
type ClientPeerTimeoutDiscovery struct { // GreyListExpiry 发现服务失效列表筛选器的有效期。 // // 通道客户端将列出脱机的失效节点名单,防止在后续重试中重新选择它们。 // // 这个间隔将定义一个节点被灰列出的时间 GreyListExpiry string `yaml:"greylistExpiry"` }
type ClientTLSCerts ¶
type ClientTLSCerts struct { // SystemCertPool 是否开启TLS,默认false SystemCertPool bool `yaml:"systemCertPool"` // Client 客户端密钥和证书,用于TLS与节点和排序服务的握手 Client *ClientTLSCertsClient `yaml:"client"` }
type ClientTLSCertsClient ¶
type ClientTLSCertsClient struct { Key *ClientTLSCertsClientKey `yaml:"key"` Cert *ClientTLSCertsClientCert `yaml:"cert"` }
type ClientTLSCertsClientCert ¶
type ClientTLSCertsClientCert struct {
Path string `yaml:"path"` // /fabric/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/client.crt
}
type ClientTLSCertsClientKey ¶
type ClientTLSCertsClientKey struct {
Path string `yaml:"path"` // /fabric/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/client.key
}
type Config ¶
type Config struct { Version string `yaml:"version"` Client *Client `yaml:"client"` Channels map[string]*Channel `yaml:"channels"` Organizations map[string]*Organization `yaml:"organizations"` Orderers map[string]*Orderer `yaml:"orderers"` Peers map[string]*Peer `yaml:"peers"` CertificateAuthorities map[string]*CertificateAuthority `yaml:"certificateAuthorities"` }
func (*Config) AddOrSetCertificateAuthority ¶
func (*Config) AddOrSetDiscoveryPolicyForChannel ¶
func (*Config) AddOrSetEventServicePolicyForChannel ¶
func (*Config) AddOrSetOrderer ¶
func (*Config) AddOrSetOrdererForOrganizations ¶
func (*Config) AddOrSetOrgForOrganizations ¶
func (*Config) AddOrSetPeer ¶
func (*Config) AddOrSetPeerForChannel ¶
func (*Config) AddOrSetQueryChannelPolicyForChannel ¶
func (*Config) AddOrSetSelfCertificateAuthority ¶
func (c *Config) AddOrSetSelfCertificateAuthority(leagueName, certName, url, caName, enrollId, enrollSecret string)
AddOrSetSelfCertificateAuthority
func (*Config) AddOrSetSelfOrderer ¶
func (c *Config) AddOrSetSelfOrderer(leagueName, ordererName, url, keepAliveTime, keepAliveTimeout string, keepAlivePermit, failFast, allowInsecure bool)
AddOrSetSelfOrderer
ordererName order0
url grpc://10.10.203.51:30054
func (*Config) AddOrSetSelfOrdererForOrganizations ¶
func (*Config) AddOrSetSelfOrgForOrganizations ¶
func (c *Config) AddOrSetSelfOrgForOrganizations(leagueName string, peers, certificateAuthorities []string)
AddOrSetSelfOrgForOrganizations
peers peer0 peer1
func (*Config) AddOrSetSelfPeer ¶
func (c *Config) AddOrSetSelfPeer(leagueName, peerName, url, eventUrl, keepAliveTime, keepAliveTimeout string, keepAlivePermit, failFast, allowInsecure bool)
AddOrSetSelfPeer
peerName peer0
Url: "grpc://10.10.203.51:30056",
EventUrl: "grpc://10.10.203.51:30058",
func (*Config) GetPBConfig ¶
func (*Config) InitClient ¶
func (*Config) InitCustomClient ¶
func (c *Config) InitCustomClient(tls bool, orgName, level, cryptoConfig, keyPath, certPath string, peer *ClientPeer, eventService *ClientEventService, order *ClientOrder, global *ClientGlobal, ccs *ClientCredentialStore, bccsp *ClientBCCSP)
func (*Config) InitSelfClient ¶
type Orderer ¶
type Orderer struct { URL string `yaml:"url"` GRPCOptions *OrdererGRPCOptions `yaml:"grpcOptions"` TLSCACerts *OrdererTLSCACerts `yaml:"tlsCACerts"` }
type OrdererGRPCOptions ¶
type OrdererGRPCOptions struct { SSLTargetNameOverride string `yaml:"ssl-target-name-override"` KeepAliveTime string `yaml:"keep-alive-time"` KeepAliveTimeout string `yaml:"keep-alive-timeout"` KeepAlivePermit bool `yaml:"keep-alive-permit"` FailFast bool `yaml:"fail-fast"` AllowInsecure bool `yaml:"allow-insecure"` }
type OrdererTLSCACerts ¶
type OrdererTLSCACerts struct {
Path string `yaml:"path"` // /fabric/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
}
type Organization ¶
type Peer ¶
type Peer struct { URL string `yaml:"url"` EventURL string `yaml:"eventUrl"` GRPCOptions *PeerGRPCOptions `yaml:"grpcOptions"` TLSCACerts *PeerTLSCACerts `yaml:"tlsCACerts"` }
type PeerGRPCOptions ¶
type PeerGRPCOptions struct { SSLTargetNameOverride string `yaml:"ssl-target-name-override"` KeepAliveTime string `yaml:"keep-alive-time"` KeepAliveTimeout string `yaml:"keep-alive-timeout"` KeepAlivePermit bool `yaml:"keep-alive-permit"` FailFast bool `yaml:"fail-fast"` AllowInsecure bool `yaml:"allow-insecure"` }
type PeerTLSCACerts ¶
type PeerTLSCACerts struct {
Path string `yaml:"path"` // /fabric/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
}
type Policy ¶
type Policy struct { QueryChannelConfig *PolicyQueryChannelConfig `yaml:"queryChannelConfig"` Discovery *PolicyDiscovery `yaml:"discovery"` EventService *PolicyEventService `yaml:"eventService"` }
type PolicyCommonRetryOpts ¶
type PolicyDiscovery ¶
type PolicyDiscovery struct { MaxTargets int32 `yaml:"maxTargets"` RetryOpts *PolicyCommonRetryOpts `yaml:"retryOpts"` }
type PolicyEventService ¶
type PolicyEventService struct { ResolverStrategy string `yaml:"resolverStrategy"` Balancer string `yaml:"balancer"` BlockHeightLagThreshold int64 `yaml:"blockHeightLagThreshold"` ReconnectBlockHeightLagThreshold int64 `yaml:"reconnectBlockHeightLagThreshold"` PeerMonitorPeriod string `yaml:"peerMonitorPeriod"` }
type PolicyQueryChannelConfig ¶
type PolicyQueryChannelConfig struct { MinResponses int32 `yaml:"minResponses"` MaxTargets int32 `yaml:"maxTargets"` RetryOpts *PolicyCommonRetryOpts `yaml:"retryOpts"` }
Click to show internal directories.
Click to hide internal directories.