> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-sync-security-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# net_info

> Network information

Get network info.



## OpenAPI

````yaml /cometbft/latest/api-reference/rpc/openapi.yaml get /net_info
openapi: 3.0.0
info:
  title: CometBFT RPC
  contact:
    name: CometBFT
    url: https://docs.cosmos.network/cometbft
  description: >
    CometBFT supports the following RPC protocols:


    * URI over HTTP

    * JSONRPC over HTTP

    * JSONRPC over websockets


    ## Configuration


    RPC can be configured by tuning parameters under `[rpc]` table in the

    `$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line

    flags.


    The default RPC listen address is `tcp://127.0.0.1:26657`.

    To set another address, set the `laddr` config parameter to desired value.

    CORS (Cross-Origin Resource Sharing) can be enabled by setting

    `cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`

    config parameters.


    If testing using a local RPC node, under the `[rpc]`

    section change the `cors_allowed_origins` property, please add the URL of

    the site where this OpenAPI document is running, for example:

      `cors_allowed_origins = ["http://localhost:8088"]`

    or if testing from the official documentation site:

      `cors_allowed_origins = ["https://docs.cosmos.network"]`

    ## Arguments


    Arguments which expect strings or byte arrays may be passed as quoted

    strings, like `"abc"` or as `0x`-prefixed strings, like `0x616263`.


    ## URI/HTTP


    A REST like interface.

        curl localhost:26657/block?height=5

    ## JSONRPC/HTTP


    JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.

        curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657

    ## JSONRPC/websockets


    JSONRPC requests can be also made via websocket.

    The websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.

    Asynchronous RPC functions like event `subscribe` and `unsubscribe` are

    only available via websockets.


    For example using the [websocat](https://github.com/vi/websocat) tool, you
    can subscribe for 'NewBlock` events

    with the following command:

        echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket
  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
security: []
tags:
  - name: Info
    description: Informations about the node APIs
  - name: Tx
    description: Transactions broadcast APIs
  - name: ABCI
    description: ABCI APIs
  - name: Evidence
    description: Evidence APIs
  - name: Unsafe
    description: Unsafe APIs
paths:
  /net_info:
    get:
      tags:
        - Info
      summary: net_info
      description: |-
        Network information

        Get network info.
      operationId: net_info
      responses:
        '200':
          description: empty answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetInfoResponse'
        '500':
          description: empty error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    NetInfoResponse:
      description: NetInfo Response
      allOf:
        - $ref: '#/components/schemas/JSONRPC'
        - type: object
          properties:
            result:
              $ref: '#/components/schemas/NetInfo'
    ErrorResponse:
      description: Error Response
      allOf:
        - $ref: '#/components/schemas/JSONRPC'
        - type: object
          properties:
            error:
              type: string
              example: Description of failure
    JSONRPC:
      type: object
      properties:
        id:
          type: integer
          example: 0
        jsonrpc:
          type: string
          example: '2.0'
    NetInfo:
      type: object
      properties:
        listening:
          type: boolean
          example: true
        listeners:
          type: array
          items:
            type: string
            example: Listener(@)
        n_peers:
          type: string
          example: '1'
        peers:
          type: array
          items:
            $ref: '#/components/schemas/Peer'
    Peer:
      type: object
      properties:
        node_info:
          $ref: '#/components/schemas/NodeInfo'
        is_outbound:
          type: boolean
          example: true
        connection_status:
          $ref: '#/components/schemas/ConnectionStatus'
        remote_ip:
          type: string
          example: 95.179.155.35
    NodeInfo:
      type: object
      properties:
        protocol_version:
          $ref: '#/components/schemas/ProtocolVersion'
        id:
          type: string
          example: 5576458aef205977e18fd50b274e9b5d9014525a
        listen_addr:
          type: string
          example: tcp:0.0.0.0:26656
        network:
          type: string
          example: cosmoshub-2
        version:
          type: string
          example: 0.32.1
        channels:
          type: string
          example: '4020212223303800'
        moniker:
          type: string
          example: moniker-node
        other:
          type: object
          properties:
            tx_index:
              type: string
              example: 'on'
            rpc_address:
              type: string
              example: tcp:0.0.0.0:26657
    ConnectionStatus:
      type: object
      properties:
        Duration:
          type: string
          example: '168901057956119'
        SendMonitor:
          $ref: '#/components/schemas/Monitor'
        RecvMonitor:
          $ref: '#/components/schemas/Monitor'
        Channels:
          type: array
          items:
            $ref: '#/components/schemas/Channel'
    ProtocolVersion:
      type: object
      properties:
        p2p:
          type: string
          example: '7'
        block:
          type: string
          example: '10'
        app:
          type: string
          example: '0'
    Monitor:
      type: object
      properties:
        Active:
          type: boolean
          example: true
        Start:
          type: string
          example: '2019-07-31T14:31:28.66Z'
        Duration:
          type: string
          example: '168901060000000'
        Idle:
          type: string
          example: '168901040000000'
        Bytes:
          type: string
          example: '5'
        Samples:
          type: string
          example: '1'
        InstRate:
          type: string
          example: '0'
        CurRate:
          type: string
          example: '0'
        AvgRate:
          type: string
          example: '0'
        PeakRate:
          type: string
          example: '0'
        BytesRem:
          type: string
          example: '0'
        TimeRem:
          type: string
          example: '0'
        Progress:
          type: integer
          example: 0
    Channel:
      type: object
      properties:
        ID:
          type: integer
          example: 48
        SendQueueCapacity:
          type: string
          example: '1'
        SendQueueSize:
          type: string
          example: '0'
        Priority:
          type: string
          example: '5'
        RecentlySent:
          type: string
          example: '0'

````