---
updatedAt: 2025-06-11T20:38:36.000Z
agentTools:
  projectIndex: https://docs.allthatnode.com/llms.txt
---

# Get consensus state

Get consensus state.

Not safe to call from inside the ABCI application during a block execution.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "CometBFT RPC",
    "contact": {
      "name": "CometBFT",
      "url": "https://cometbft.com/"
    },
    "description": "CometBFT supports the following RPC protocols:\n\n* URI over HTTP\n* JSONRPC over HTTP\n* JSONRPC over websockets\n\n## Configuration\n\nRPC can be configured by tuning parameters under `[rpc]` table in the\n`$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line\nflags.\n\nThe default RPC listen address is `tcp://127.0.0.1:26657`.\nTo set another address, set the `laddr` config parameter to desired value.\nCORS (Cross-Origin Resource Sharing) can be enabled by setting\n`cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`\nconfig parameters.\n\nIf testing using a local RPC node, under the `[rpc]`\nsection change the `cors_allowed_origins` property, please add the URL of\nthe site where this OpenAPI document is running, for example:\n\n  `cors_allowed_origins = [\"http://localhost:8088\"]`\n\nor if testing from the official documentation site:\n\n  `cors_allowed_origins = [\"https://docs.cometbft.com\"]`\n\n## Arguments\n\nArguments which expect strings or byte arrays may be passed as quoted\nstrings, like `\"abc\"` or as `0x`-prefixed strings, like `0x616263`.\n\n## URI/HTTP\n\nA REST like interface.\n\n    curl localhost:26657/block?height=5\n\n## JSONRPC/HTTP\n\nJSONRPC requests can be POST'd to the root RPC endpoint via HTTP.\n\n    curl --header \"Content-Type: application/json\" --request POST --data '{\"method\": \"block\", \"params\": [\"5\"], \"id\": 1}' localhost:26657\n\n## JSONRPC/websockets\n\nJSONRPC requests can be also made via websocket.\nThe websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.\nAsynchronous RPC functions like event `subscribe` and `unsubscribe` are\nonly available via websockets.\n\nFor example using the [websocat](https://github.com/vi/websocat) tool, you can subscribe for 'NewBlock` events\nwith the following command:\n\n    echo '{ \"jsonrpc\": \"2.0\",\"method\": \"subscribe\",\"id\": 0,\"params\": {\"query\": \"tm.event='\"'NewBlock'\"'\"} }' | websocat -n -t ws://127.0.0.1:26657/websocket\n",
    "version": "v0.38.x",
    "license": {
      "name": "Apache 2.0",
      "url": "https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://rpc.cosmos.directory/cosmoshub",
      "description": "Interact with the CometBFT RPC from a public node in the Cosmos registry"
    },
    {
      "url": "http://localhost:26657",
      "description": "Interact with CometBFT RPC node running locally"
    }
  ],
  "tags": [
    {
      "name": "Info",
      "description": "Informations about the node APIs"
    }
  ],
  "paths": {
    "/dump_consensus_state": {
      "get": {
        "summary": "Get consensus state",
        "operationId": "dump_consensus_state",
        "tags": [
          "Info"
        ],
        "description": "Get consensus state.\n\nNot safe to call from inside the ABCI application during a block execution.\n",
        "responses": {
          "200": {
            "description": "Complete consensus state.\n\nSee https://pkg.go.dev/github.com/cometbft/cometbft/types?tab=doc#Vote.String for Vote string description.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DumpConsensusResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JSONRPC": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 0
          },
          "jsonrpc": {
            "type": "string",
            "example": "2.0"
          }
        }
      },
      "ErrorResponse": {
        "description": "Error Response",
        "allOf": [
          {
            "$ref": "#/components/schemas/JSONRPC"
          },
          {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "example": "Description of failure"
              }
            }
          }
        ]
      },
      "DumpConsensusResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "result"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "example": "2.0"
          },
          "id": {
            "type": "integer",
            "example": 0
          },
          "result": {
            "required": [
              "round_state",
              "peers"
            ],
            "properties": {
              "round_state": {
                "required": [
                  "height",
                  "round",
                  "step",
                  "start_time",
                  "commit_time",
                  "validators",
                  "proposal",
                  "proposal_block",
                  "proposal_block_parts",
                  "locked_round",
                  "locked_block",
                  "locked_block_parts",
                  "valid_round",
                  "valid_block",
                  "valid_block_parts",
                  "votes",
                  "commit_round",
                  "last_commit",
                  "last_validators",
                  "triggered_timeout_precommit"
                ],
                "properties": {
                  "height": {
                    "type": "string",
                    "example": "1311801"
                  },
                  "round": {
                    "type": "integer",
                    "example": 0
                  },
                  "step": {
                    "type": "integer",
                    "example": 3
                  },
                  "start_time": {
                    "type": "string",
                    "example": "2019-08-05T11:28:49.064658805Z"
                  },
                  "commit_time": {
                    "type": "string",
                    "example": "2019-08-05T11:28:44.064658805Z"
                  },
                  "validators": {
                    "required": [
                      "validators",
                      "proposer"
                    ],
                    "properties": {
                      "validators": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/ValidatorPriority"
                        }
                      },
                      "proposer": {
                        "$ref": "#/components/schemas/ValidatorPriority"
                      }
                    },
                    "type": "object"
                  },
                  "locked_round": {
                    "type": "integer",
                    "example": -1
                  },
                  "valid_round": {
                    "type": "string",
                    "example": "-1"
                  },
                  "votes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "round": {
                          "type": "string",
                          "example": "0"
                        },
                        "prevotes": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "nil-Vote",
                            "Vote{19:46A3F8B8393B 1311801/00/1(Prevote) 000000000000 64CE682305CB @ 2019-08-05T11:28:47.374703444Z}"
                          ]
                        },
                        "prevotes_bit_array": {
                          "type": "string",
                          "example": "BA{100:___________________x________________________________________________________________________________} 209706/170220253 = 0.00"
                        },
                        "precommits": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "string"
                          },
                          "example": [
                            "nil-Vote"
                          ]
                        },
                        "precommits_bit_array": {
                          "type": "string",
                          "example": "BA{100:____________________________________________________________________________________________________} 0/170220253 = 0.00"
                        }
                      }
                    }
                  },
                  "commit_round": {
                    "type": "integer",
                    "example": -1
                  },
                  "last_commit": {
                    "nullable": true,
                    "required": [
                      "votes",
                      "votes_bit_array",
                      "peer_maj_23s"
                    ],
                    "properties": {
                      "votes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "Vote{0:000001E443FD 1311800/00/2(Precommit) 3071ADB27D1A 77EE1B6B6847 @ 2019-08-05T11:28:43.810128139Z}"
                        ]
                      },
                      "votes_bit_array": {
                        "type": "string",
                        "example": "BA{100:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 170220253/170220253 = 1.00"
                      },
                      "peer_maj_23s": {
                        "properties": {},
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "last_validators": {
                    "required": [
                      "validators",
                      "proposer"
                    ],
                    "properties": {
                      "validators": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/ValidatorPriority"
                        }
                      },
                      "proposer": {
                        "$ref": "#/components/schemas/ValidatorPriority"
                      }
                    },
                    "type": "object"
                  },
                  "triggered_timeout_precommit": {
                    "type": "boolean",
                    "example": false
                  }
                },
                "type": "object"
              },
              "peers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "node_address": {
                      "type": "string",
                      "example": "357f6a6c1d27414579a8185060aa8adf9815c43c@68.183.41.207:26656"
                    },
                    "peer_state": {
                      "required": [
                        "round_state",
                        "stats"
                      ],
                      "properties": {
                        "round_state": {
                          "required": [
                            "height",
                            "round",
                            "step",
                            "start_time",
                            "proposal",
                            "proposal_block_parts_header",
                            "proposal_block_parts",
                            "proposal_pol_round",
                            "proposal_pol",
                            "prevotes",
                            "precommits",
                            "last_commit_round",
                            "last_commit",
                            "catchup_commit_round",
                            "catchup_commit"
                          ],
                          "properties": {
                            "height": {
                              "type": "string",
                              "example": "1311801"
                            },
                            "round": {
                              "type": "string",
                              "example": "0"
                            },
                            "step": {
                              "type": "integer",
                              "example": 3
                            },
                            "start_time": {
                              "type": "string",
                              "example": "2019-08-05T11:28:49.21730864Z"
                            },
                            "proposal": {
                              "type": "boolean",
                              "example": false
                            },
                            "proposal_block_parts_header": {
                              "required": [
                                "total",
                                "hash"
                              ],
                              "properties": {
                                "total": {
                                  "type": "integer",
                                  "example": 0
                                },
                                "hash": {
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "type": "object"
                            },
                            "proposal_pol_round": {
                              "nullable": true,
                              "type": "integer",
                              "example": -1
                            },
                            "proposal_pol": {
                              "nullable": true,
                              "type": "string",
                              "example": "____________________________________________________________________________________________________"
                            },
                            "prevotes": {
                              "nullable": true,
                              "type": "string",
                              "example": "___________________x________________________________________________________________________________"
                            },
                            "precommits": {
                              "nullable": true,
                              "type": "string",
                              "example": "____________________________________________________________________________________________________"
                            },
                            "last_commit_round": {
                              "nullable": true,
                              "type": "integer",
                              "example": 0
                            },
                            "last_commit": {
                              "nullable": true,
                              "type": "string",
                              "example": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                            },
                            "catchup_commit_round": {
                              "type": "integer",
                              "nullable": true,
                              "example": -1
                            },
                            "catchup_commit": {
                              "nullable": true,
                              "type": "string",
                              "example": "____________________________________________________________________________________________________"
                            }
                          },
                          "type": "object"
                        },
                        "stats": {
                          "required": [
                            "votes",
                            "block_parts"
                          ],
                          "properties": {
                            "votes": {
                              "type": "string",
                              "example": "1159558"
                            },
                            "block_parts": {
                              "type": "string",
                              "example": "4786"
                            }
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              }
            },
            "type": "object"
          }
        }
      },
      "ValidatorPriority": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "example": "000001E443FD237E4B616E2FA69DF4EE3D49A94F"
          },
          "pub_key": {
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "example": "tendermint/PubKeyEd25519"
              },
              "value": {
                "type": "string",
                "example": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
              }
            },
            "type": "object"
          },
          "voting_power": {
            "type": "string",
            "example": "239727"
          },
          "proposer_priority": {
            "type": "string",
            "example": "-11896414"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```