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.

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