fabric1.0 tls模式配置

fabric1.0 tls模式配置

由于tls模式生成的crypto需要域名的方式,否则加密会出现x509密码学错误;目前可以通过修改hosts的形式来进行配置。

修改HOSTS文件

docker-compose文件中添加相关的extra_hosts
extra_hosts:
- “peer1.org1.example.com: 192.168.9.1”
- “orderer0.example.com: 192.168.9.2”
- “orderer1.example.com: 192.168.9.3”
peer节点所在宿主机修改hosts文件,这个是因为chaincode容器是host模式
echo 0.0.0.0 peer0.org1.example.com >> /etc/hosts
注意各个地方都要用域名形式

configtx.yaml中orderer地址要用域名
Addresses:
- orderer0.example.com:7050
- orderer1.example.com:7050

peer节点配置相关Address的时候需要用域名的形式
environment:
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052

猜你喜欢

转载自blog.csdn.net/yunlilang/article/details/78732786