Hyperledger fabric 对等组织中组织单元标识符的实现导致订购方恐慌和退出

Hyperledger fabric 对等组织中组织单元标识符的实现导致订购方恐慌和退出,hyperledger-fabric,hyperledger,Hyperledger Fabric,Hyperledger,我正在尝试将新组织添加到对等组织Org1MSP。我修改了config.yaml文件,该文件存在于msp目录中。文件修改后,内容如下: OrganizationalUnitIdentifiers: - Certificate: cacerts/ca.org1.example.com-cert.pem OrganizationalUnitIdentifier: TEST 修改后,我生成了genesis.block和channel.tx。我正在使用docker引导我的网络。问题是,当我

我正在尝试将新组织添加到对等组织
Org1MSP
。我修改了
config.yaml
文件,该文件存在于
msp
目录中。文件修改后,内容如下:

 OrganizationalUnitIdentifiers:
  - Certificate: cacerts/ca.org1.example.com-cert.pem
    OrganizationalUnitIdentifier: TEST
修改后,我生成了
genesis.block
channel.tx
。我正在使用
docker
引导我的网络。问题是,当我引导网络时,订购方抛出一个错误并退出。订购方的日志如下所示:

orderer.example.com       | 2018-10-24 22:00:45.704 UTC [msp] satisfiesPrincipalInternalPreV13 -> DEBU 05b Checking if identity satisfies role [CLIENT] for Org1MSP
orderer.example.com       | 2018-10-24 22:00:45.704 UTC [msp] Validate -> DEBU 05c MSP Org1MSP validating identity
orderer.example.com       | 2018-10-24 22:00:45.704 UTC [msp] getCertificationChain -> DEBU 05d MSP Org1MSP getting certification chain
orderer.example.com       | 2018-10-24 22:00:45.704 UTC [msp] getCertificationChain -> DEBU 05e MSP Org1MSP getting certification chain
orderer.example.com       | 2018-10-24 22:00:45.704 UTC [msp] getCertificationChain -> DEBU 05f MSP Org1MSP getting certification chain
orderer.example.com       | 2018-10-24 22:00:45.705 UTC [orderer/commmon/multichannel] newLedgerResources -> PANI 060 Error creating channelconfig bundle: initializing channelconfig failed: could not create channel Consortiums sub-group config: setting up the MSP manager failed: admin 0 is invalid: The identity is not valid under this MSP [Org1MSP]: could not validate identity's OUs: none of the identity's organizational units [[0xc4204e9ad0]] are in MSP Org1MSP
orderer.example.com       | panic: Error creating channelconfig bundle: initializing channelconfig failed: could not create channel Consortiums sub-group config: setting up the MSP manager failed: admin 0 is invalid: The identity is not valid under this MSP [Org1MSP]: could not validate identity's OUs: none of the identity's organizational units [[0xc4204e9ad0]] are in MSP Org1MSP
orderer.example.com       | 
orderer.example.com       | goroutine 1 [running]:
orderer.example.com       | github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc4200f0630, 0x0, 0x0, 0x0)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x4f4
orderer.example.com       | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc42017a1e0, 0x4, 0xe14c6d, 0x27, 0xc4204af958, 0x1, 0x1, 0x0, 0x0, 0x0)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0xf6
orderer.example.com       | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(0xc42017a1e0, 0xe14c6d, 0x27, 0xc4204af958, 0x1, 0x1)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159 +0x79
orderer.example.com       | github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(0xc42017a1e8, 0xe14c6d, 0x27, 0xc4204af958, 0x1, 0x1)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:74 +0x60
orderer.example.com       | github.com/hyperledger/fabric/orderer/common/multichannel.(*Registrar).newLedgerResources(0xc4202725a0, 0xc420178e60, 0xc420178e60)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:256 +0x2ea
orderer.example.com       | github.com/hyperledger/fabric/orderer/common/multichannel.NewRegistrar(0xea36a0, 0xc42000c3a0, 0xc4202567b0, 0xe9b060, 0x15a78b0, 0xc42017a2f0, 0x1, 0x1, 0x0)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:142 +0x312
orderer.example.com       | github.com/hyperledger/fabric/orderer/common/server.initializeMultichannelRegistrar(0xc420100580, 0xe9b060, 0x15a78b0, 0xc42017a2f0, 0x1, 0x1, 0x0)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:258 +0x250
orderer.example.com       | github.com/hyperledger/fabric/orderer/common/server.Start(0xdf7a5a, 0x5, 0xc420100580)
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:96 +0x226
orderer.example.com       | github.com/hyperledger/fabric/orderer/common/server.Main()
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:75 +0x1d6
orderer.example.com       | main.main()
orderer.example.com       |     /opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
orderer.example.com exited with code 2
我正在使用Hyperledger Fabric v1.3

完整的日志可在此处找到:

如果你有任何建议,请告诉我。
任何帮助/意见都将不胜感激。

因此,我认为问题在于加密材料。如果在MSP配置中启用NodeOUs,则在使用cryptogen生成加密材料时也必须启用它。请看一看和。希望这有帮助

在MSP中编辑
config.yaml
文件要求
cacerts/ca.org1.example.com-cert.pem
颁发的所有证书都具有OU
TEST

如果您使用以下方法检查MSP目录中的管理员证书:


openssl x509 -noout -text -in msp/admincerts/Admin\@org1.example.com-cert.pem | grep OU
您应该能够看到您的证书的OU。最可能的情况是,您的管理员证书没有设置此OU,因此它不被认为是由您的MSP有效颁发的(因此,在引导上设置MSP时出错)

如果使用
cryptogen
引导网络,则应编辑
crypto config.yaml
文件。在您的组织下,添加一个
CA
元素和一个
OrganizationalUnit:
子元素。例如:


OrdererOrgs:
  # ---------------------------------------------------------------------------
  # Orderer
  # ---------------------------------------------------------------------------
  - Name: Orderer
    Domain: example.com
    CA:
        OrganizationalUnit: TEST
    # ---------------------------------------------------------------------------
    # "Specs" - See PeerOrgs below for complete description
    # ---------------------------------------------------------------------------
    Specs:
      - Hostname: orderer

我还要注意,如果您使用
cryptogen
来引导您的环境,那么很可能不需要在MSP的
config.yaml
文件中使用OU。在尝试与现有组织的CA服务器集成时,需要CA提供特定的OU最为有用,因为CA服务器可能会为其他目的颁发证书,但并非所有证书都适用于Fabric。

谢谢您的回复。你知道如何将OU添加到管理员证书吗?我已经更新了帖子,说明如果使用cryptogen,可以如何添加OU。