hyperledger

企业以太坊Besu入门教程【原Pantheon】

此生再无相见时 提交于 2020-02-27 12:20:38
Besu是Hyperledger中的企业以太坊产品,其最大优势在于兼容以太坊主网。本教程介绍如何使用Hyperledger Besu快速启动一个企业以太坊网络并利用JSON RPC进行数据查询和交易提交,以及如何使用Truffle开发企业以太坊DApp并使用内置的工具进行数据调试和运维监控。 1、启动企业以太坊网络 以太坊教程推荐: Dapp入门 | 电商Dapp实战 | Token实战 | Php对接 | Java对接 | Python对接 | C#对接 | Dart对接 首先克隆Besu的quickstart仓库的源代码: git clone https://github.com/PegaSysEng/besu-quickstart.git 然后进入besu-quickstart目录,执行如下命令构建besu的docker镜像: ./run.sh 上面的命令会构建docker镜像并启动4个容器来模拟一个包含6个besu节点的企业以太坊网络。当脚本执行完成后,你可以看到如下输出信息: ************************************* Besu Quickstart <version> ************************************* List endpoints and services --------------------

HyperLedger链码开发实例 —Commercial Paper

六眼飞鱼酱① 提交于 2020-02-26 23:24:24
链码开发---商业债券Commercial Paper 启动测试网络 cd fabric-samples/commercial-paper ./network-starter.sh docker -ps 将用于查看本地计算机上运行的Fabric节点 docker newtwork inspect net_test 用来查看网络 扮演磁力公司的角色 cd fabric-samples/commercial-paper/organization/magnetocorp 使用磁力公司下属的 monitoedocker.sh net_test <port_number> 来启动 logspout , 并使用它监视与 net_baisc 网络关联的docker容器. 检查智能合约 const { Contract , Context } = require ( 'fabric-contract-api' ) class CommercialPaperContract extends Contract { } async issue ( ctx , issuer , paperNumber , issueDateTime , maturityDateTime ) let paper = CommercialPaper . . createInstance ( issuer ,

Fabric 2.0链码操作分步解析

霸气de小男生 提交于 2020-02-26 12:58:39
Hyperledger Fabric 2.0最近已经发布,其中最引人关注的一点是链码操作。官方文档虽然对此提供了详细的说明,但本文将通过与Hyperledger Fabric前一个版本中链码操作的对比,来帮助你更好的理解新版本中链码操作的不同之处以及幕后的一些技术细节。 Hyperledger Fabric区块链开发教程: Node.js | Java | Golang 1、链码操作:Fabric 1.4 vs Fabric 2.0 我们将首先快速介绍在HF 1.4和HF 2.0中的整个链码操作过程。 链码操作指的是在Hyperledger fabric网络通道上部署链码的操作,这样区块链之外的应用可以调用或查询链码方法。在链码开发完成并测试后,首先需要将Fabric链码安装到指定的peer节点。在这个阶段链码还不能使用,直到链码被提交(Fabric 2.0中的术语)到通道中或在通道上实例化(Fabric 1.4中的术语),这样链码就可以被授权用户访问了。 下面是两个版本的Hyperledger Fabric中链码操作流程的对比图: 在Hyperledger Fabric 1.4中,链码操作过程包含以下步骤:打包、安装、实例化。如果链码属于多个参与方,那么就需要打包这一环节。如果不存在多方属主的问题,那么直接安装链码就可以(其中隐含了打包环节)

Chaincode的开发环境和Hello world

倾然丶 夕夏残阳落幕 提交于 2020-02-26 01:55:47
Chaincode的开发环境和Hello world 使用GO lang对Chaincode进行开发 # 安装Golang的SDK go get github.com/hyperledger/fabric-sdk-go # 安装shim包 go get -u github.com/hyperledger/fabric/core/chaincode/shim ​ 启动链码必须通过调用shim包中的Start函数实现,而Start函数被调用时需要传递一个类型为Chaincode的参数,这个Chaincode参数是一个接口类型,该接口中有两个重要的函数——Init和Invoke。 type Chaincode interface{ Init(stub ChaincodeStubInterface) peer.Response Invoke(stub ChaincodeStubInterface) peer.Response } Init: 在链码实例化或升级时被调用,完成初始化数据的工作。 Invoke: 在更新或查询提案事务中的分类账本数据状态时被调用,因此响应调用或查询的业务实现逻辑都需要在此函数中编写实现。 在实际开发中,开发人员可以自行定义一个结构体,然后重写Chaincode接口的两个函数,并将两个函数指定为自定义结构体的成员方法 必要结构 package main //

peers not joining channel and error with TLS connection (IP SANs error)

ぐ巨炮叔叔 提交于 2020-02-24 12:16:59
问题 I was trying below architecture in fabric where one peer is on another machine rest of the network set up in first machine(server/system), after creating channel while adding each peer to the channel shows a log as below which was not the case when i tried sample network, the log used to say peer joined to channel, also when i check the logs of peer it says : 2018-02-28 06:51:23.916 UTC [ConnProducer] NewConnection -> ERRO 36b Failed connecting to 138.68.138.161:7050 , error: x509: cannot

Hyperledger Fabric cryptographic material confusion

旧时模样 提交于 2020-02-22 06:23:05
问题 Background I have some difficulties in understanding the generation of cryptographic materials in Hyperledger Fabric. I noticed there is a similar question, Hyperledger fabric Crypto materials, and I have asked this question Questions on hyperledger fabric MSP setting before. but I still have lots of confusion. I followed the example, Building Your First Network, I noticed that using cryptogen tool and consume that crypto-config.yaml . It generates the keys and certs for the orderers and

十一、区块链学习-Hyperledger Fabric (基于release-1.0) 链码开发-marbles管理

天涯浪子 提交于 2020-02-19 02:55:06
链码开发-marbles管理 1. 概述 2. marble弹珠管理 2.1实现功能 2.2chaincode链码 2.3编写测试类 2.4 跑测试类 3 搭建本地测试环境 并测试链码 3.1 挂载链码 3.2 启动网络环境 3.3 进入chaincode容器编译链码 提供链码服务 3.4 进入cli容器 安装链码 实例化链码 3.5 测试链码 4 关闭网络 1. 概述 根据前面十篇文章的介绍,基本已经了解了fabric的网络环境和链码开发 部署 调试的过程。这一篇文章,再次巩固链码开发以及部署调用调试。 2. marble弹珠管理 marble // 声明弹珠结构体 type Marble struct { // 对象类型 ObjectType string `json:"objectType"` // 弹珠名称 Name string `json:"name"` // 弹珠颜色 Color string `json:"color"` // 弹珠大小 Size int `json:"size"` // 弹珠拥有者 Owner string `json:"owner"` } 2.1实现功能 弹珠创建 弹珠查询 弹珠删除 弹珠交易 弹珠操作历史查询 查询某个用户的弹珠列表 2.2chaincode链码 markbels.go package main // 引入依赖包 import

Cryptographic material inside crypto-config folder

浪子不回头ぞ 提交于 2020-02-16 06:51:52
问题 I found similar questions here : Hyperledger fabric Crypto materials Hyperledger Fabric cryptographic material confusion I was not able to find a clear defination for all the material? and when is the material used - as in for what operations are a particular material used ? It would be great if someone could explain the entire folder tree 回答1: Here is the link to my naive approach of building a tree for the sole purpose of an explanation of the MSP structure. Certificates with the same

How to upload image on hyperledger composer playground?

Deadly 提交于 2020-02-06 17:10:58
问题 I am trying to build a Block chain application for distributed image sharing and copyright protection. I am using image as an asset. So now I want to upload an image on Hyper ledger Composer playground. How can I do that? 回答1: You can store your file data into the IPFS. IPFS is a protocol and network designed to create a content-addressable, peer-to-peer method of storing and sharing hypermedia in a distributed file system. For IPFS I recommend you to follow the link In your application, In

How to upload image on hyperledger composer playground?

我与影子孤独终老i 提交于 2020-02-06 17:10:54
问题 I am trying to build a Block chain application for distributed image sharing and copyright protection. I am using image as an asset. So now I want to upload an image on Hyper ledger Composer playground. How can I do that? 回答1: You can store your file data into the IPFS. IPFS is a protocol and network designed to create a content-addressable, peer-to-peer method of storing and sharing hypermedia in a distributed file system. For IPFS I recommend you to follow the link In your application, In