github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/integration/nwo/fabricconfig/orderer.go (about)

     1  /*
     2  Copyright hechain. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package fabricconfig
     8  
     9  import "time"
    10  
    11  type Orderer struct {
    12  	General              *General              `yaml:"General,omitempty"`
    13  	FileLedger           *FileLedger           `yaml:"FileLedger,omitempty"`
    14  	Kafka                *Kafka                `yaml:"Kafka,omitempty"`
    15  	Operations           *OrdererOperations    `yaml:"Operations,omitempty"`
    16  	ChannelParticipation *ChannelParticipation `yaml:"ChannelParticipation,omitempty"`
    17  	Consensus            map[string]string     `yaml:"Consensus,omitempty"`
    18  
    19  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    20  }
    21  
    22  type General struct {
    23  	ListenAddress   string                 `yaml:"ListenAddress,omitempty"`
    24  	ListenPort      uint16                 `yaml:"ListenPort,omitempty"`
    25  	TLS             *OrdererTLS            `yaml:"TLS,omitempty"`
    26  	Keepalive       *OrdererKeepalive      `yaml:"Keepalive,omitempty"`
    27  	BootstrapMethod string                 `yaml:"BootstrapMethod,omitempty"`
    28  	GenesisProfile  string                 `yaml:"GenesisProfile,omitempty"`
    29  	GenesisFile     string                 `yaml:"GenesisFile,omitempty"` // will be replaced by the BootstrapFile
    30  	BootstrapFile   string                 `yaml:"BootstrapFile,omitempty"`
    31  	LocalMSPDir     string                 `yaml:"LocalMSPDir,omitempty"`
    32  	LocalMSPID      string                 `yaml:"LocalMSPID,omitempty"`
    33  	Profile         *OrdererProfile        `yaml:"Profile,omitempty"`
    34  	BCCSP           *BCCSP                 `yaml:"BCCSP,omitempty"`
    35  	Authentication  *OrdererAuthentication `yaml:"Authentication,omitempty"`
    36  	Cluster         *Cluster               `yaml:"Cluster,omitempty"`
    37  
    38  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    39  }
    40  
    41  type Cluster struct {
    42  	ListenAddress                        string        `yaml:"ListenAddress,omitempty"`
    43  	ListenPort                           uint16        `yaml:"ListenPort,omitempty"`
    44  	ServerCertificate                    string        `yaml:"ServerCertificate,omitempty"`
    45  	ServerPrivateKey                     string        `yaml:"ServerPrivateKey,omitempty"`
    46  	ClientCertificate                    string        `yaml:"ClientCertificate,omitempty"`
    47  	ClientPrivateKey                     string        `yaml:"ClientPrivateKey,omitempty"`
    48  	RootCAs                              []string      `yaml:"RootCAs,omitempty"`
    49  	DialTimeout                          time.Duration `yaml:"DialTimeout,omitempty"`
    50  	RPCTimeout                           time.Duration `yaml:"RPCTimeout,omitempty"`
    51  	ReplicationBufferSize                int           `yaml:"ReplicationBufferSize,omitempty"`
    52  	ReplicationPullTimeout               time.Duration `yaml:"ReplicationPullTimeout,omitempty"`
    53  	ReplicationRetryTimeout              time.Duration `yaml:"ReplicationRetryTimeout,omitempty"`
    54  	ReplicationBackgroundRefreshInterval time.Duration `yaml:"ReplicationBackgroundRefreshInterval,omitempty"`
    55  	ReplicationMaxRetries                int           `yaml:"ReplicationMaxRetries,omitempty"`
    56  	SendBufferSize                       int           `yaml:"SendBufferSize,omitempty"`
    57  	CertExpirationWarningThreshold       time.Duration `yaml:"CertExpirationWarningThreshold,omitempty"`
    58  	TLSHandshakeTimeShift                time.Duration `yaml:"TLSHandshakeTimeShift,omitempty"`
    59  }
    60  
    61  type OrdererTLS struct {
    62  	Enabled               bool          `yaml:"Enabled"`
    63  	PrivateKey            string        `yaml:"PrivateKey,omitempty"`
    64  	Certificate           string        `yaml:"Certificate,omitempty"`
    65  	RootCAs               []string      `yaml:"RootCAs,omitempty"`
    66  	ClientAuthRequired    bool          `yaml:"ClientAuthRequired"`
    67  	ClientRootCAs         []string      `yaml:"ClientRootCAs,omitempty"`
    68  	TLSHandshakeTimeShift time.Duration `yaml:"TLSHandshakeTimeShift,omitempty"`
    69  }
    70  
    71  type OrdererSASLPlain struct {
    72  	Enabled  bool   `yaml:"Enabled"`
    73  	User     string `yaml:"User,omitempty"`
    74  	Password string `yaml:"Password,omitempty"`
    75  }
    76  
    77  type OrdererKeepalive struct {
    78  	ServerMinInterval time.Duration `yaml:"ServerMinInterval,omitempty"`
    79  	ServerInterval    time.Duration `yaml:"ServerInterval,omitempty"`
    80  	ServerTimeout     time.Duration `yaml:"ServerTimeout,omitempty"`
    81  }
    82  
    83  type OrdererProfile struct {
    84  	Enabled bool   `yaml:"Enabled"`
    85  	Address string `yaml:"Address,omitempty"`
    86  }
    87  
    88  type OrdererAuthentication struct {
    89  	TimeWindow time.Duration `yaml:"TimeWindow,omitempty"`
    90  }
    91  
    92  type OrdererTopic struct {
    93  	ReplicationFactor int16
    94  }
    95  
    96  type FileLedger struct {
    97  	Location string `yaml:"Location,omitempty"`
    98  }
    99  
   100  type Kafka struct {
   101  	Retry     *Retry            `yaml:"Retry,omitempty"`
   102  	Verbose   bool              `yaml:"Verbose"`
   103  	TLS       *OrdererTLS       `yaml:"TLS,omitempty"`
   104  	SASLPlain *OrdererSASLPlain `yaml:"SASLPlain,omitempty"`
   105  	Topic     *OrdererTopic     `yaml:"Topic,omitempty"`
   106  }
   107  
   108  type Retry struct {
   109  	ShortInterval   time.Duration    `yaml:"ShortInterval,omitempty"`
   110  	ShortTotal      time.Duration    `yaml:"ShortTotal,omitempty"`
   111  	LongInterval    time.Duration    `yaml:"LongInterval,omitempty"`
   112  	LongTotal       time.Duration    `yaml:"LongTotal,omitempty"`
   113  	NetworkTimeouts *NetworkTimeouts `yaml:"NetworkTimeouts,omitempty"`
   114  	Metadata        *Backoff         `yaml:"Metadata,omitempty"`
   115  	Producer        *Backoff         `yaml:"Producer,omitempty"`
   116  	Consumer        *Backoff         `yaml:"Consumer,omitempty"`
   117  }
   118  
   119  type NetworkTimeouts struct {
   120  	DialTimeout  time.Duration `yaml:"DialTimeout,omitempty"`
   121  	ReadTimeout  time.Duration `yaml:"ReadTimeout,omitempty"`
   122  	WriteTimeout time.Duration `yaml:"WriteTimeout,omitempty"`
   123  }
   124  
   125  type Backoff struct {
   126  	RetryBackoff time.Duration `yaml:"RetryBackoff,omitempty"`
   127  	RetryMax     int           `yaml:"RetryMax,omitempty"`
   128  }
   129  
   130  type OrdererOperations struct {
   131  	ListenAddress string          `yaml:"ListenAddress,omitempty"`
   132  	Metrics       *OrdererMetrics `yaml:"Metrics,omitempty"`
   133  	TLS           *OrdererTLS     `yaml:"TLS"`
   134  }
   135  
   136  type OrdererMetrics struct {
   137  	Provider string         `yaml:"Provider"`
   138  	Statsd   *OrdererStatsd `yaml:"Statsd,omitempty"`
   139  }
   140  
   141  type OrdererStatsd struct {
   142  	Network       string        `yaml:"Network,omitempty"`
   143  	Address       string        `yaml:"Address,omitempty"`
   144  	WriteInterval time.Duration `yaml:"WriteInterval,omitempty"`
   145  	Prefix        string        `yaml:"Prefix,omitempty"`
   146  }
   147  
   148  type ChannelParticipation struct {
   149  	Enabled            bool   `yaml:"Enabled"`
   150  	MaxRequestBodySize string `yaml:"MaxRequestBodySize,omitempty"`
   151  }