config

package
v0.0.0-...-a76d37d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderOrgKey = "OrdererOrg"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert struct {
	Path string `yaml:"path"`
}

type CertificateAuthority

type CertificateAuthority struct {
	URL        string                          `yaml:"url"`
	CAName     string                          `yaml:"caName"`
	TLSCACerts *CertificateAuthorityTLSCACerts `yaml:"tlsCACerts"`
	Registrar  *CertificateAuthorityRegistrar  `yaml:"registrar"`
}

type CertificateAuthorityRegistrar

type CertificateAuthorityRegistrar struct {
	EnrollId     string `yaml:"enrollId"`
	EnrollSecret string `yaml:"enrollSecret"`
}

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 ChannelPeer struct {
	EndorsingPeer  bool `yaml:"endorsingPeer"`
	ChaincodeQuery bool `yaml:"chaincodeQuery"`
	LedgerQuery    bool `yaml:"ledgerQuery"`
	EventSource    bool `yaml:"eventSource"`
}

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 ClientGlobalCache struct {
	ConnectionIdle    string `yaml:"connectionIdle"`
	EventServiceIdle  string `yaml:"eventServiceIdle"`
	ChannelConfig     string `yaml:"channelConfig"`
	ChannelMembership string `yaml:"channelMembership"`
	Discovery         string `yaml:"discovery"`
	Selection         string `yaml:"selection"`
}

type ClientGlobalTimeout

type ClientGlobalTimeout struct {
	Query   string `yaml:"query"`
	Execute string `yaml:"execute"`
	Resmgmt string `yaml:"resmgmt"`
}

type ClientLogging

type ClientLogging struct {
	Level string `yaml:"level"` // info
}

ClientLogging 客户端日志设置对象

type ClientOrder

type ClientOrder struct {
	Timeout *ClientOrderTimeout `yaml:"timeout"`
}

type ClientOrderTimeout

type ClientOrderTimeout struct {
	Connection string `yaml:"connection"`
	Response   string `yaml:"response"`
}

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 (c *Config) AddOrSetCertificateAuthority(certName, url, tlsCACertPath, tlsCACertClientKeyPath,
	tlsCACertClientCertPath, caName, enrollId, enrollSecret string)

func (*Config) AddOrSetDiscoveryPolicyForChannel

func (c *Config) AddOrSetDiscoveryPolicyForChannel(channelName, initialBackOff, maxBackOff string,
	maxTargets, attempts int32, backOffFactor float32)

func (*Config) AddOrSetEventServicePolicyForChannel

func (c *Config) AddOrSetEventServicePolicyForChannel(channelName, resolverStrategy, balancer, peerMonitorPeriod string,
	blockHeightLagThreshold, reconnectBlockHeightLagThreshold int64)

func (*Config) AddOrSetOrderer

func (c *Config) AddOrSetOrderer(ordererName, url, sslTargetNameOverride, keepAliveTime, keepAliveTimeout,
	tlsCACerts string, keepAlivePermit, failFast, allowInsecure bool)

func (*Config) AddOrSetOrdererForOrganizations

func (c *Config) AddOrSetOrdererForOrganizations(orderName, mspID, cryptoPath string, users map[string]string)

func (*Config) AddOrSetOrgForOrganizations

func (c *Config) AddOrSetOrgForOrganizations(orgName, mspid, cryptoPath string, users map[string]string,
	peers, certificateAuthorities []string)

func (*Config) AddOrSetPeer

func (c *Config) AddOrSetPeer(peerName, url, eventUrl, sslTargetNameOverride, keepAliveTime, keepAliveTimeout,
	tlsCACerts string, keepAlivePermit, failFast, allowInsecure bool)

func (*Config) AddOrSetPeerForChannel

func (c *Config) AddOrSetPeerForChannel(channelName, peerName string, endorsingPeer, chaincodeQuery, ledgerQuery, eventSource bool)

func (*Config) AddOrSetQueryChannelPolicyForChannel

func (c *Config) AddOrSetQueryChannelPolicyForChannel(channelName, initialBackOff, maxBackOff string,
	minResponses, maxTargets, attempts int32, backOffFactor float32)

func (*Config) AddOrSetSelfCertificateAuthority

func (c *Config) AddOrSetSelfCertificateAuthority(leagueName, certName, url, caName, enrollId, enrollSecret string)

AddOrSetSelfCertificateAuthority

url https://10.10.203.51:30059

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 (c *Config) AddOrSetSelfOrdererForOrganizations(leagueName string)

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 (c *Config) GetPBConfig() *pb.Config

func (*Config) InitClient

func (c *Config) InitClient(tls bool, orgName, level, cryptoConfig, keyPath, certPath string)

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

func (c *Config) InitSelfClient(tls bool, leagueName, orgName, userName, level string)

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 Organization struct {
	MspID                  string           `yaml:"mspid"`
	CryptoPath             string           `yaml:"cryptoPath"`
	Users                  map[string]*User `yaml:"users,omitempty"`
	Peers                  []string         `yaml:"peers,omitempty"`
	CertificateAuthorities []string         `yaml:"certificateAuthorities,omitempty"`
}

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 PolicyCommonRetryOpts struct {
	Attempts       int32   `yaml:"attempts"`
	InitialBackOff string  `yaml:"initialBackoff"`
	MaxBackOff     string  `yaml:"maxBackoff"`
	BackOffFactor  float32 `yaml:"backoffFactor"`
}

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"`
}

type User

type User struct {
	Cert *Cert `yaml:"cert"`
}

Jump to

Keyboard shortcuts

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