私が従った手順:
1) 1-ca (ルート ca)、1-orderer、1-peer、および 1-couchdb でファブリックを開始しました
2) ルートである ca にシェルを接続し、2 つのコマンドを実行して中間 ca を登録します。
fabric-ca-client enroll -u http://admin:adminpw@localhost:7054
fabric-ca-client register --id.name ica --id.attrs '"hf.Registrar.Roles=user,peer",hf.Revoker=true,hf.IntermediateCA=true' --id.secret icapw
3) 次のように ca1 コンテナーを開始しました。
services:
ca1.example.com:
image: hyperledger/fabric-ca:x86_64-1.1.0
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_PORT=8054
- FABRIC_CA_SERVER_CA_NAME=ca1.example.com
ports:
- "8054:8054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -u http://ica:icapw@ca.example.com:7054'
container_name: ca1.example.com
networks:
- basic
ただし、常にデフォルトの証明書が作成されるため、コンテナーからすべてを削除してから開始コマンドを再度起動し、その中間 CA を使用して管理者を登録しようとすると、次のエラーが表示されます。
signed certificate with serial number 619423114660023963149266564884451731119475746692
ca1.example.com | 2018/09/20 06:38:53 [INFO] 127.0.0.1:47144 POST /enroll 500 0 "Certificate signing failure: Failed to insert record intodatabase: attempt to write a readonly database"
従ったプロセスについて確信が持てません。したがって、従うべき正確な手順を教えてください。手順が正しい場合は、このエラーの原因を教えてください。
ドキュメントに従っています:https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.htm