Fabric v1 Transaction Lifecycle
1 Client application creates tran proposeal (chinacode function and arguments) and sends to endorsing peer(s).
2 Endorsing peer executes chinacode,generates ReadWriteSet based on keys that were read and written.
3 Endorsing peer(s) send back proposal response(including ReadWriteSet) to client application
4 Client application may or may not submit as a transaction to ordering service.Transaction includes ReadWriteSet from proposal response
5 If client application submitted as transaction,ordering service packages the transaction into a block of ordered transactions.
6 Blocks are delivered to committing peers(including the original endorsing peers).
7 Committing peer
-runs validation logic(VSCC to check endorsement policy,and MVCC to check that ReadSet versions haven‘t changed in State DB since simulation time)
-indicates in block which trans are valid and invalid.
-commits block to blockchina on file system,and commits valid transactions within block to state database ‘atomically‘
-fires events so that application client listening via SDK knows which transactions were valid/invalid
1 、客户端应用 创建一个交易标的(链码方法和参数) 并且发送到认证节点;
2、 认证节点执行链码,生成基于密钥的读写设置操作。
3、 认证节点返回标的信息(包括读写设置)给客户端,
4、 客户端可以采取 提交或者不提交交易到订阅服务。交易信息包括 从上述返回答复的读写设置。
5、如果客户端提交了交易,订阅服务将交易包装成一个交易块。
6、将快传递给提交者节点(包括原始认证节点)。
7、提交节点
-运行校验逻辑(VSSCC 校验认可担保协议,MVCC去校验读写版本时还没有改变区域数据库直到模拟时间)
-指示那些块是有效还是无效
-提交块到区块链的文件系统,提交有效的交易到块里从而自动改变数据库
-触发事件,以便应用程序侦听器通过SDK知道哪些事务是有效的/无效的