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.

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