hyperledger

Hyperledger Fabric1.4 手动搭建过程

久未见 提交于 2020-05-02 19:01:46
1、生成证书: #路径需要更改为自己的路径 cd ~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/ #在这里可能会报错,通常是权限问题,可以添加sudo重新执行 cryptogen generate --config=./crypto- config.yaml #执行完毕后,当前文件夹下会出现一个新的文件夹:crypto-config,在该文件夹下就是刚刚生成的证书. 2、Orderer服务 生成创世区块,通道配置,锚节点配置文件 #路径需要更改为自己的路径 cd ~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/ 生成创世区块 configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block 生成通道配置信息 export CHANNEL_NAME= mychannel configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -

Hyperledger Fabric1.4 安装

心已入冬 提交于 2020-05-02 18:15:10
Hyperledger Fabric 依赖的软件版本查看官方 github 地址 https://github.com/hyperledger/fabric 下文件 /docs/source/prereqs.rst,软件版本要求根据安装的 Fabric 的版本差异而略有不同。 1 安装依赖工具 为了下载方便,最好将 Ubuntu 的软件镜像源更换为国内,点击 “软件和更新” 将镜像源更换为国内,最好是华为或者阿里的源。更换之后,使用如下命令进行更新: $ sudo apt update 1.1 安装 git 安装 git 工具使用如下命令: $ sudo apt install git <br> 1.2 安装 cURL 安装 cURL 使用如下命令: $ sudo apt install curl <br> 1.3 安装 Docker 查看系统是否已经安装 Docker: $ docker --version 未安装,使用如下命令安装最新版本的 Docker: $ sudo apt install docker.io 安装完之后,查看版本,出现如下字样则安装成功: $ docker --version Docker version 18.09.7, build 2d0083d 设置成非 root 用户也能执行 docker,需要将普通用户加入 docker 组: $ sudo

Hyperledger Fabric V2.0(三)手动搭建Fabric网络(first-network)

只愿长相守 提交于 2020-05-02 18:14:15
本文已更新,请移步 Hyperledger Fabric(五)手动搭建Fabric网络V2.0(基于first-network案例) 基于byfn.sh脚本文件的自动化部署过程如下: ① 进入fabric-samples/first-network目录 cd fabric-samples/first-network ② 为各种网络实体生成所需的证书及密钥,引导排序服务的genesis块,配置通道所需的配置事务,以及锚节点更新事务 ./byfn.sh generate #可通过如 -c alwayschannel 指定通道名称,默认为mychannel ③ 启动网络,创建通道,安装、定义并调用链码 byfn.sh up #用默认值启动网络,可通过-c mychannel指定通道名称,-s couchdb指定使用couchdb而不是leveldb,指定参数-n以不安装abstore智能合约(该脚本默认安装该合约),-l java指定安装脚本的语言为java ④ 销毁网络 ./byfn.sh down #停止并删除所有容器,删除chaincode镜像,删除证书及密钥(crypto-config目录下),以及四个通道文件(channel-artifacts目录下,分别为:genesis.block,channel.tx,Org1MSPanchors.tx,Org2MSPanchors.tx

hyperledge工具-configtxgen

帅比萌擦擦* 提交于 2020-05-02 16:10:05
参考http://www.blockchainbrother.com/article/1339 configtxgen是Hyperledger Fabric提供的用于通道配置的实用程序,主要生成以下3种文件: 排序服务节点使用的创世区块; 创建通道使用的通道配置交易; 更新通道用的锚节点交易。 目前,该工具主要侧重于生成排序服务节点的创世区块,但是将来预计增加生成新通道的配置以及重新配置已有的通道。 1.编译生成该configtxgen工具的方法与cryptogen相似,有两种办法: 该工具的源码在github.com/hyperledger/fabric/common/tools/configtxgen 1)在github.com/hyperledger/fabric目录下运行: vagrant@ubuntu-xenial:/opt/gopath/src/github.com/hyperledger/fabric$ configtxgen -- help configtxgen: command not found vagrant@ubuntu -xenial:/opt/gopath/src/github.com/hyperledger/ fabric$ make configtxgen .build /bin/ configtxgen CGO_CFLAGS = " "

rpc error - Proposal failed when peer joins channel in Fabric

99封情书 提交于 2020-04-30 11:46:08
问题 I am trying to run the byfn network in Hyperledger Fabric for version 1.4. I have started the containers, the crypto materials are setup, configuration is setup and the channel is created. However when it comes to the peer joining step i get the following error + peer channel join -b mychannel.block + res=1 + set +x 2020-02-12 07:53:23.356 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable 2020-02-12 07:53:23.395

rpc error - Proposal failed when peer joins channel in Fabric

穿精又带淫゛_ 提交于 2020-04-30 11:45:23
问题 I am trying to run the byfn network in Hyperledger Fabric for version 1.4. I have started the containers, the crypto materials are setup, configuration is setup and the channel is created. However when it comes to the peer joining step i get the following error + peer channel join -b mychannel.block + res=1 + set +x 2020-02-12 07:53:23.356 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable 2020-02-12 07:53:23.395

rpc error - Proposal failed when peer joins channel in Fabric

99封情书 提交于 2020-04-30 11:45:23
问题 I am trying to run the byfn network in Hyperledger Fabric for version 1.4. I have started the containers, the crypto materials are setup, configuration is setup and the channel is created. However when it comes to the peer joining step i get the following error + peer channel join -b mychannel.block + res=1 + set +x 2020-02-12 07:53:23.356 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable 2020-02-12 07:53:23.395

HyperLedger Fabric 1.4 超级账本项目(5.4)

徘徊边缘 提交于 2020-04-27 12:03:54
网易云课堂视频在线教学,地址: https://study.163.com/course/introduction/1209401942.htm 超级账本(Hyperledger)项目分框架类和工具类两种项目,框架类有Hyperledger Burrow、Hyperledger Fabric、Hyperledger Indy、Hyperledger Iroha和Hyperledger Sawtooth五个顶级项目;工具类有Hyperledger Caliper、Hyperledger Cello、Hyperledger Composer、Hyperledger Explorer和Hyperledger Quilt五个项目。项目结构图如下: 图:项目结构 框架类: Hyperledger Burrow:提供以太坊虚拟机的支持,实现支持高效交易的带权限的区块链平台,由Monax 、Intel等企业于2 017 年4 月提交到社区。在GitHub 上源码地址为 https://github.com/hyperledger/burrow ; Hyperledger Fabric:最早加入到超级账本项目中的顶级项目,包括Fabric 、Fabric CA 、Fabric SDK (包括Node.Js 、Python 和Java 等语言)和fabric-api 等,目标是区块链的基础核心平台

Fabric 智能合约——token(代币)交易

这一生的挚爱 提交于 2020-04-21 00:23:28
1. 应用场景 代币系统需要支持新种类代币发行、代币转账,额度查询,代币增发,代币回收、账户冻结,锁仓等功能。 代币增发后转入coinbase账户,coinbase账户与普通账户之间可以互相转账。这样就实现了代币流通。 2. 数据的生命周期 代币(token)数据内容包括代币简称、代币名称、代币发行者、总供应量、锁仓标识等信息; 账户(account)数据内容包括账户名、账户的代币类型、冻结标识、余额等信息。 代币发行方可以发行代币、增发代币、回收代币、锁仓、冻结账户; 用户可以将代币转账从自己的账户给别人的账户。 3. 数据结构 token的key为: TokenSymbol token的value结构为: type Token struct { TokenSymbol string `json:"TokenSymbol"` TokenName string `json:"TokenName"` Owner string `json:"Owner"` TotalSupply int64 `json:"TotalSupply"` Lock bool `json:"Lock"` } account采用复合key的结构,包含账户名、代币信息,这样每种代币就有了单独的账户体系: accountKey , err := stub . CreateCompositeKey (

Error in running byfn: failed to endorse chaincode install, rpc error code unavailable

妖精的绣舞 提交于 2020-04-16 20:57:30
问题 I am on CentOS 7, installed all prerequisites, cloned the fabric-samples git repository. I am referring to the tutorial "Building Your First Network", found here. At this point I have successfully run the command ./byfn.sh generate Now I want to execute the Java chaincode, so I run ./byfn.sh up -l java Right after the START sign, I see the following output: Build your first network (BYFN) end-to-end test + peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts