> For the complete documentation index, see [llms.txt](https://seinetwork.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seinetwork.gitbook.io/docs/nodes-and-validators/basic-api-endpoints.md).

# Основные эндпоинты API

В этом документе представлены некоторые основные эндпоинты API, которые могут быть полезны, когда вы конфигурируете свою ноду или валидатора.

Все примеры ниже подразумевают наличие запущенной ноды или валидатора. Тем не менее, существует возможность отправлять запросы к удаленной ноде:

* Для выполнения команд из командной строки, необходимо использовать флаг `--node`
* Для удаленного вызова REST, вы можете заменить localhost на IP адрес удаленной ноды

## Получение статуса ноды

### CLI (командная строка)

```
> seid status | jq -r ".NodeInfo"
{
  "protocol_version": {
    "p2p": "8",
    "block": "11",
    "app": "0"
  },
  "id": "c3beb6d42f10311fd453029cb3ee6ac08880d522",
  "listen_addr": "tcp://0.0.0.0:26656",
  "network": "sei-testnet-1",
  "version": "0.34.15",
  "channels": "40202122233038606100",
  "moniker": "phils validator",
  "other": {
    "tx_index": "on",
    "rpc_address": "tcp://127.0.0.1:26657"
  }
```

### REST

```
> curl localhost:1317/cosmos/base/tendermint/v1beta1/node_info  | jq -r ".default_node_info"
{
  "protocol_version": {
    "p2p": "8",
    "block": "11",
    "app": "0"
  },
  "default_node_id": "c3beb6d42f10311fd453029cb3ee6ac08880d522",
  "listen_addr": "tcp://0.0.0.0:26656",
  "network": "sei-testnet-1",
  "version": "0.34.15",
  "channels": "QCAhIiMwOGBhAA==",
  "moniker": "phils validator",
  "other": {
    "tx_index": "on",
    "rpc_address": "tcp://127.0.0.1:26657"
  }
}
```

## Получение id ноды

### CLI

```
> seid tendermint show-node-id
89e8fdd427a056fb7b4f5da2d58a4b688feb4b74
```

### REST

```
> curl localhost:1317/cosmos/base/tendermint/v1beta1/node_info | jq -r ".default_node_info.default_node_id
89e8fdd427a056fb7b4f5da2d58a4b688feb4b74
```

## Получение статуса синхронизации

### CLI

```
> seid status | jq -r ".SyncInfo.catching_up"
false
```

### REST

```
> curl localhost:1317/cosmos/base/tendermint/v1beta1/syncing
{
  "syncing": false
}
```

## Получение последнего блока

### CLI

```
> seid query block | jq
{
  "block_id": {
    "hash": "92B93642DCCECFBDFEAE972C67294CF1B3574FAF55F3B24E218990CC4EE28B0A",
    "parts": {
      "total": 1,
      "hash": "5FBD2E43F3A3F6DBD9C9E2021B1505DF3AC74841F7207F479E701FF0726E0EF3"
    }
  },
  "block": {
    "header": {
      "version": {
        "block": "11"
      },
...
```

### REST

```
> curl localhost:1317/cosmos/base/tendermint/v1beta1/blocks/latest
{
  "block_id": {
    "hash": "krk2QtzOz73+rpcsZylM8bNXT69V87JOIYmQzE7iiwo=",
    "part_set_header": {
      "total": 1,
      "hash": "X70uQ/Oj9tvZyeICGxUF3zrHSEH3IH9HnnAf8HJuDvM="
    }
  },
  "block": {
    "header": {
      "version": {
        "block": "11",
...
```

## Запрос банкковского баланса

### CLI

```
> seid query bank balances $ACCOUNT_ADDRESS
balances:
- amount: "29999999999995999900"
  denom: ust
pagination:
  next_key: null
  total: "0"
```

### REST

```
> curl localhost:1317/bank/balances/$ACCOUNT_ADDRESS
{"height":"4028","result":[
  {
    "denom": "ust",
    "amount": "29999999999995999900"
  }
]}
```

## Получение информации о валидаторах

### CLI

```
> seid query tendermint-validator-set
block_height: "3472"
total: "2"
validators:
- address: cosmosvalcons1xrn3ejn56chrv26mfk9vaztef63zptkmygmdxf
  proposer_priority: "39374999999767"
  pub_key:
    type: tendermint/PubKeyEd25519
    value: Cf46GgHIjqEdk5ZeHux/PTWEmWUWnxTFeyJxIzwoxSA=
  voting_power: "70000000000000"
```

### REST

```
> curl localhost:1317/cosmos/base/tendermint/v1beta1/validatorsets/latest
{
  "block_height": "4156",
  "validators": [
    {
      "address": "cosmosvalcons1xrn3ejn56chrv26mfk9vaztef63zptkmygmdxf",
      "pub_key": {
        "@type": "/cosmos.crypto.ed25519.PubKey",
        "key": "Cf46GgHIjqEdk5ZeHux/PTWEmWUWnxTFeyJxIzwoxSA="
      },
      "voting_power": "70000000000000",
      "proposer_priority": "42656249998811"
    },
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://seinetwork.gitbook.io/docs/nodes-and-validators/basic-api-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
