hyperledger

Get Count of assets in HyperLedger Composer Query?

你说的曾经没有我的故事 提交于 2020-01-22 02:02:46
问题 I want to write a query in HyperLedger Composer that returns me the count of assets that I have in hyper ledger. I have thousands of records. I don't want to fetch them all and calculate count. Data transfer will be slow I want the query to return the count. 回答1: Unfortunately there is no count in the composer query language. You would have to create a query to select all the assets then check the length of the results. For example with the Basic Sample Network: query selectAssets {

CentOS7 搭建Fabric 1.0

烈酒焚心 提交于 2020-01-21 23:20:15
1.环境搭建 1.1 go的按装及配置 1.1.1下载go压缩包 ​ wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz 1.1.2 解压 ​ tar -C /usr/local -zxvf go1.9.2.linux-amd64.tar.gz 1.1.3配置环境变量 ​ vi ~/.bash_profile 添加如下内容: PATH=$PATH:$HOME/bin export PATH export PATH=$PATH:/usr/local/go/bin export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$PATH:$HOME/go/bin 使环境变量生效 source ~/.bash_profile 1.2 安装Docker 1.2.1 检查是否已经安装 rpm -qa|grep docker 1.2.2 卸载旧版本 yum remove docker docker-client docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine 1.2.3

超级账本HyperLedger Fabric实战技术50问(珍藏版)

戏子无情 提交于 2020-01-21 20:05:00
1.在fabric中,如何实现组织ORG1与组织ORG2之间的PEER互相交互?{“Args”:[“init”,“a”,“100”,“b”,“200”]}’,如何把a定义为属于ORG1,b定义为属于ORG2? 答:一个channel一本账。channel里的所以org共享账本数据,org1与org2如果在一个channel就可以共享账本数据了。 2.fabric中每台peer上的ca不合根ca联网,怎么做到网络中其他节点的信任。 答:每个节点上都有根ca签发的证书啊,节点加入首先得有证书,不管是根签发的,还是中间节点签发的。 3.fabric中间CA签发证书的时候,需要跟ROOTCA通讯吗? 答:不需要。 4.fabric安装连码缺少包的支持的时候,怎么把支持的包到入进去? 答:把fabric源码放到gopath里面去。 5.大家都是怎么开发chaincode的,直接在Linux里面还是在windows里? 答:goland是go语言环境都配好了,不过需要激活,vscode需要自己安装go语言的支持包,sublime也需要安装支持包,主要还是看你主要使用的什么编译器。 6.solo多机部署时,peer0.org1.example.com执行.scripts/script.shmychannel后,生成的mychannel.block是只存在该节点呢还是其他节点也会同步生成? 答

Fabric CA环境的集成

回眸只為那壹抹淺笑 提交于 2020-01-20 18:35:34
我们前面关于Fabric的所有文章中用到的例子都没有CA Server,都是由cryptogen这个工具根据crypto-config.yaml而生成的。但是在实际生产环境中,我们肯定不能这么做,我们应该为每个Org建立一个CA,由CA来管理其中的用户。下面我们就试着讲Fabric CA集成到整个Fabric网络中,并用CA Client生成新用户,最终使用新用户调用ChainCode,验证新用户的合法性。我们仍然以官方的e2e_cli为例,关于这个例子的环境搭建,可以参考我的上一篇博客: http://www.cnblogs.com/studyzy/p/7437157.html 1.修改docker-compose文件,增加CA容器 我们就以给org1这个组织增加CA容器为例,打开e2e_cli文件夹中的docker-compose-cli.yaml ,增加以下内容: ca0: image: hyperledger/fabric-ca environment: - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server - FABRIC_CA_SERVER_CA_NAME=ca0 - FABRIC_CA_SERVER_TLS_ENABLED=false ports: - "7054:7054" command: sh -c 'fabric

Hyperledger Composer - multi host installation

≯℡__Kan透↙ 提交于 2020-01-17 01:25:10
问题 I've been experimenting with Hyperledger Fabric, deployed over 2 VirtualBox Ubuntu images with docker swarm. But I have some issues when it comes to the Composer installation. Network Setup: Host1: Orderer, Peer1.Org1, Peer2.Org1, CLI Host2: Peer1.Org2, Peer2.Org2 When it comes to the Fabric setup everything appears to be ok. I'm able to start the network, join the peers from the second host, and update the anchor peers (one for each organisation). The Composer installation starts with

AssetRegistry.get function is not returning the complete object in Hyperledger Composer

三世轮回 提交于 2020-01-16 21:57:16
问题 It is an inheritance, Record has a reference of SampleAsset and SampletAsset has a reference of SampleParticipant. In transaction I am sending record object and when i am printing it on console It is showing complete information of Sample asset and complete information of SampleParticipant, while I am trying to fetch it using get method it is not returning the complete information of the objects. Please check the screenshot: Record Object getObject SampleParticipant(owner) reference is not

AssetRegistry.get function is not returning the complete object in Hyperledger Composer

偶尔善良 提交于 2020-01-16 21:56:07
问题 It is an inheritance, Record has a reference of SampleAsset and SampletAsset has a reference of SampleParticipant. In transaction I am sending record object and when i am printing it on console It is showing complete information of Sample asset and complete information of SampleParticipant, while I am trying to fetch it using get method it is not returning the complete information of the objects. Please check the screenshot: Record Object getObject SampleParticipant(owner) reference is not

How to run Hyperledger Composer Rest Server docker image?

醉酒当歌 提交于 2020-01-16 21:33:14
问题 I have pulled hyperledger/composer-rest-server docker image , Now if i wanted to run this docker image then on which port should i expose ? Like mentioned below. docker run --name composer-rest-server --publish XXXX:YYYY --detach hyperledger/composer-rest-server Here please tell me what should i replace for XXXX & YYYY ? 回答1: I run the rest server in a container using a command as follows: docker run -d \ -e COMPOSER_CARD="admin@test-net" \ -e COMPOSER_NAMESPACES="never" \ -v ~/.composer:

How to run Hyperledger Composer Rest Server docker image?

六月ゝ 毕业季﹏ 提交于 2020-01-16 21:31:27
问题 I have pulled hyperledger/composer-rest-server docker image , Now if i wanted to run this docker image then on which port should i expose ? Like mentioned below. docker run --name composer-rest-server --publish XXXX:YYYY --detach hyperledger/composer-rest-server Here please tell me what should i replace for XXXX & YYYY ? 回答1: I run the rest server in a container using a command as follows: docker run -d \ -e COMPOSER_CARD="admin@test-net" \ -e COMPOSER_NAMESPACES="never" \ -v ~/.composer:

How to run Hyperledger Composer Rest Server docker image?

﹥>﹥吖頭↗ 提交于 2020-01-16 21:30:15
问题 I have pulled hyperledger/composer-rest-server docker image , Now if i wanted to run this docker image then on which port should i expose ? Like mentioned below. docker run --name composer-rest-server --publish XXXX:YYYY --detach hyperledger/composer-rest-server Here please tell me what should i replace for XXXX & YYYY ? 回答1: I run the rest server in a container using a command as follows: docker run -d \ -e COMPOSER_CARD="admin@test-net" \ -e COMPOSER_NAMESPACES="never" \ -v ~/.composer: