You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1382 lines
36 KiB

  1. ---
  2. order: 1
  3. parent:
  4. title: RPC
  5. order: 6
  6. ---
  7. # RPC spec
  8. This file defines the JSON-RPC spec of Tendermint. This is meant to be implemented by all clients.
  9. ## Support
  10. | | [Tendermint-Go](https://github.com/tendermint/tendermint/) | [Tendermint-Rs](https://github.com/informalsystems/tendermint-rs) |
  11. |--------------|:-----------------------------------------------------------:|:-----------------------------------------------------------------:|
  12. | JSON-RPC 2.0 | ✅ | ✅ |
  13. | HTTP | ✅ | ✅ |
  14. | HTTPS | ✅ | ❌ |
  15. | WS | ✅ | ✅ |
  16. | Routes | [Tendermint-Go](https://github.com/tendermint/tendermint/) | [Tendermint-Rs](https://github.com/informalsystems/tendermint-rs) |
  17. |-----------------------------------------|:----------------------------------------------------------:|:-----------------------------------------------------------------:|
  18. | [Health](#health) | ✅ | ✅ |
  19. | [Status](#status) | ✅ | ✅ |
  20. | [NetInfo](#netinfo) | ✅ | ✅ |
  21. | [Blockchain](#blockchain) | ✅ | ✅ |
  22. | [Header](#header) | ✅ | ❌ |
  23. | [HeaderByHash](#headerbyhash) | ✅ | ❌ |
  24. | [Block](#block) | ✅ | ✅ |
  25. | [BlockByHash](#blockbyhash) | ✅ | ❌ |
  26. | [BlockResults](#blockresults) | ✅ | ✅ |
  27. | [Commit](#commit) | ✅ | ✅ |
  28. | [Validators](#validators) | ✅ | ✅ |
  29. | [Genesis](#genesis) | ✅ | ✅ |
  30. | [GenesisChunked](#genesischunked) | ✅ | ❌ |
  31. | [ConsensusParams](#consensusparams) | ✅ | ❌ |
  32. | [UnconfirmedTxs](#unconfirmedtxs) | ✅ | ❌ |
  33. | [NumUnconfirmedTxs](#numunconfirmedtxs) | ✅ | ❌ |
  34. | [Tx](#tx) | ✅ | ❌ |
  35. | [BroadCastTxSync](#broadcasttxsync) | ✅ | ✅ |
  36. | [BroadCastTxAsync](#broadcasttxasync) | ✅ | ✅ |
  37. | [ABCIInfo](#abciinfo) | ✅ | ✅ |
  38. | [ABCIQuery](#abciquery) | ✅ | ✅ |
  39. | [BroadcastTxAsync](#broadcasttxasync) | ✅ | ✅ |
  40. | [BroadcastEvidence](#broadcastevidence) | ✅ | ✅ |
  41. ## Timestamps
  42. Timestamps in the RPC layer of Tendermint follows RFC3339Nano. The RFC3339Nano format removes trailing zeros from the seconds field.
  43. This means if a block has a timestamp like: `1985-04-12T23:20:50.5200000Z`, the value returned in the RPC will be `1985-04-12T23:20:50.52Z`.
  44. ## Info Routes
  45. ### Health
  46. Node heartbeat
  47. #### Parameters
  48. None
  49. #### Request
  50. ##### HTTP
  51. ```sh
  52. curl http://127.0.0.1:26657/health
  53. ```
  54. ##### JSONRPC
  55. ```sh
  56. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"health\"}"
  57. ```
  58. #### Response
  59. ```json
  60. {
  61. "jsonrpc": "2.0",
  62. "id": -1,
  63. "result": {}
  64. }
  65. ```
  66. ### Status
  67. Get Tendermint status including node info, pubkey, latest block hash, app hash, block height and time.
  68. #### Parameters
  69. None
  70. #### Request
  71. ##### HTTP
  72. ```sh
  73. curl http://127.0.0.1:26657/status
  74. ```
  75. ##### JSONRPC
  76. ```sh
  77. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"status\"}"
  78. ```
  79. #### Response
  80. ```json
  81. {
  82. "jsonrpc": "2.0",
  83. "id": -1,
  84. "result": {
  85. "node_info": {
  86. "protocol_version": {
  87. "p2p": "8",
  88. "block": "11",
  89. "app": "0"
  90. },
  91. "id": "b93270b358a72a2db30089f3856475bb1f918d6d",
  92. "listen_addr": "tcp://0.0.0.0:26656",
  93. "network": "cosmoshub-4",
  94. "version": "v0.34.8",
  95. "channels": "40202122233038606100",
  96. "moniker": "aib-hub-node",
  97. "other": {
  98. "tx_index": "on",
  99. "rpc_address": "tcp://0.0.0.0:26657"
  100. }
  101. },
  102. "sync_info": {
  103. "latest_block_hash": "50F03C0EAACA8BCA7F9C14189ACE9C05A9A1BBB5268DB63DC6A3C848D1ECFD27",
  104. "latest_app_hash": "2316CFF7644219F4F15BEE456435F280E2B38955EEA6D4617CCB6D7ABF781C22",
  105. "latest_block_height": "5622165",
  106. "latest_block_time": "2021-03-25T14:00:43.356134226Z",
  107. "earliest_block_hash": "1455A0C15AC49BB506992EC85A3CD4D32367E53A087689815E01A524231C3ADF",
  108. "earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
  109. "earliest_block_height": "5200791",
  110. "earliest_block_time": "2019-12-11T16:11:34Z",
  111. "catching_up": false
  112. },
  113. "validator_info": {
  114. "address": "38FB765D0092470989360ECA1C89CD06C2C1583C",
  115. "pub_key": {
  116. "type": "tendermint/PubKeyEd25519",
  117. "value": "Z+8kntVegi1sQiWLYwFSVLNWqdAUGEy7lskL78gxLZI="
  118. },
  119. "voting_power": "0"
  120. }
  121. }
  122. }
  123. ```
  124. ### NetInfo
  125. Network information
  126. #### Parameters
  127. None
  128. #### Request
  129. ##### HTTP
  130. ```sh
  131. curl http://127.0.0.1:26657/net_info
  132. ```
  133. ##### JSONRPC
  134. ```sh
  135. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"net_info\"}"
  136. ```
  137. #### Response
  138. ```json
  139. {
  140. "id": 0,
  141. "jsonrpc": "2.0",
  142. "result": {
  143. "listening": true,
  144. "listeners": [
  145. "Listener(@)"
  146. ],
  147. "n_peers": "1",
  148. "peers": [
  149. {
  150. "node_id": "5576458aef205977e18fd50b274e9b5d9014525a",
  151. "url": "tcp://5576458aef205977e18fd50b274e9b5d9014525a@95.179.155.35:26656"
  152. }
  153. ]
  154. }
  155. }
  156. ```
  157. ### Blockchain
  158. Get block headers. Returned in descending order. May be limited in quantity.
  159. #### Parameters
  160. - `minHeight (integer)`: The lowest block to be returned in the response
  161. - `maxHeight (integer)`: The highest block to be returned in the response
  162. #### Request
  163. ##### HTTP
  164. ```sh
  165. curl http://127.0.0.1:26657/blockchain
  166. curl http://127.0.0.1:26657/blockchain?minHeight=1&maxHeight=2
  167. ```
  168. ##### JSONRPC
  169. ```sh
  170. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"blockchain\",\"params\":{\"minHeight\":\"1\", \"maxHeight\":\"2\"}}"
  171. ```
  172. #### Response
  173. ```json
  174. {
  175. "id": 0,
  176. "jsonrpc": "2.0",
  177. "result": {
  178. "last_height": "1276718",
  179. "block_metas": [
  180. {
  181. "block_id": {
  182. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  183. "parts": {
  184. "total": 1,
  185. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  186. }
  187. },
  188. "block_size": 1000000,
  189. "header": {
  190. "version": {
  191. "block": "10",
  192. "app": "0"
  193. },
  194. "chain_id": "cosmoshub-2",
  195. "height": "12",
  196. "time": "2019-04-22T17:01:51.701356223Z",
  197. "last_block_id": {
  198. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  199. "parts": {
  200. "total": 1,
  201. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  202. }
  203. },
  204. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  205. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  206. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  207. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  208. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  209. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  210. "last_results_hash": "",
  211. "evidence_hash": "",
  212. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  213. },
  214. "num_txs": "54"
  215. }
  216. ]
  217. }
  218. }
  219. ```
  220. ### Header
  221. Get a header at a specified height.
  222. #### Parameters
  223. - `height (integer)`: height of the requested header. If no height is specified the latest height will be used.
  224. #### Request
  225. ##### HTTP
  226. ```sh
  227. curl http://127.0.0.1:26657/header
  228. curl http://127.0.0.1:26657/header?height=1
  229. ```
  230. ##### JSONRPC
  231. ```sh
  232. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"header\",\"params\":{\"height\":\"1\"}}"
  233. ```
  234. #### Response
  235. ```json
  236. {
  237. "id": 0,
  238. "jsonrpc": "2.0",
  239. "result": {
  240. "header": {
  241. "version": {
  242. "block": "10",
  243. "app": "0"
  244. },
  245. "chain_id": "cosmoshub-2",
  246. "height": "12",
  247. "time": "2019-04-22T17:01:51.701356223Z",
  248. "last_block_id": {
  249. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  250. "parts": {
  251. "total": 1,
  252. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  253. }
  254. },
  255. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  256. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  257. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  258. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  259. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  260. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  261. "last_results_hash": "",
  262. "evidence_hash": "",
  263. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  264. }
  265. }
  266. }
  267. ```
  268. ### HeaderByHash
  269. #### Parameters
  270. - `hash (string)`: Hash of the header to query for.
  271. #### Request
  272. ##### HTTP
  273. ```sh
  274. curl http://127.0.0.1:26657/header_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED
  275. ```
  276. ##### JSONRPC
  277. ```sh
  278. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"header_by_hash\",\"params\":{\"hash\":\"0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED\"}}"
  279. ```
  280. #### Response
  281. ```json
  282. {
  283. "id": 0,
  284. "jsonrpc": "2.0",
  285. "result": {
  286. "header": {
  287. "version": {
  288. "block": "10",
  289. "app": "0"
  290. },
  291. "chain_id": "cosmoshub-2",
  292. "height": "12",
  293. "time": "2019-04-22T17:01:51.701356223Z",
  294. "last_block_id": {
  295. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  296. "parts": {
  297. "total": 1,
  298. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  299. }
  300. },
  301. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  302. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  303. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  304. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  305. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  306. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  307. "last_results_hash": "",
  308. "evidence_hash": "",
  309. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  310. }
  311. }
  312. }
  313. }
  314. ```
  315. ### Block
  316. Get block at a specified height.
  317. #### Parameters
  318. - `height (integer)`: height of the requested block. If no height is specified the latest height will be used.
  319. #### Request
  320. ##### HTTP
  321. ```sh
  322. curl http://127.0.0.1:26657/block
  323. curl http://127.0.0.1:26657/block?height=1
  324. ```
  325. ##### JSONRPC
  326. ```sh
  327. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"block\",\"params\":{\"height\":\"1\"}}"
  328. ```
  329. #### Response
  330. ```json
  331. {
  332. "id": 0,
  333. "jsonrpc": "2.0",
  334. "result": {
  335. "block_id": {
  336. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  337. "parts": {
  338. "total": 1,
  339. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  340. }
  341. },
  342. "block": {
  343. "header": {
  344. "version": {
  345. "block": "10",
  346. "app": "0"
  347. },
  348. "chain_id": "cosmoshub-2",
  349. "height": "12",
  350. "time": "2019-04-22T17:01:51.701356223Z",
  351. "last_block_id": {
  352. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  353. "parts": {
  354. "total": 1,
  355. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  356. }
  357. },
  358. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  359. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  360. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  361. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  362. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  363. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  364. "last_results_hash": "",
  365. "evidence_hash": "",
  366. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  367. },
  368. "data": [
  369. "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0="
  370. ],
  371. "evidence": [
  372. {
  373. "type": "string",
  374. "height": 0,
  375. "time": 0,
  376. "total_voting_power": 0,
  377. "validator": {
  378. "pub_key": {
  379. "type": "tendermint/PubKeyEd25519",
  380. "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
  381. },
  382. "voting_power": 0,
  383. "address": "string"
  384. }
  385. }
  386. ],
  387. "last_commit": {
  388. "height": 0,
  389. "round": 0,
  390. "block_id": {
  391. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  392. "parts": {
  393. "total": 1,
  394. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  395. }
  396. },
  397. "signatures": [
  398. {
  399. "type": 2,
  400. "height": "1262085",
  401. "round": 0,
  402. "block_id": {
  403. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  404. "parts": {
  405. "total": 1,
  406. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  407. }
  408. },
  409. "timestamp": "2019-08-01T11:39:38.867269833Z",
  410. "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F",
  411. "validator_index": 0,
  412. "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg=="
  413. }
  414. ]
  415. }
  416. }
  417. }
  418. }
  419. ```
  420. ### BlockByHash
  421. #### Parameters
  422. - `hash (string)`: Hash of the block to query for.
  423. #### Request
  424. ##### HTTP
  425. ```sh
  426. curl http://127.0.0.1:26657/block_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED
  427. ```
  428. ##### JSONRPC
  429. ```sh
  430. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"block_by_hash\",\"params\":{\"hash\":\"0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED\"}}"
  431. ```
  432. #### Response
  433. ```json
  434. {
  435. "id": 0,
  436. "jsonrpc": "2.0",
  437. "result": {
  438. "block_id": {
  439. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  440. "parts": {
  441. "total": 1,
  442. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  443. }
  444. },
  445. "block": {
  446. "header": {
  447. "version": {
  448. "block": "10",
  449. "app": "0"
  450. },
  451. "chain_id": "cosmoshub-2",
  452. "height": "12",
  453. "time": "2019-04-22T17:01:51.701356223Z",
  454. "last_block_id": {
  455. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  456. "parts": {
  457. "total": 1,
  458. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  459. }
  460. },
  461. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  462. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  463. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  464. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  465. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  466. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  467. "last_results_hash": "",
  468. "evidence_hash": "",
  469. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  470. },
  471. "data": [
  472. "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0="
  473. ],
  474. "evidence": [
  475. {
  476. "type": "string",
  477. "height": 0,
  478. "time": 0,
  479. "total_voting_power": 0,
  480. "validator": {
  481. "pub_key": {
  482. "type": "tendermint/PubKeyEd25519",
  483. "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
  484. },
  485. "voting_power": 0,
  486. "address": "string"
  487. }
  488. }
  489. ],
  490. "last_commit": {
  491. "height": 0,
  492. "round": 0,
  493. "block_id": {
  494. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  495. "parts": {
  496. "total": 1,
  497. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  498. }
  499. },
  500. "signatures": [
  501. {
  502. "type": 2,
  503. "height": "1262085",
  504. "round": 0,
  505. "block_id": {
  506. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  507. "parts": {
  508. "total": 1,
  509. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  510. }
  511. },
  512. "timestamp": "2019-08-01T11:39:38.867269833Z",
  513. "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F",
  514. "validator_index": 0,
  515. "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg=="
  516. }
  517. ]
  518. }
  519. }
  520. }
  521. }
  522. ```
  523. ### BlockResults
  524. ### Parameters
  525. - `height (integer)`: Height of the block which contains the results. If no height is specified, the latest block height will be used
  526. #### Request
  527. ##### HTTP
  528. ```sh
  529. curl http://127.0.0.1:26657/block_results
  530. curl http://127.0.0.1:26657/block_results?height=1
  531. ```
  532. ##### JSONRPC
  533. ```sh
  534. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"block_results\",\"params\":{\"height\":\"1\"}}"
  535. ```
  536. #### Response
  537. ```json
  538. {
  539. "jsonrpc": "2.0",
  540. "id": 0,
  541. "result": {
  542. "height": "12",
  543. "total_gas_used": "100",
  544. "txs_results": [
  545. {
  546. "code": "0",
  547. "data": "",
  548. "log": "not enough gas",
  549. "info": "",
  550. "gas_wanted": "100",
  551. "gas_used": "100",
  552. "events": [
  553. {
  554. "type": "app",
  555. "attributes": [
  556. {
  557. "key": "YWN0aW9u",
  558. "value": "c2VuZA==",
  559. "index": false
  560. }
  561. ]
  562. }
  563. ],
  564. "codespace": "ibc"
  565. }
  566. ],
  567. "begin_block_events": [
  568. {
  569. "type": "app",
  570. "attributes": [
  571. {
  572. "key": "YWN0aW9u",
  573. "value": "c2VuZA==",
  574. "index": false
  575. }
  576. ]
  577. }
  578. ],
  579. "end_block": [
  580. {
  581. "type": "app",
  582. "attributes": [
  583. {
  584. "key": "YWN0aW9u",
  585. "value": "c2VuZA==",
  586. "index": false
  587. }
  588. ]
  589. }
  590. ],
  591. "validator_updates": [
  592. {
  593. "pub_key": {
  594. "type": "tendermint/PubKeyEd25519",
  595. "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
  596. },
  597. "power": "300"
  598. }
  599. ],
  600. "consensus_params_updates": {
  601. "block": {
  602. "max_bytes": "22020096",
  603. "max_gas": "1000",
  604. "time_iota_ms": "1000"
  605. },
  606. "evidence": {
  607. "max_age": "100000"
  608. },
  609. "validator": {
  610. "pub_key_types": [
  611. "ed25519"
  612. ]
  613. }
  614. }
  615. }
  616. }
  617. ```
  618. ### Commit
  619. #### Parameters
  620. - `height (integer)`: Height of the block the requested commit pertains to. If no height is set the latest commit will be returned.
  621. #### Request
  622. ##### HTTP
  623. ```sh
  624. curl http://127.0.0.1:26657/commit
  625. curl http://127.0.0.1:26657/commit?height=1
  626. ```
  627. ##### JSONRPC
  628. ```sh
  629. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"commit\",\"params\":{\"height\":\"1\"}}"
  630. ```
  631. #### Response
  632. ```json
  633. {
  634. "jsonrpc": "2.0",
  635. "id": 0,
  636. "result": {
  637. "signed_header": {
  638. "header": {
  639. "version": {
  640. "block": "10",
  641. "app": "0"
  642. },
  643. "chain_id": "cosmoshub-2",
  644. "height": "12",
  645. "time": "2019-04-22T17:01:51.701356223Z",
  646. "last_block_id": {
  647. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  648. "parts": {
  649. "total": 1,
  650. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  651. }
  652. },
  653. "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
  654. "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
  655. "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  656. "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
  657. "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
  658. "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
  659. "last_results_hash": "",
  660. "evidence_hash": "",
  661. "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
  662. },
  663. "commit": {
  664. "height": "1311801",
  665. "round": 0,
  666. "block_id": {
  667. "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
  668. "parts": {
  669. "total": 1,
  670. "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
  671. }
  672. },
  673. "signatures": [
  674. {
  675. "block_id_flag": 2,
  676. "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F",
  677. "timestamp": "2019-04-22T17:01:58.376629719Z",
  678. "signature": "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw=="
  679. }
  680. ]
  681. }
  682. },
  683. "canonical": true
  684. }
  685. }
  686. ```
  687. ### Validators
  688. #### Parameters
  689. - `height (integer)`: Block height at which the validators were present on. If no height is set the latest commit will be returned.
  690. - `page (integer)`:
  691. - `per_page (integer)`:
  692. #### Request
  693. ##### HTTP
  694. ```sh
  695. curl http://127.0.0.1:26657/validators
  696. ```
  697. ##### JSONRPC
  698. ```sh
  699. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"validators\",\"params\":{\"height\":\"1\", \"page\":\"1\", \"per_page\":\"20\"}}"
  700. ```
  701. #### Response
  702. ```json
  703. {
  704. "jsonrpc": "2.0",
  705. "id": 0,
  706. "result": {
  707. "block_height": "55",
  708. "validators": [
  709. {
  710. "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F",
  711. "pub_key": {
  712. "type": "tendermint/PubKeyEd25519",
  713. "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
  714. },
  715. "voting_power": "239727",
  716. "proposer_priority": "-11896414"
  717. }
  718. ],
  719. "count": "1",
  720. "total": "25"
  721. }
  722. }
  723. ```
  724. ### Genesis
  725. Get Genesis of the chain. If the response is large, this operation
  726. will return an error: use `genesis_chunked` instead.
  727. #### Request
  728. ##### HTTP
  729. ```sh
  730. curl http://127.0.0.1:26657/genesis
  731. ```
  732. ##### JSONRPC
  733. ```sh
  734. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"genesis\"}"
  735. ```
  736. #### Response
  737. ```json
  738. {
  739. "jsonrpc": "2.0",
  740. "id": 0,
  741. "result": {
  742. "genesis": {
  743. "genesis_time": "2019-04-22T17:00:00Z",
  744. "chain_id": "cosmoshub-2",
  745. "initial_height": "2",
  746. "consensus_params": {
  747. "block": {
  748. "max_bytes": "22020096",
  749. "max_gas": "1000",
  750. "time_iota_ms": "1000"
  751. },
  752. "evidence": {
  753. "max_age": "100000"
  754. },
  755. "validator": {
  756. "pub_key_types": [
  757. "ed25519"
  758. ]
  759. }
  760. },
  761. "validators": [
  762. {
  763. "address": "B00A6323737F321EB0B8D59C6FD497A14B60938A",
  764. "pub_key": {
  765. "type": "tendermint/PubKeyEd25519",
  766. "value": "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM="
  767. },
  768. "power": "9328525",
  769. "name": "Certus One"
  770. }
  771. ],
  772. "app_hash": "",
  773. "app_state": {}
  774. }
  775. }
  776. }
  777. ```
  778. ### GenesisChunked
  779. Get the genesis document in a chunks to support easily transfering larger documents.
  780. #### Parameters
  781. - `chunk` (integer): the index number of the chunk that you wish to
  782. fetch. These IDs are 0 indexed.
  783. #### Request
  784. ##### HTTP
  785. ```sh
  786. curl http://127.0.0.1:26657/genesis_chunked?chunk=0
  787. ```
  788. ##### JSONRPC
  789. ```sh
  790. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"genesis_chunked\",\"params\":{\"chunk\":0}}"
  791. ```
  792. #### Response
  793. ```json
  794. {
  795. "jsonrpc": "2.0",
  796. "id": 0,
  797. "result": {
  798. "chunk": 0,
  799. "total": 10,
  800. "data": "dGVuZGVybWludAo="
  801. }
  802. }
  803. ```
  804. ### ConsensusParams
  805. Get the consensus parameters.
  806. #### Parameters
  807. - `height (integer)`: Block height at which the consensus params would like to be fetched for.
  808. #### Request
  809. ##### HTTP
  810. ```sh
  811. curl http://127.0.0.1:26657/consensus_params
  812. ```
  813. ##### JSONRPC
  814. ```sh
  815. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"consensus_params\"}"
  816. ```
  817. #### Response
  818. ```json
  819. {
  820. "jsonrpc": "2.0",
  821. "id": 0,
  822. "result": {
  823. "block_height": "1",
  824. "consensus_params": {
  825. "block": {
  826. "max_bytes": "22020096",
  827. "max_gas": "1000",
  828. "time_iota_ms": "1000"
  829. },
  830. "evidence": {
  831. "max_age": "100000"
  832. },
  833. "validator": {
  834. "pub_key_types": [
  835. "ed25519"
  836. ]
  837. }
  838. }
  839. }
  840. }
  841. ```
  842. ### UnconfirmedTxs
  843. Get a list of unconfirmed transactions.
  844. #### Parameters
  845. - `limit (integer)` The amount of txs to respond with.
  846. #### Request
  847. ##### HTTP
  848. ```sh
  849. curl http://127.0.0.1:26657/unconfirmed_txs
  850. ```
  851. ##### JSONRPC
  852. ```sh
  853. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"unconfirmed_txs\, \"params\":{\"limit\":\"20\"}}"
  854. ```
  855. #### Response
  856. ```json
  857. {
  858. "jsonrpc": "2.0",
  859. "id": 0,
  860. "result": {
  861. "n_txs": "82",
  862. "total": "82",
  863. "total_bytes": "19974",
  864. "txs": [
  865. "gAPwYl3uCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUA75/FmYq9WymsOBJ0XSJ8yV8zmQKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhQbrvwbvlNiT+Yjr86G+YQNx7kRVgowjE1xDQoUjJyJG+WaWBwSiGannBRFdrbma+8SFK2m+1oxgILuQLO55n8mWfnbIzyPCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUQNGfkmhTNMis4j+dyMDIWXdIPiYKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhS8sL0D0wwgGCItQwVowak5YB38KRIUCg4KBXVhdG9tEgUxMDA1NBDoxRgaagom61rphyECn8x7emhhKdRCB2io7aS/6Cpuq5NbVqbODmqOT3jWw6kSQKUresk+d+Gw0BhjiggTsu8+1voW+VlDCQ1GRYnMaFOHXhyFv7BCLhFWxLxHSAYT8a5XqoMayosZf9mANKdXArA="
  866. ]
  867. }
  868. }
  869. ```
  870. ### NumUnconfirmedTxs
  871. Get data about unconfirmed transactions.
  872. #### Parameters
  873. None
  874. #### Request
  875. ##### HTTP
  876. ```sh
  877. curl http://127.0.0.1:26657/num_unconfirmed_txs
  878. ```
  879. ##### JSONRPC
  880. ```sh
  881. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"num_unconfirmed_txs\"}"
  882. ```
  883. #### Response
  884. ```json
  885. {
  886. "jsonrpc": "2.0",
  887. "id": 0,
  888. "result": {
  889. "n_txs": "31",
  890. "total": "82",
  891. "total_bytes": "19974"
  892. }
  893. }
  894. ```
  895. ### Tx
  896. #### Parameters
  897. - `hash (string)`: The hash of the transaction
  898. - `prove (bool)`: If the response should include proof the transaction was included in a block.
  899. #### Request
  900. ##### HTTP
  901. ```sh
  902. curl http://127.0.0.1:26657/num_unconfirmed_txs
  903. ```
  904. ##### JSONRPC
  905. ```sh
  906. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"num_unconfirmed_txs\"}"
  907. ```
  908. #### Response
  909. ```json
  910. {
  911. "jsonrpc": "2.0",
  912. "id": 0,
  913. "result": {
  914. "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED",
  915. "height": "1000",
  916. "index": 0,
  917. "tx_result": {
  918. "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]",
  919. "gas_wanted": "200000",
  920. "gas_used": "28596",
  921. "tags": [
  922. {
  923. "key": "YWN0aW9u",
  924. "value": "c2VuZA==",
  925. "index": false
  926. }
  927. ]
  928. },
  929. "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU="
  930. }
  931. }
  932. ```
  933. ## Transaction Routes
  934. ### BroadCastTxSync
  935. Returns with the response from CheckTx. Does not wait for DeliverTx result.
  936. #### Parameters
  937. - `tx (string)`: The transaction encoded
  938. #### Request
  939. ##### HTTP
  940. ```sh
  941. curl http://127.0.0.1:26657/broadcast_tx_sync?tx=encoded_tx
  942. ```
  943. ##### JSONRPC
  944. ```sh
  945. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"broadcast_tx_sync\",\"params\":{\"tx\":\"a/encoded_tx/c\"}}"
  946. ```
  947. #### Response
  948. ```json
  949. {
  950. "jsonrpc": "2.0",
  951. "id": 0,
  952. "result": {
  953. "code": "0",
  954. "data": "",
  955. "log": "",
  956. "codespace": "ibc",
  957. "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E"
  958. },
  959. "error": ""
  960. }
  961. ```
  962. ### BroadCastTxAsync
  963. Returns right away, with no response. Does not wait for CheckTx nor DeliverTx results.
  964. #### Parameters
  965. - `tx (string)`: The transaction encoded
  966. #### Request
  967. ##### HTTP
  968. ```sh
  969. curl http://127.0.0.1:26657/broadcast_tx_async?tx=encoded_tx
  970. ```
  971. ##### JSONRPC
  972. ```sh
  973. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"broadcast_tx_async\",\"params\":{\"tx\":\"a/encoded_tx/c\"}}"
  974. ```
  975. #### Response
  976. ```json
  977. {
  978. "jsonrpc": "2.0",
  979. "id": 0,
  980. "result": {
  981. "code": "0",
  982. "data": "",
  983. "log": "",
  984. "codespace": "ibc",
  985. "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E"
  986. },
  987. "error": ""
  988. }
  989. ```
  990. ### CheckTx
  991. Checks the transaction without executing it.
  992. #### Parameters
  993. - `tx (string)`: String of the encoded transaction
  994. #### Request
  995. ##### HTTP
  996. ```sh
  997. curl http://127.0.0.1:26657/check_tx?tx=encoded_tx
  998. ```
  999. ##### JSONRPC
  1000. ```sh
  1001. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"check_tx\",\"params\":{\"tx\":\"a/encoded_tx/c\"}}"
  1002. ```
  1003. #### Response
  1004. ```json
  1005. {
  1006. "id": 0,
  1007. "jsonrpc": "2.0",
  1008. "error": "",
  1009. "result": {
  1010. "code": "0",
  1011. "data": "",
  1012. "log": "",
  1013. "info": "",
  1014. "gas_wanted": "1",
  1015. "gas_used": "0",
  1016. "events": [
  1017. {
  1018. "type": "app",
  1019. "attributes": [
  1020. {
  1021. "key": "YWN0aW9u",
  1022. "value": "c2VuZA==",
  1023. "index": false
  1024. }
  1025. ]
  1026. }
  1027. ],
  1028. "codespace": "bank"
  1029. }
  1030. }
  1031. ```
  1032. ## ABCI Routes
  1033. ### ABCIInfo
  1034. Get some info about the application.
  1035. #### Parameters
  1036. None
  1037. #### Request
  1038. ##### HTTP
  1039. ```sh
  1040. curl http://127.0.0.1:26657/abci_info
  1041. ```
  1042. ##### JSONRPC
  1043. ```sh
  1044. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"abci_info\"}"
  1045. ```
  1046. #### Response
  1047. ```json
  1048. {
  1049. "jsonrpc": "2.0",
  1050. "id": 0,
  1051. "result": {
  1052. "response": {
  1053. "data": "{\"size\":0}",
  1054. "version": "0.16.1",
  1055. "app_version": "1314126"
  1056. }
  1057. }
  1058. }
  1059. ```
  1060. ### ABCIQuery
  1061. Query the application for some information.
  1062. #### Parameters
  1063. - `path (string)`: Path to the data. This is defined by the application.
  1064. - `data (string)`: The data requested
  1065. - `height (integer)`: Height at which the data is being requested for.
  1066. - `prove (bool)`: Include proofs of the transactions inclusion in the block
  1067. #### Request
  1068. ##### HTTP
  1069. ```sh
  1070. curl http://127.0.0.1:26657/abci_query?path="a/b/c"=IHAVENOIDEA&height=1&prove=true
  1071. ```
  1072. ##### JSONRPC
  1073. ```sh
  1074. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"abci_query\",\"params\":{\"path\":\"a/b/c\", \"height\":\"1\", \"bool\":\"true\"}}"
  1075. ```
  1076. #### Response
  1077. ```json
  1078. {
  1079. "error": "",
  1080. "result": {
  1081. "response": {
  1082. "log": "exists",
  1083. "height": "0",
  1084. "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C",
  1085. "value": "61626364",
  1086. "key": "61626364",
  1087. "index": "-1",
  1088. "code": "0"
  1089. }
  1090. },
  1091. "id": 0,
  1092. "jsonrpc": "2.0"
  1093. }
  1094. ```
  1095. ## Evidence Routes
  1096. ### BroadcastEvidence
  1097. Broadcast evidence of the misbehavior.
  1098. #### Parameters
  1099. - `evidence (string)`:
  1100. #### Request
  1101. ##### HTTP
  1102. ```sh
  1103. curl http://localhost:26657/broadcast_evidence?evidence=JSON_EVIDENCE_encoded
  1104. ```
  1105. #### JSONRPC
  1106. ```sh
  1107. curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"broadcast_evidence\",\"params\":{\"evidence\":\"JSON_EVIDENCE_encoded\"}}"
  1108. ```
  1109. #### Response
  1110. ```json
  1111. {
  1112. "error": "",
  1113. "result": "",
  1114. "id": 0,
  1115. "jsonrpc": "2.0"
  1116. }
  1117. ```