openapi: 3.0.0
servers:
  - url: http://eos.local
  - url: "{protocol}://{host}:{port}/v1/"
    variables:
      host:
        default: localhost
      port:
        default: "8080"
      protocol:
        default: http
        enum:
          - http
          - https
info:
  contact:
    url: https://eos.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  title: Net API
  version: 1.0.0
  x-apisguru-categories:
    - hosting
  x-origin:
    - format: openapi
      url: https://gist.githubusercontent.com/MikeRalphson/9b1349082ac4eca3660eaf6ad31e70d2/raw/88dacf4280e9aca949b5f4692904229fdf2457ff/swagger(1).json
      version: "3.0"
  x-providerName: eos.local
paths:
  /net/connect:
    post:
      description: Initiate a connection to a specified peer.
      operationId: connect
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                endpoint:
                  description: the endpoint to connect to expressed as either IP address or URL
                  type: string
              required:
                - endpoint
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                description: '"already connected" or "added connection"'
                type: string
          description: OK
      summary: connect
  /net/connections:
    post:
      description: Returns an array of all peer connection statuses.
      operationId: connections
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties: {}
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  properties:
                    connecting:
                      description: True if the peer is connecting, otherwise false
                      type: boolean
                    last_handshake:
                      description: Structure holding detailed information about the connection
                      properties:
                        agent:
                          description: Agent name
                          type: string
                        chain_id:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/token"
                        generation:
                          description: Generation number
                          type: integer
                        head_id:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/token"
                        head_num:
                          description: Head number
                          type: integer
                        key:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/key"
                        last_irreversible_block_id:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/token"
                        last_irreversible_block_num:
                          description: Last irreversible block number
                          type: integer
                        network_version:
                          description: Incremental value above a computed base
                          type: integer
                        node_id:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/token"
                        os:
                          description: Operating system name
                          type: string
                        p2p_address:
                          description: IP address or URL of the peer
                          type: string
                        sig:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/sig"
                        time:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/time"
                        token:
                          $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                            a/properties/last_handshake/properties/token"
                      type: object
                    peer:
                      description: The IP address or URL of the peer
                      type: string
                    syncing:
                      description: True if the peer is syncing, otherwise false
                      type: boolean
                  type: object
                type: array
          description: OK
      summary: connections
  /net/disconnect:
    post:
      description: Initiate disconnection from a specified peer.
      operationId: disconnect
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                endpoint:
                  description: the endpoint to disconnect from, expressed as either IP address or
                    URL
                  type: string
              required:
                - endpoint
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                description: '"connection removed" or "no known connection for host"'
                type: string
          description: OK
      summary: disconnect
  /net/status:
    post:
      description: Retrieves the connection status for a specified peer.
      operationId: status
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                endpoint:
                  description: the endpoint to get the status for, to expressed as either IP
                    address or URL
                  type: string
              required:
                - endpoint
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  connecting:
                    description: True if the peer is connecting, otherwise false
                    type: boolean
                  last_handshake:
                    description: Structure holding detailed information about the connection
                    properties:
                      agent:
                        description: Agent name
                        type: string
                      chain_id:
                        $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                          a/properties/last_handshake/properties/token"
                      generation:
                        description: Generation number
                        type: integer
                      head_id:
                        $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                          a/properties/last_handshake/properties/token"
                      head_num:
                        description: Head number
                        type: integer
                      key:
                        description: Base58 encoded EOSIO public key
                        pattern: ^(EOS|PUB_([RK]1|WA)_)[1-9A-HJ-NP-Za-km-z]+$
                        title: PublicKey
                        type: string
                      last_irreversible_block_id:
                        $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                          a/properties/last_handshake/properties/token"
                      last_irreversible_block_num:
                        description: Last irreversible block number
                        type: integer
                      network_version:
                        description: Incremental value above a computed base
                        type: integer
                      node_id:
                        $ref: "#/paths/~1net~1status/post/responses/200/content/application~1json/schem\
                          a/properties/last_handshake/properties/token"
                      os:
                        description: Operating system name
                        type: string
                      p2p_address:
                        description: IP address or URL of the peer
                        type: string
                      sig:
                        description: Base58 encoded EOSIO cryptographic signature
                        pattern: ^SIG_([RK]1|WA)_[1-9A-HJ-NP-Za-km-z]+$
                        title: Signature
                        type: string
                      time:
                        description: Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss
                        pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}$
                        title: DateTimeSeconds
                        type: string
                      token:
                        pattern: ^[0-9A-Fa-f]{64}$
                        title: Sha256
                        type: string
                    type: object
                  peer:
                    description: The IP address or URL of the peer
                    type: string
                  syncing:
                    description: True if the peer is syncing, otherwise false
                    type: boolean
                type: object
          description: OK
      summary: status
components:
  schemas: {}
