其中遇到的问题
问题1
在创建通道的时候,peer节点出错退出
Error during CouchDB CreateDatabaseIfNotExist() for dbName: mychannel_ error: json: cannot unmarshal string into Go struct field DBInfo.purge_seq of type int
panic: Error during commit to txmgr:json: cannot unmarshal string into Go struct field DBInfo.purge_seq of type int
原因是couchdb版本不匹配,下载对应版本的couchdb
docker pull hyperledger/fabric-couchdb:x86_64-0.4.6
在docker-compose.yaml文件中指定使用这个版本的couchdb
couchdb:
container_name: couchdb
image: hyperledger/fabric-couchdb:x86_64-0.4.6 # 这里修改一下
# Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
# for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=123456
ports:
- 5984:5984
networks:
- basic
问题2
ca镜像遇到错误退出
Error: Failed to find private key for certificate in '/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem': Could not find matching private key for SKI: Failed getting key for SKI [[10 113 200 225 176 3 171 88 19 130 198 46 55 217 252 22
因为yaml文件没有更新
ca.example.com:
image: hyperledger/fabric-ca:x86_64-1.1.0
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/2f140552f996e5744b70af7741e156a82b9f4ab25fc3bb2c26375046480356ce_sk ## 这里要根据第一步生成证书的crypto-config/peerOrganizations/org1.example.com/ca/2f140552f996e5744b70af7741e156a82b9f4ab25fc3bb2c26375046480356ce_sk文件名更换sk文件名
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.example.com
networks:
- basic