![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIn5GcuMmMkdDZ2UmNwY2YiVjN4YWYyIGNmhzM4kTM2cTZ1ATZfdWbp9CXt92Yu4GZjlGbh5SZslmZxl3Lc9CX6MHc0RHaiojIsJye.png)
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知道哪些事務是有效的/無效的