无法在超级分层结构中启动对等方,首先使用自定义加密材料

时间:2017-11-10 08:03:21

标签: hyperledger-fabric hyperledger

我按照以下链接使用自定义加密图形材料运行第一个网络示例。

First network sample using custom crypto grapic material

如链接中所述,我已经从CA生成了所有证书,并将内容放在所需的文件夹中 我也生成了所有的通道工件。 现在,当我运行以下命令启动容器时,我得到错误

CHANNEL_NAME=$CHANNEL_NAME docker-compose -f docker-compose-cli.yaml up -d

除CLI容器外,没有其他容器出现

订货人出错

2017-11-10 07:11:47.211 UTC [msp] getPemMaterialFromDir -> WARN 001 Failed reading file /var/hyperledger/orderer/msp/signcerts/signer.crt: no pem content for file /var/hyperledger/orderer/msp/signcerts/signer.crt

所有同行中的错误

2017-11-10 07:11:47.134 UTC [main] main -> ERRO 001 Cannot run peer because error when setting up MSP from directory /etc/hyperledger/fabric/msp: KeyMaterial not found in SigningIdentityInfo

订购者问题的signer.crt内容

-----开始证书----- MIIC0TCCAbmgAwIBAgIPAV + a2M5AtqiPiJ / UbeTPMA0GCSqGSIb3DQEBCwUAMDAxCzAJBgNVBAYTAlBMMQ4wDAYDVQQKEwVOb2tpYTERMA8GA1UEAxMIUkVTVCBDQTEwHhcNMTcxMTA4MDgyNzAwWhcNMTgwNzMxMTI1ODM1WjCBoDELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB0FsYWJhbWExEDAOBgNVBAcTB1Bob2VuaXgxITAfBgNVBAoTGEFkdmFuY2VkIEV4cGxvcmF0aW9uIEluYzEcMBoGA1UECxMTVEVTVCBCbG9ja2NoYWluIEh1YjEsMCoGA1UEAxMjdGVzdC1ibG9ja2NoYWluSHViLW9yZGVyZXIuYWV4cC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARQ0kKTAjB + Pfm2qTPj5AyRw8SU8CO431RdnmGFwfLRUYF + p6UsklNVEQbv6uGRKOLmPVHd3bY4 + WWhf1mlmJHqo0IwQDAfBgNVHSMEGDAWgBQ4wDFZQdWAiTTvmhvctnjg96t3NzAdBgN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24u6Zpk3KiGhfbU3msKiZ5YbXhUkFdy9e1YnIArSayrSanbLO1psGx0zI0SEICfFJ0iPaZYVNV34XzX66 + nlsOEq7WrhxHwhqlrV5lFqCj5imwC7ETRTErYl / + qblGfnETRoIEQMPwWHmKB6OcdltaoJxWH6scLMEfvFUTRCoVDnMGDB3ez / 8RscDtij8 / ARXAJRPmJICts0nQhXQoiVBqaolfTPe2PGC8YWoNoRxXp9mvYz2bg7vM4uq6Epd7wTrNTgugsqiaONwtYdJt + z9BBGjdeKZREfj93aB1LyY41wftpjKl4 = -----结束证书-----

signer.key文件内容

-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILa+xgvh9fAIkymEX4ohTlCIMxcZ6jO5KQxD9BZ7LpuWoAoGCCqGSM49
AwEHoUQDQgAEUNJCkwIwfj35tqkz4+QMkcPElPAjuN9UXZ5hhcHy0VGBfqelLJJT
VREG7+rhkSji5j1R3d22OPlloX9ZpZiR6g==
-----END EC PRIVATE KEY-----

Docker撰写基础yaml文件 docker-compose-base.yaml

请帮助

2 个答案:

答案 0 :(得分:1)

PEM文件的以下页眉和页脚行必须单独排成一行,因此您需要适当添加换行符:

-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxx
-----END CERTIFICATE-----

您还应通过使用openssl显示证书来验证证书格式是否有效,如下所示:

openssl x509 -in <filename> -text -noout

答案 1 :(得分:1)

所有对等方的错误都是由私钥的格式引起的。 Fabric组件不支持包含EC Params的私钥。所以你可以删除

-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
来自signer.key文件的

节或使用

重新生成它们
  

openssl ecparam -name prime256v1 -genkey -noout -out signer.key