fabric1.1开发(二-开发demo)

开发第一个demo

其中遇到的问题
问题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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值