hyperledger

技术工坊|初学者如何正确理解并掌握区块链共识算法?(上海)

試著忘記壹切 提交于 2019-12-06 09:42:22
什么是区块链?回归本质来说,区块链是一种分布式数据存储的方法,这种技术特性带来了不可篡改的好处,区块链是一个去中心化系统,为了保证在去中心环境中所有参与的节点的行为与状态保持一致,就需要引入“共识”。 可以说,离开了共识算法,区块链就无法保证各区块数据的统一和真实性。初学者想要学习区块链开发,共识算法是必须掌握的一项基础技能。 在传统的分布式数据库中,也有一些共识算法,如:raft、paxos,这与区块链技术的共识算法有什么不同?区块链共识算法有哪些分类?这些问题,我们将在这次技术工坊中解决。 1 时间地点 **时间:**9月26日 18:30 - 21:00 地点 :(上海徐汇)上海市市辖区徐汇区龙华中路596号A308室 线下分享+交流 9.8元/人 参会人员要求: 1) 技术背景人员,对区块链开发有兴趣; 2) 活动限额15人,报满截止; 3) 自带电脑 4)到场参会者,随机筛选一位赠送《区块链开发实战:Hyperledger Fabric 关键技术与案例分析》和《区块链开发实战:以太坊关键技术与案例分析》书籍一套 2 活动流程 18:30-19:30 签到,自我介绍 19:30-20:30 区块链的共识算法 20:30-21:00 嘉宾互动 3 分享主题及嘉宾 分享主题:区块链中的共识算法 分享简介 :区块链中是一个去中心化系统

区块链开源实现hyperledger fabric架构详解

白昼怎懂夜的黑 提交于 2019-12-06 08:44:11
hyperledger fabric是区块链中联盟链的优秀实现,主要代码由IBM、Intel、各大银行等贡献,目前v1.1版的kafka共识方式可达到1000/s次的吞吐量。本文中我们依次讨论:区块链的共通特性、fabric核心概念、fabric的交易执行流程。本文来源于笔者欲对公司部分业务上链而进行培训的PPT,故图多文字少,不要怕太长。 1、区块链解决方案的特性 1.1 分布式帐本 区块链核心概念是分布式帐本,就像下面的图1所示,同样的帐本(全量的交易数据,详见下节)在任意一台节点(不包括客户端)上都有。所以,其优点是数据很难造假,造假后也可以通过追溯记录来追究法律责任。而缺点就是极大的浪费,传统服务每份数据都尽量少存几份,即使存了三份拷贝都已经考虑到诸多异常,并使服务可用性达到N个9了。而区块链这种特性,同时造成的另一个问题是帐本不能太大,至少不能超过区块链网络中最小结点的存储以及处理能力。所以,这制约了总交易数据(下文为方便概念介绍,统称为帐本ledger)的条数,进而也影响了能写入区块链的单条交易数据的大小。 图1 区块链分布式帐本示意图 什么是区块链呢?我很喜欢《区块链技术进阶与实战》一书中对它的定义:区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构。如果觉得有点抽象,那么我们再来看看下面的图2。 图2-区块链数据结构示意 图2中就是账本

Cannot put state in query context

◇◆丶佛笑我妖孽 提交于 2019-12-06 07:24:21
Im trying to use a ticker in my chaincode to update the chaincode state periodically, based on some condition: func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) { ticker := time.NewTicker(time.Millisecond * 10000) go func() { for t := range ticker.C { fmt.Println("Tick at", t) a = a+5 err:= stub.PutState("a", []byte(strconv.Itoa(a))) fmt.Println(err.Error()) } }() return nil, nil } I am sending the invoke transaction using the chaincode REST api for invoke : POST http://<ip>:<port>/chaincode { "jsonrpc": "2.0", "method": "invoke",

ERRO 003 Error trying to connect to local peer: context deadline exceeded

血红的双手。 提交于 2019-12-06 06:59:15
问题 Following my previous question. I'm still trying to make the tutorial "Chaincode for Developers" work. It still does not work : Terminal 2 - Build & start the chaincode, getting this error when running chaincode : userChaincodeStreamGetter -> ERRO 003 Error trying to connect to local peer: context deadline exceeded 回答1: After coming across this issue, I checked which ports which were being used by "peer", and was surprised to see that the port in question, 7052, was not listed as a peer node

Hyperledger Fabric How to set up Auditor in non-permission Network and permission network

China☆狼群 提交于 2019-12-06 05:43:56
I've been working around hyperledger fabric for a while. I'm successful in install and form network of Fabric without using docker with 5 peers. Now I try to Setup Auditor and non-validationg peers within the network. I surf around ,but cannot find any clear document in this. Can anyone help? The notion of a validating peer is no longer existent in Hyperledger Fabric v1.x architecture(s). Every peer node is both a validating and committing peer; the distinction is between the roles of committing and endorsing. Endorsing peers will actually have chaincode installed on their filesystems and they

Can a World State variable be accessed by a chaincode different from the one that deployed it?

对着背影说爱祢 提交于 2019-12-06 04:46:45
If a chaincode A stores a variable V to the World State can this variable V be accessed by another chaincode B? In other words, are variables in the World State access protected? If it is not possible, how can I make chaincode B read the variables from chaincode A (I need it for my use case)? No, variables stored by some chaincode A can only be accessed by the same chaincode A. So if a chaincode B tries to access the variable V, access will be denied. If you wanted to access such variables (because your use case requires interconnection between chaincodes) you can invoke/query chaincode A from

Privacy on Hyperledger Fabric v1.0

夙愿已清 提交于 2019-12-06 04:41:32
问题 Can you explain some mechanisms of privacy in Hyperledger Fabric v1.0 - those already implemented and those planned to be implemented in the future? I understand channels are like seperate blockchains. I also went through the document on https://jira.hyperledger.org/browse/FAB-1151, where I have found two more mechanisms: one is private data, and other is encryption. Can you explain what would be the beast approach to use in the following scenario. Each car needs car insurance. Let's say the

Fabric-Sample: Cannot create ledger from genesis block, due to LedgerID already exists

安稳与你 提交于 2019-12-06 03:49:49
问题 I am trying out the fabric-samples balance-transfer example, I tried to create a new channel with the below commands. The channel gets created but when I try to join the peer to the channel I get the below error. Can anyone suggest the step I am missing or going wrong [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Cannot create ledger from genesis block, due to LedgerID already exists) Command I used to create a new channel Config

Cryptocurrency based on Hyperledger

血红的双手。 提交于 2019-12-06 03:44:24
问题 Does Hyperledger Fabric support possibility to create a cryptocurrency like well know Bitcoin/Ethereum? I don't mean tokens which I can implement by chaincode. 回答1: You can implement any business logic by using Hyperledger Fabric chaincode, which essentially a simple program. Chaincode manages ledger state by operation on transactions submitted by application and ensure to have it consistent across network peers. Hyperledger Fabric currently supports chaincodes written in Go, while in a

Read (query) transaction flow in Hyperledger Fabric

不羁岁月 提交于 2019-12-06 03:16:16
问题 I am trying to understand the "Query" transaction flow in Hyperledger Fabric. I understand the "write" flow in Fabric as it is well documented. However, things are not so clear when a read/query transaction is involved. This is what I have understood so far: A client using an SDK prepares a transaction proposal for querying a chaincode. The proposal is transmitted via a committing peer to the Endorsing peers which validate as well as simulate the transaction in their end. Assuming everything