当你新增配置文件如果代码没做相应添加结构体肯定会错
** 下面围绕国密为列 **
2019-07-10 13:47:22.025 CST [localconfig] completeInitialization -> INFO 0c5 Kafka.Version unset, setting to 0.10.2.0
2019-07-10 13:47:22.025 CST [orderer.common.server] initializeLocalMsp -> FATA 0c6 Failed to initialize local MSP: could not initialize BCCSP Factories: Failed initializing BCCSP.: Could not initialize BCCSP GM [Failed to initialize gm software key store: An invalid KeyStore path provided. Path cannot be an empty string.]
Could not find default `GM` BCCSP
这个错误在定位于/go/src/github.com/hyperledger/fabric/orderer/common/localconfig/config.go >>> Load() >>> EnhancedExactUnmarshal(config, &uconf) 的 第二个参数为参数结构体 所以你必须添加结构体, >>> 接下来就来定位在哪里添加结构体
定位
看到FactoryOpts结构添加
GmOpts *GmOpts
mapstructure:"GM,omitempty" json:"GM,omitempty" yaml:"GmOpts"` 结构根据要求填写你需求的结构
// SwOpts contains options for the SWFactory
type GmOpts struct {
// Default algorithms when not specified (Deprecated?)
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" yaml:"FileKeyStore"`
DummyKeystore *DummyKeystoreOpts `mapstructure:"dummykeystore,omitempty" json:"dummykeystore,omitempty"`
InmemKeystore *InmemKeystoreOpts `mapstructure:"inmemkeystore,omitempty" json:"inmemkeystore,omitempty"`
}
网友评论