用于Hyperledger Fabric V1.0网络设置的yaml文件中的Couchdb端口映射 [英] Couchdb port mapping in yaml file for Hyperledger Fabric V1.0 network setup

查看:189
本文介绍了用于Hyperledger Fabric V1.0网络设置的yaml文件中的Couchdb端口映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以在此 docker-compose-couch.yaml .

请查看以下内容

容器名称:benchdb0
-端口:
-"5984:5984"
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb0:5984

container_name: couchdb0
-ports:
- "5984:5984"
-- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984

容器名称:benchdb1
-端口:
-"6984:5984"
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb1:5984

container_name: couchdb1
-ports:
-- "6984:5984"
-- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984

容器名称:couchdb2
-端口:
-"7984:5984"
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb2:5984

container_name: couchdb2
-ports:
-- "7984:5984"
-- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb2:5984

容器名称:benchdb3
-端口:
-"8984:5984"
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb3:5984

container_name: couchdb3
-ports:
-- "8984:5984"
-- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb3:5984

  1. 为什么所有地址都映射到同一端口5984?是否使用相同的数据库而不是为每个对等方使用单独的数据库?

在进行交易之后,当我使用 Fauxton UI 使用以下URL检查数据库时

Also after making the transaction, when I check the db using Fauxton UI using the below URLs

http://192.168.99.100:5984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:6984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:7984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:8984/_utils/#/database/mydemochannel/_all_docs
( 192.168.99.100 是我在 windows 7 计算机上的虚拟机IP)

http://192.168.99.100:5984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:6984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:7984/_utils/#/database/mydemochannel/_all_docs http://192.168.99.100:8984/_utils/#/database/mydemochannel/_all_docs
(192.168.99.100 is my virtual machine IP on windows 7 machine)

全部显示相同的数据.

  1. 我的疑问是,它在 Fauxton用户界面中显示加密的数据或纯文本值吗?选中包括文档复选框后,它也会显示该值.根据我的理解,这些值将基于对等方的签名进行加密(如果我错了,请纠正我),然后它如何将值显示为纯文本jason?
  1. My doubt here is, it displaying encrypted data or plain text values in Fauxton UI? Once I tick the Include Docs check box, it is showing the value also. As per my understanding the values will be encrypted based on peers signature(please correct me if I am wrong), then how it is showing the value as plain text jason?

推荐答案

5984是沙发数据库端口号,现在docker-compose-couchdb.yaml文件中的端口映射仅定义了从docker容器到docker主机的映射.由于有4个ouchdb容器(每个对等体一个),您无法将它们全部映射到相同的端口号上,因此,每个容器都定义了不同的映射:分别为5984、6984、7984和8984.因此,它不是映射到相同的端口,而是从相同的端口映射到不同的端口.请参阅docker compose 此处的文档.

The 5984 is the couch db port number, now the mapping of ports from docker-compose-couchdb.yaml file simply defines mapping from docker container into docker host machine. Since there are 4 couchdb container (one for each peer) you cannot map all of them on the same port number, therefore for each one defined different mapping: 5984, 6984, 7984 and 8984 respectively. So it's not mapping to the same port, but from the same port to the different ones. Please refer for docker compose docs here.

从Hyperledger Fabric v1.0开始,状态db中不会对值进行加密,如果您要继续进行数据加密,则可以在应用程序级别进行加密.例如,客户可以通过提案的瞬态映射字段传递AES密钥,然后chaincode将根据该密钥对参数进行编码,以执行chaincode业务逻辑,将结果解码回去并存储.

Starting from Hyperledger Fabric v1.0 there is no encryption of values in state db, if you would like to proceed and encrypt your data you can do it on application level. For example client could pass AES key via transient map field of the proposal and chaincode will encode params based on that key do the chaincode business logic, decode results back and store them.

这篇关于用于Hyperledger Fabric V1.0网络设置的yaml文件中的Couchdb端口映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆