一个协议,支持任何语言的交易处理实现

1. 应用层实现交互的接口

// 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. 一个应用程序可以有3个 ABCI 套接字连接

对应3个消息:

  • CheckTx消息
    在内存池中广播时验证交易,用于验证交易。Tendermint Core中的mempool通过此消息校验交易的合法性,通过之后才会将交易广播给其它节点。
  • DeliverTx消息
    应用的主要工作流程,通过此消息真正执行交易,包括验证交易、更新应用程序的状态。
  • Commit消息
    通知应用程序计算当前的世界状态,并存在下一区块头中

跨链Cosmos(5)ABCI 接口相关推荐

  1. 跨链Cosmos(10) IBC接口

    1. 子模块 1.1 IBCRegisterChainTx 注册 在跨链开始用来注册,并发送创世区块,Validator 给对方,这个只能执行一次,多次执行会报错. type IBCRegisterC ...

  2. 跨链Cosmos(6)ABCI 原理

    1. module 2. x/auth:用于管理账户和签名. x/bank:用于启用令牌和令牌传输. x/staking+ x/slashing:用于构建权益证明区块链. 3. Server服务器端 ...

  3. 跨链Cosmos(12) Cosmos插件

    Tendermint 有一个插件模块,我们可以实现 plugin 中接口,在 ibc 插件中执行跨链交易. 1. plugin 接口的定义 //与 abci 接口很类似 type Plugin int ...

  4. 跨链Cosmos(3)IBC协议

    1. (Inter-Blockchain Communication Protocol)IBC定义 IBC协议用于Hub与Zone之间消息传递. 通过数据包交换在多个不同的区块链网络之间转移数据和状态 ...

  5. 跨链Cosmos(11) 消息结构

    1. 普通交易Msg Cosmos的普通交易和以太坊类似,也是一个帐户模型,有着From,To和Amount关键字段. type MsgSend struct { FromAddress github ...

  6. 跨链Cosmos(2) Cosmos系统框架

    1. Cosmos 系统 = Tendermint Core + Cosmos SDK Cosmos是tendermint团队推出的一个支持跨链交互的异构网络, 一个分布式的独立并行区块链公链. 1. ...

  7. 跨链Cosmos(1) 网络拓扑

    1. 拓扑结构 Hub: 用于处理跨链交互的中继链 Zone: 平行链 Cosmos Hub中心 代币可以安全快速地从一个Zone传递到另一个Zone,两者之间无需体现汇兑流动性. Zone内部所有代 ...

  8. 跨链Cosmos(3)IBC协议二

    1. IBC协议中设计了两个消息: IBCBlockCommitTx 发送方所在区块链的最新的区块信息. IBCPacketTx 跨链交易本身的信息,及其在发送方链中被打包的区块信息. 两个链建立连接 ...

  9. 跨链Cosmos(9)异构跨链交易流程

    当应用链双方在Hub注册后,彼此发现就可以通过路由进行跨链交易. 1.1 IBC跨链流程 ChainA和ChainB都是基于CosmosSDK搭建的应用链,Relayer作为一个链下中继负责轮询和路由 ...

最新文章

  1. 来自新手Banana Pi香蕉派初体验
  2. android -support-v4.jar是什么文件
  3. mysql学习-初识mysql
  4. 2.3 KNN-采用机器学习库来预测鸢尾花的分类
  5. 微信小程序使用阿里图标
  6. Android Gradle和Gradle插件区别
  7. 三分钟教你用 Scarlet 写一个 WebSocket App
  8. 织梦缩略图自动补齐绝对路径_织梦生成文章内容缩略图时自动加上域名绝对路径...
  9. php检测表大小,查询mysql数据库、表的大小
  10. linux ssh 双机互信
  11. tasklist 结束进程_netstat -ano,ntsd;tasklist,tskill-查看杀死进程命令 | 学步园
  12. PLSQL 使用技巧(快捷键/关键字等)
  13. UPDATE更新数据库数据详解
  14. JAVA-MYSQL-SSH酒店民宿客房管理系统
  15. Android技巧之相对高度使用
  16. 文昌京东配送小哥的那些骄傲事
  17. windbg常用命令
  18. Open3d 获取渲染和固定视角json文件及读入
  19. 脉冲多普勒雷达设计附matlab代码
  20. 韩媒看中国量子计算机,韩媒:量子计算机原本是欧美在玩中国却令人吃惊

热门文章

  1. Java:自定义异常处理类
  2. vue项目-点击添加或者修改按钮浏览器的屏幕变黑,再次点击屏幕之后浏览器恢复正常(火狐浏览器、ChromeCoreLauncher双核浏览器)
  3. jQuery 对象及伪数组
  4. oracle命令格式,OraCmD(Oracle命令行工具) V3.1 官方版
  5. python add argument list_python模块介绍- argparse:命令行选项及参数解析
  6. android 酷狗demo_Android仿酷狗旋转界面功能-自定义控件实现
  7. DL之RNN:基于RNN实现模仿贴吧留言
  8. TF之BN:BN算法对多层中的每层神经网络加快学习QuadraticFunction_InputData+Histogram+BN的Error_curve
  9. 互联网大厂高频重点面试题
  10. 自定义获取url方法