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