diff --git a/bccsp/factory/opts.go b/bccsp/factory/opts.go index e03e3b3de65..9a9535280f1 100644 --- a/bccsp/factory/opts.go +++ b/bccsp/factory/opts.go @@ -17,9 +17,9 @@ package factory // DefaultOpts offers a default implementation for Opts type FactoryOpts struct { - ProviderName string `mapstructure:"default" json:"default"` - SwOpts *SwOpts `mapstructure:"SW,omitempty" json:"SW,omitempty"` - Pkcs11Opts *PKCS11Opts `mapstructure:"PKCS11,omitempty" json:"PKCS11,omitempty"` + ProviderName string `mapstructure:"default" json:"default" yaml:"Default"` + SwOpts *SwOpts `mapstructure:"SW,omitempty" json:"SW,omitempty" yaml:"SwOpts"` + Pkcs11Opts *PKCS11Opts `mapstructure:"PKCS11,omitempty" json:"PKCS11,omitempty" yaml:"PKCS11"` } var DefaultOpts = FactoryOpts{ diff --git a/bccsp/factory/swfactory.go b/bccsp/factory/swfactory.go index c95f0be0f2c..50ef4556cd2 100644 --- a/bccsp/factory/swfactory.go +++ b/bccsp/factory/swfactory.go @@ -65,18 +65,18 @@ func (f *SWFactory) Get(config *FactoryOpts) (bccsp.BCCSP, error) { // SwOpts contains options for the SWFactory type SwOpts struct { // Default algorithms when not specified (Deprecated?) - SecLevel int `mapstructure:"security" json:"security"` - HashFamily string `mapstructure:"hash" json:"hash"` + SecLevel int `mapstructure:"security" json:"security" yaml:"Security"` + HashFamily string `mapstructure:"hash" json:"hash" yaml:"Hash"` // Keystore Options Ephemeral bool `mapstructure:"tempkeys,omitempty" json:"tempkeys,omitempty"` - FileKeystore *FileKeystoreOpts `mapstructure:"filekeystore,omitempty" json:"filekeystore,omitempty"` + FileKeystore *FileKeystoreOpts `mapstructure:"filekeystore,omitempty" json:"filekeystore,omitempty" yaml:"FileKeyStore"` DummyKeystore *DummyKeystoreOpts `mapstructure:"dummykeystore,omitempty" json:"dummykeystore,omitempty"` } // Pluggable Keystores, could add JKS, P12, etc.. type FileKeystoreOpts struct { - KeyStorePath string `mapstructure:"keystore"` + KeyStorePath string `mapstructure:"keystore" yaml:"KeyStore"` } type DummyKeystoreOpts struct{} diff --git a/common/configtx/tool/localconfig/config.go b/common/configtx/tool/localconfig/config.go index 115018015e6..bc90f05f853 100644 --- a/common/configtx/tool/localconfig/config.go +++ b/common/configtx/tool/localconfig/config.go @@ -46,64 +46,64 @@ const Prefix string = "CONFIGTX" // TopLevel contains the genesis structures for use by the provisional bootstrapper type TopLevel struct { - Profiles map[string]*Profile - Organizations []*Organization - Application *Application - Orderer *Orderer + Profiles map[string]*Profile `yaml:"Profiles"` + Organizations []*Organization `yaml:"Organizations"` + Application *Application `yaml:"Application"` + Orderer *Orderer `yaml:"Orderer"` } // TopLevel contains the genesis structures for use by the provisional bootstrapper type Profile struct { - Application *Application - Orderer *Orderer + Application *Application `yaml:"Application"` + Orderer *Orderer `yaml:"Orderer"` } // Application encodes the configuration needed for the config transaction type Application struct { - Organizations []*Organization + Organizations []*Organization `yaml:"Organizations"` } type Organization struct { - Name string - ID string - MSPDir string - BCCSP *bccsp.FactoryOpts + Name string `yaml:"Name"` + ID string `yaml:"ID"` + MSPDir string `yaml:"MSPDir"` + BCCSP *bccsp.FactoryOpts `yaml:"BCCSP"` // Note, the viper deserialization does not seem to care for // embedding of types, so we use one organization structure for // both orderers and applications - AnchorPeers []*AnchorPeer + AnchorPeers []*AnchorPeer `yaml:"AnchorPeers"` } type AnchorPeer struct { - Host string - Port int + Host string `yaml:"Host"` + Port int `yaml:"Port"` } type ApplicationOrganization struct { - Organization + Organization `yaml:"Organization"` } // Orderer contains config which is used for orderer genesis by the provisional bootstrapper type Orderer struct { - OrdererType string - Addresses []string - BatchTimeout time.Duration - BatchSize BatchSize - Kafka Kafka - Organizations []*Organization + OrdererType string `yaml:"OrdererType"` + Addresses []string `yaml:"Addresses"` + BatchTimeout time.Duration `yaml:"BatchTimeout"` + BatchSize BatchSize `yaml:"BatchSize"` + Kafka Kafka `yaml:"Kafka"` + Organizations []*Organization `yaml:"Organizations"` } // BatchSize contains configuration affecting the size of batches type BatchSize struct { - MaxMessageCount uint32 - AbsoluteMaxBytes uint32 - PreferredMaxBytes uint32 + MaxMessageCount uint32 `yaml:"MaxMessageSize"` + AbsoluteMaxBytes uint32 `yaml:"AbsoluteMaxBytes"` + PreferredMaxBytes uint32 `yaml:"PreferredMaxBytes"` } // Kafka contains config for the Kafka orderer type Kafka struct { - Brokers []string + Brokers []string `yaml:"Brokers"` } var genesisDefaults = TopLevel{