日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

跨链Cosmos(5)ABCI 接口

發(fā)布時(shí)間:2025/3/21 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 跨链Cosmos(5)ABCI 接口 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一個(gè)協(xié)議,支持任何語(yǔ)言的交易處理實(shí)現(xiàn)

1. 應(yīng)用層實(shí)現(xiàn)交互的接口

// Application is an interface that enables any finite, deterministic state machine // to be driven by a blockchain-based replication engine via the ABCI. // All methods take a RequestXxx argument and return a ResponseXxx argument, // except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. type Application interface {// Info/Query ConnectionInfo(RequestInfo) ResponseInfo // Return application infoQuery(RequestQuery) ResponseQuery // Query for state// Mempool ConnectionCheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool// Consensus ConnectionInitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from TendermintCoreBeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a blockDeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processingEndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator setCommit() ResponseCommit // Commit the state and return the application Merkle root hash// State Sync ConnectionListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshotsOfferSnapshot(RequestOfferSnapshot) ResponseOfferSnapshot // Offer a snapshot to the applicationLoadSnapshotChunk(RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk // Load a snapshot chunkApplySnapshotChunk(RequestApplySnapshotChunk) ResponseApplySnapshotChunk // Apply a shapshot chunk }
  • Consensus Connection: InitChain, BeginBlock, DeliverTx, EndBlock,

  • CommitMempool Connection: CheckTxInfo

  • Connection: Info, SetOption, Query

proto定義位于 https://github.com/tendermint/abci/blob/master/types/types.proto

2. 一個(gè)應(yīng)用程序可以有3個(gè) ABCI 套接字連接

對(duì)應(yīng)3個(gè)消息:

  • CheckTx消息
    在內(nèi)存池中廣播時(shí)驗(yàn)證交易,用于驗(yàn)證交易。Tendermint Core中的mempool通過(guò)此消息校驗(yàn)交易的合法性,通過(guò)之后才會(huì)將交易廣播給其它節(jié)點(diǎn)。
  • DeliverTx消息
    應(yīng)用的主要工作流程,通過(guò)此消息真正執(zhí)行交易,包括驗(yàn)證交易、更新應(yīng)用程序的狀態(tài)。
  • Commit消息
    通知應(yīng)用程序計(jì)算當(dāng)前的世界狀態(tài),并存在下一區(qū)塊頭中

總結(jié)

以上是生活随笔為你收集整理的跨链Cosmos(5)ABCI 接口的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。