github.com/yous1230/fabric@v2.0.0-beta.0.20191224111736-74345bee6ac2+incompatible/integration/nwo/fabricconfig/orderer.go (about)

     1  /*
     2  Copyright IBM Corp. 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  
    17  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    18  }
    19  
    20  type General struct {
    21  	ListenAddress   string                 `yaml:"ListenAddress,omitempty"`
    22  	ListenPort      int                    `yaml:"ListenPort,omitempty"`
    23  	TLS             *OrdererTLS            `yaml:"TLS,omitempty"`
    24  	Keepalive       *OrdererKeepalive      `yaml:"Keepalive,omitempty"`
    25  	BootstrapMethod string                 `yaml:"BootstrapMethod,omitempty"`
    26  	GenesisProfile  string                 `yaml:"GenesisProfile,omitempty"`
    27  	GenesisFile     string                 `yaml:"GenesisFile,omitempty"` // will be replaced by the BootstrapFile
    28  	BootstrapFile   string                 `yaml:"BootstrapFile,omitempty"`
    29  	LocalMSPDir     string                 `yaml:"LocalMSPDir,omitempty"`
    30  	LocalMSPID      string                 `yaml:"LocalMSPID,omitempty"`
    31  	Profile         *OrdererProfile        `yaml:"Profile,omitempty"`
    32  	BCCSP           *BCCSP                 `yaml:"BCCSP,omitempty"`
    33  	Authentication  *OrdererAuthentication `yaml:"Authentication,omitempty"`
    34  
    35  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    36  }
    37  
    38  type OrdererTLS struct {
    39  	Enabled            bool     `yaml:"Enabled"`
    40  	PrivateKey         string   `yaml:"PrivateKey,omitempty"`
    41  	Certificate        string   `yaml:"Certificate,omitempty"`
    42  	RootCAs            []string `yaml:"RootCAs,omitempty"`
    43  	ClientAuthRequired bool     `yaml:"ClientAuthRequired"`
    44  	ClientRootCAs      []string `yaml:"ClientRootCAs,omitempty"`
    45  }
    46  
    47  type OrdererSASLPlain struct {
    48  	Enabled  bool   `yaml:"Enabled"`
    49  	User     string `yaml:"User,omitempty"`
    50  	Password string `yaml:"Password,omitempty"`
    51  }
    52  
    53  type OrdererKeepalive struct {
    54  	ServerMinInterval time.Duration `yaml:"ServerMinInterval,omitempty"`
    55  	ServerInterval    time.Duration `yaml:"ServerInterval,omitempty"`
    56  	ServerTimeout     time.Duration `yaml:"ServerTimeout,omitempty"`
    57  }
    58  
    59  type OrdererProfile struct {
    60  	Enabled bool   `yaml:"Enabled"`
    61  	Address string `yaml:"Address,omitempty"`
    62  }
    63  
    64  type OrdererAuthentication struct {
    65  	TimeWindow time.Duration `yaml:"TimeWindow,omitempty"`
    66  }
    67  
    68  type OrdererTopic struct {
    69  	ReplicationFactor int16
    70  }
    71  
    72  type FileLedger struct {
    73  	Location string `yaml:"Location,omitempty"`
    74  	Prefix   string `yaml:"Prefix,omitempty"`
    75  }
    76  
    77  type Kafka struct {
    78  	Retry     *Retry            `yaml:"Retry,omitempty"`
    79  	Verbose   bool              `yaml:"Verbose"`
    80  	TLS       *OrdererTLS       `yaml:"TLS,omitempty"`
    81  	SASLPlain *OrdererSASLPlain `yaml:"SASLPlain,omitempty"`
    82  	Topic     *OrdererTopic     `yaml:"Topic,omitempty"`
    83  }
    84  
    85  type Retry struct {
    86  	ShortInterval   time.Duration    `yaml:"ShortInterval,omitempty"`
    87  	ShortTotal      time.Duration    `yaml:"ShortTotal,omitempty"`
    88  	LongInterval    time.Duration    `yaml:"LongInterval,omitempty"`
    89  	LongTotal       time.Duration    `yaml:"LongTotal,omitempty"`
    90  	NetworkTimeouts *NetworkTimeouts `yaml:"NetworkTimeouts,omitempty"`
    91  	Metadata        *Backoff         `yaml:"Metadata,omitempty"`
    92  	Producer        *Backoff         `yaml:"Producer,omitempty"`
    93  	Consumer        *Backoff         `yaml:"Consumer,omitempty"`
    94  }
    95  
    96  type NetworkTimeouts struct {
    97  	DialTimeout  time.Duration `yaml:"DialTimeout,omitempty"`
    98  	ReadTimeout  time.Duration `yaml:"ReadTimeout,omitempty"`
    99  	WriteTimeout time.Duration `yaml:"WriteTimeout,omitempty"`
   100  }
   101  
   102  type Backoff struct {
   103  	RetryBackoff time.Duration `yaml:"RetryBackoff,omitempty"`
   104  	RetryMax     int           `yaml:"RetryMax,omitempty"`
   105  }
   106  
   107  type OrdererOperations struct {
   108  	ListenAddress string          `yaml:"ListenAddress,omitempty"`
   109  	Metrics       *OrdererMetrics `yaml:"Metrics,omitempty"`
   110  	TLS           *OrdererTLS     `yaml:"TLS"`
   111  }
   112  
   113  type OrdererMetrics struct {
   114  	Provider string         `yaml:"Provider"`
   115  	Statsd   *OrdererStatsd `yaml:"Statsd,omitempty"`
   116  }
   117  
   118  type OrdererStatsd struct {
   119  	Network       string        `yaml:"Network,omitempty"`
   120  	Address       string        `yaml:"Address,omitempty"`
   121  	WriteInterval time.Duration `yaml:"WriteInterval,omitempty"`
   122  	Prefix        string        `yaml:"Prefix,omitempty"`
   123  }