RPCs - Index

Protocol

Some RPCs are specific to a particular version of the Tezos protocol. Those of the protocol currently active on Mainnet are described here.

Shell

  • /

    • /chains

      • /chains/<chain_id> (PATCH)

        • /chains/<chain_id>/blocks (GET)

          • /chains/<chain_id>/blocks/<block_id> (<dyn>)

        • /chains/<chain_id>/chain_id (GET)

        • /chains/<chain_id>/checkpoint (GET)

        • /chains/<chain_id>/invalid_blocks (GET)

          • /chains/<chain_id>/invalid_blocks/<block_hash> (GET DELETE)

        • /chains/<chain_id>/is_bootstrapped (GET)

        • /chains/<chain_id>/mempool (<dyn>)

    • /config

      • /config/network

        • /config/network/user_activated_protocol_overrides (GET)

        • /config/network/user_activated_upgrades (GET)

    • /errors (GET)

    • /fetch_protocol

      • /fetch_protocol/<Protocol_hash> (GET)

    • /injection

      • /injection/block (POST)

      • /injection/operation (POST)

      • /injection/protocol (POST)

    • /monitor

      • /monitor/active_chains (GET)

      • /monitor/bootstrapped (GET)

      • /monitor/commit_hash (GET)

      • /monitor/heads

        • /monitor/heads/<chain_id> (GET)

      • /monitor/protocols (GET)

      • /monitor/valid_blocks (GET)

    • /network

      • /network/connections (GET)

        • /network/connections/<peer_id> (GET DELETE)

      • /network/greylist (DELETE)

        • /network/greylist/clear (GET)

        • /network/greylist/ips (GET)

        • /network/greylist/peers (GET)

      • /network/log (GET)

      • /network/peers (GET)

        • /network/peers/<peer_id> (GET PATCH)

          • /network/peers/<peer_id>/ban (GET)

          • /network/peers/<peer_id>/banned (GET)

          • /network/peers/<peer_id>/log (GET)

          • /network/peers/<peer_id>/trust (GET)

          • /network/peers/<peer_id>/unban (GET)

          • /network/peers/<peer_id>/untrust (GET)

      • /network/points (GET)

        • /network/points/<point> (GET PUT PATCH)

          • /network/points/<point>/ban (GET)

          • /network/points/<point>/banned (GET)

          • /network/points/<point>/log (GET)

          • /network/points/<point>/trust (GET)

          • /network/points/<point>/unban (GET)

          • /network/points/<point>/untrust (GET)

      • /network/self (GET)

      • /network/stat (GET)

      • /network/version (GET)

      • /network/versions (GET)

    • /protocols (GET)

      • /protocols/<Protocol_hash> (GET)

        • /protocols/<Protocol_hash>/environment (GET)

    • /stats

      • /stats/gc (GET)

      • /stats/memory (GET)

    • /version (GET)

    • /workers

      • /workers/block_validator (GET)

      • /workers/chain_validators (GET)

        • /workers/chain_validators/<chain_id> (GET)

          • /workers/chain_validators/<chain_id>/ddb (GET)

          • /workers/chain_validators/<chain_id>/peers_validators (GET)

            • /workers/chain_validators/<chain_id>/peers_validators/<peer_id> (GET)

      • /workers/prevalidators (GET)

        • /workers/prevalidators/<chain_id> (GET)

RPCs - Full description

Shell

PATCH /chains/<chain_id>

Forcefully set the bootstrapped flag of the node

  { "bootstrapped": boolean }
  +--------------+--------+-------------------------------------+
  | Name         | Size   | Contents                            |
  +==============+========+=====================================+
  | bootstrapped | 1 byte | boolean (0 for false, 255 for true) |
  +--------------+--------+-------------------------------------+


  
  any
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /chains/<chain_id>/blocks?[length=<int>]&(head=<block_hash>)*&[min_date=<date>]

Lists block hashes from '', up to the last checkpoint, sorted with decreasing fitness. Without arguments it returns the head of the chain. Optional arguments allow to return the list of predecessors of a given block or of a set of blocks.

Optional query arguments :

  • length = <int> : The requested number of predecessors to return (per request; see next argument).
  • head = <block_hash> : An empty argument requests blocks starting with the current head. A non empty list allows to request one or more specific fragments of the chain.
  • min_date = <date> : When `min_date` is provided, blocks with a timestamp before `min_date` are filtered out

  [ [ $block_hash ... ] ... ]
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+

  

GET /chains/<chain_id>/chain_id

The chain unique identifier.

  $Chain_id
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------+---------+----------+
  | Name     | Size    | Contents |
  +==========+=========+==========+
  | Chain_id | 4 bytes | bytes    |
  +----------+---------+----------+


  

GET /chains/<chain_id>/checkpoint

The current checkpoint for this chain.

  { "block": $block_header,
    "savepoint": integer ∈ [-2^31-1, 2^31],
    "caboose": integer ∈ [-2^31-1, 2^31],
    "history_mode": $history_mode }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header:
    /* Block header
       Block header. It contains both shell and protocol specific data. */
    { "level": integer ∈ [-2^31-1, 2^31],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "protocol_data": /^[a-zA-Z0-9]+$/ }
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $history_mode:
    /* history mode
       Storage mode for the Tezos shell. */
    "archive"
    || { /* full
            Full mode retains every block and operations since the genesis
            block but periodically prunes older blocks' metadata to reduce
            the storage size. */
         "full":
           { "additional_cycles":
               integer ∈ [0, 1000.000000]
               /* additional cycles
                  Number of additional cycles preserved below the savepoint.
                  By default: 5 additional cycles will be stored. */ } }
    || { /* rolling
            Rolling mode only retain the most recent cycles by periodically
            periodically discarding older blocks to reduce the storage size. */
         "rolling":
           { "additional_cycles":
               integer ∈ [0, 1000.000000]
               /* additional cycles
                  Number of additional cycles preserved below the savepoint.
                  By default: 5 additional cycles will be stored. */ } }
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | block                 | Variable             | $block_header           |
  +-----------------------+----------------------+-------------------------+
  | savepoint             | 4 bytes              | signed 32-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | caboose               | 4 bytes              | signed 32-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | history_mode          | Determined from data | $history_mode           |
  +-----------------------+----------------------+-------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header
  ************

  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  history_mode (Determined from data, 8-bit tag)
  **********************************************

  archive (tag 0)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  full (tag 1)
  ============

  +------+---------+------------------------------------------------+
  | Name | Size    | Contents                                       |
  +======+=========+================================================+
  | Tag  | 1 byte  | unsigned 8-bit integer                         |
  +------+---------+------------------------------------------------+
  | full | 2 bytes | unsigned 16-bit integer in the range 0 to 1000 |
  +------+---------+------------------------------------------------+


  rolling (tag 2)
  ===============

  +---------+---------+------------------------------------------------+
  | Name    | Size    | Contents                                       |
  +=========+=========+================================================+
  | Tag     | 1 byte  | unsigned 8-bit integer                         |
  +---------+---------+------------------------------------------------+
  | rolling | 2 bytes | unsigned 16-bit integer in the range 0 to 1000 |
  +---------+---------+------------------------------------------------+

  

GET /chains/<chain_id>/invalid_blocks

Lists blocks that have been declared invalid along with the errors that led to them being declared invalid.

  [ { "block": $block_hash,
      "level": integer ∈ [-2^31-1, 2^31],
      "errors": $error } ... ]
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | block                    | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | level                    | 4 bytes  | signed 32-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+

  

GET /chains/<chain_id>/invalid_blocks/<block_hash>

The errors that appears during the block (in)validation.

  { "block": $block_hash,
    "level": integer ∈ [-2^31-1, 2^31],
    "errors": $error }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | block                    | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | level                    | 4 bytes  | signed 32-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  

DELETE /chains/<chain_id>/invalid_blocks/<block_hash>

Remove an invalid block for the tezos storage

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /chains/<chain_id>/is_bootstrapped

The bootstrap status of a chain

  { "bootstrapped": boolean,
    "sync_state": $chain_status }
  $chain_status:
    /* If 'unsynced', the node is not currently synchronized with of its
       peers (it is probably still bootstrapping and its head is lagging
       behind the chain's).
       If 'synced', the node considers itself synchronized with its peers and
       the current head timestamp is recent.
       If 'stuck', the node considers itself synchronized with its peers but
       the chain seems to be halted from its viewpoint. */
    "stuck" | "synced" | "unsynced"
  +--------------+--------+-------------------------------------------------------------------+
  | Name         | Size   | Contents                                                          |
  +==============+========+===================================================================+
  | bootstrapped | 1 byte | boolean (0 for false, 255 for true)                               |
  +--------------+--------+-------------------------------------------------------------------+
  | sync_state   | 1 byte | unsigned 8-bit integer encoding an enumeration (see chain_status) |
  +--------------+--------+-------------------------------------------------------------------+


  chain_status (Enumeration: unsigned 8-bit integer):
  ***************************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | synced         |
  +-------------+----------------+
  | 1           | unsynced       |
  +-------------+----------------+
  | 2           | stuck          |
  +-------------+----------------+

  

GET /config/network/user_activated_protocol_overrides

List of protocols which replace other protocols

  $user_activated.protocol_overrides
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  $user_activated.protocol_overrides:
    /* User activated protocol overrides
       User activated protocol overrides: activate a protocol instead of
       another. */
    [ { "replaced_protocol": $Protocol_hash,
        "replacement_protocol": $Protocol_hash } ... ]
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +----------------------+----------+----------+
  | Name                 | Size     | Contents |
  +======================+==========+==========+
  | replaced_protocol    | 32 bytes | bytes    |
  +----------------------+----------+----------+
  | replacement_protocol | 32 bytes | bytes    |
  +----------------------+----------+----------+

  

GET /config/network/user_activated_upgrades

List of protocols to switch to at given levels

  $user_activated.upgrades
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  $user_activated.upgrades:
    /* User activated upgrades
       User activated upgrades: at given level, switch to given protocol. */
    [ { "level": integer ∈ [-2^31-1, 2^31],
        "replacement_protocol": $Protocol_hash } ... ]
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +----------------------+----------+-----------------------+
  | Name                 | Size     | Contents              |
  +======================+==========+=======================+
  | level                | 4 bytes  | signed 32-bit integer |
  +----------------------+----------+-----------------------+
  | replacement_protocol | 32 bytes | bytes                 |
  +----------------------+----------+-----------------------+

  

GET /errors

Schema for all the RPC errors from the shell

  any
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET /fetch_protocol/<Protocol_hash>

Fetch a protocol from the network.

  any
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

POST /injection/block?[async]&[force]&[chain=<chain_id>]

Inject a block in the node and broadcast it. The `operations` embedded in `blockHeader` might be pre-validated using a contextual RPCs from the latest block (e.g. '/blocks/head/context/preapply'). Returns the ID of the block. By default, the RPC will wait for the block to be validated before answering. If ?async is true, the function returns immediately. Otherwise, the block will be validated before the result is returned. If ?force is true, it will be injected even on non strictly increasing fitness. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

Optional query arguments :

  • async
  • force
  • chain = <chain_id>

  { "data": /^[a-zA-Z0-9]+$/,
    "operations": [ [ $operation ... ] ... ] }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $operation:
    /* An operation. The shell_header part indicates a block an operation is
       meant to apply on top of. The proto part is protocol-specific and
       appears as a binary blob. */
    { "branch": $block_hash,
      "data": /^[a-zA-Z0-9]+$/ }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | data                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | operations            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | branch                   | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | data                     | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | Unnamed field 0          | Variable | sequence of $X_1        |
  +--------------------------+----------+-------------------------+

  
  $block_hash
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------------+----------+----------+
  | Name       | Size     | Contents |
  +============+==========+==========+
  | block_hash | 32 bytes | bytes    |
  +------------+----------+----------+


  

POST /injection/operation?[async]&[chain=<chain_id>]

Inject an operation in node and broadcast it. Returns the ID of the operation. The `signedOperationContents` should be constructed using a contextual RPCs from the latest block and signed by the client. By default, the RPC will wait for the operation to be (pre-)validated before answering. See RPCs under /blocks/prevalidation for more details on the prevalidation context. If ?async is true, the function returns immediately. Otherwise, the operation will be validated before the result is returned. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

Optional query arguments :

  • async
  • chain = <chain_id>

  /^[a-zA-Z0-9]+$/
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  
  $Operation_hash
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------+----------+----------+
  | Name           | Size     | Contents |
  +================+==========+==========+
  | Operation_hash | 32 bytes | bytes    |
  +----------------+----------+----------+


  

POST /injection/protocol?[async]

Inject a protocol in node. Returns the ID of the protocol. If ?async is true, the function returns immediately. Otherwise, the protocol will be validated before the result is returned.

Optional query arguments :

  • async

  $protocol
  $protocol:
    /* The environment a protocol relies on and the components a protocol is
       made of. */
    { "expected_env_version": $protocol.environment_version,
      "components":
        [ { "name": $unistring,
            "interface"?: $unistring,
            "implementation": $unistring } ... ] }
  $protocol.environment_version: integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | expected_env_version  | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | components            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +---------------------------------+----------------------+-------------------------------------+
  | Name                            | Size                 | Contents                            |
  +=================================+======================+=====================================+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | name                            | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+
  | ? presence of field "interface" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------+----------------------+-------------------------------------+
  | interface                       | Determined from data | $X_1                                |
  +---------------------------------+----------------------+-------------------------------------+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | implementation                  | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+

  
  $Protocol_hash
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------+----------+----------+
  | Name          | Size     | Contents |
  +===============+==========+==========+
  | Protocol_hash | 32 bytes | bytes    |
  +---------------+----------+----------+


  

GET /monitor/active_chains

Monitor every chain creation and destruction. Currently active chains will be given as first elements

  [ { /* Main */
      "chain_id": $Chain_id }
    || { /* Test */
         "chain_id": $Chain_id,
         "test_protocol": $Protocol_hash,
         "expiration_date": $timestamp.protocol }
    || { /* Stopping */
         "stopping": $Chain_id } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Main (tag 0)
  ============

  +----------+---------+------------------------+
  | Name     | Size    | Contents               |
  +==========+=========+========================+
  | Tag      | 1 byte  | unsigned 8-bit integer |
  +----------+---------+------------------------+
  | chain_id | 4 bytes | bytes                  |
  +----------+---------+------------------------+


  Test (tag 1)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | chain_id        | 4 bytes  | bytes                  |
  +-----------------+----------+------------------------+
  | test_protocol   | 32 bytes | bytes                  |
  +-----------------+----------+------------------------+
  | expiration_date | 8 bytes  | signed 64-bit integer  |
  +-----------------+----------+------------------------+


  Stopping (tag 2)
  ================

  +----------+---------+------------------------+
  | Name     | Size    | Contents               |
  +==========+=========+========================+
  | Tag      | 1 byte  | unsigned 8-bit integer |
  +----------+---------+------------------------+
  | stopping | 4 bytes | bytes                  |
  +----------+---------+------------------------+

  

GET /monitor/bootstrapped

Wait for the node to have synchronized its chain with a few peers (configured by the node's administrator), streaming head updates that happen during the bootstrapping process, and closing the stream at the end. If the node was already bootstrapped, returns the current head immediately.

  { "block": $block_hash,
    "timestamp": $timestamp.protocol }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------+----------+-----------------------+
  | Name      | Size     | Contents              |
  +===========+==========+=======================+
  | block     | 32 bytes | bytes                 |
  +-----------+----------+-----------------------+
  | timestamp | 8 bytes  | signed 64-bit integer |
  +-----------+----------+-----------------------+


  

GET /monitor/commit_hash

DEPRECATED: use `version` instead.

  $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET /monitor/heads/<chain_id>?(next_protocol=<Protocol_hash>)*

Monitor all blocks that are successfully validated by the node and selected as the new head of the given chain.

Optional query arguments :

  • next_protocol = <Protocol_hash>

  { /* Block header
       Block header. It contains both shell and protocol specific data. */
    "hash": $block_hash,
    "level": integer ∈ [-2^31-1, 2^31],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp.protocol,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | hash                       | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /monitor/protocols

Monitor all economic protocols that are retrieved and successfully loaded and compiled by the node.

  $Protocol_hash
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------+----------+----------+
  | Name          | Size     | Contents |
  +===============+==========+==========+
  | Protocol_hash | 32 bytes | bytes    |
  +---------------+----------+----------+


  

GET /monitor/valid_blocks?(protocol=<Protocol_hash>)*&(next_protocol=<Protocol_hash>)*&(chain=<chain_id>)*

Monitor all blocks that are successfully validated by the node, disregarding whether they were selected as the new head or not.

Optional query arguments :

  • protocol = <Protocol_hash>
  • next_protocol = <Protocol_hash>
  • chain = <chain_id>

  { /* Block header
       Block header. It contains both shell and protocol specific data. */
    "chain_id": $Chain_id,
    "hash": $block_hash,
    "level": integer ∈ [-2^31-1, 2^31],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp.protocol,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | chain_id                   | 4 bytes  | bytes                     |
  +----------------------------+----------+---------------------------+
  | hash                       | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /network/connections

List the running P2P connection.

  [ { "incoming": boolean,
      "peer_id": $Crypto_box.Public_key_hash,
      "id_point": $p2p_connection.id,
      "remote_socket_port": integer ∈ [0, 2^16-1],
      "announced_version": $network_version,
      "private": boolean,
      "local_metadata":
        { "disable_mempool": boolean,
          "private_node": boolean },
      "remote_metadata":
        { "disable_mempool": boolean,
          "private_node": boolean } } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  X_2
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  X_0
  ***

  +--------------------+----------------------+-------------------------------------+
  | Name               | Size                 | Contents                            |
  +====================+======================+=====================================+
  | incoming           | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | peer_id            | 16 bytes             | bytes                               |
  +--------------------+----------------------+-------------------------------------+
  | id_point           | Determined from data | $p2p_connection.id                  |
  +--------------------+----------------------+-------------------------------------+
  | remote_socket_port | 2 bytes              | unsigned 16-bit integer             |
  +--------------------+----------------------+-------------------------------------+
  | announced_version  | Determined from data | $network_version                    |
  +--------------------+----------------------+-------------------------------------+
  | private            | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | local_metadata     | 2 bytes              | $X_2                                |
  +--------------------+----------------------+-------------------------------------+
  | remote_metadata    | 2 bytes              | $X_2                                |
  +--------------------+----------------------+-------------------------------------+

  

GET /network/connections/<peer_id>

Details about the current P2P connection to the given peer.

  { "incoming": boolean,
    "peer_id": $Crypto_box.Public_key_hash,
    "id_point": $p2p_connection.id,
    "remote_socket_port": integer ∈ [0, 2^16-1],
    "announced_version": $network_version,
    "private": boolean,
    "local_metadata": { "disable_mempool": boolean,
                        "private_node": boolean },
    "remote_metadata":
      { "disable_mempool": boolean,
        "private_node": boolean } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +--------------------+----------------------+-------------------------------------+
  | Name               | Size                 | Contents                            |
  +====================+======================+=====================================+
  | incoming           | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | peer_id            | 16 bytes             | bytes                               |
  +--------------------+----------------------+-------------------------------------+
  | id_point           | Determined from data | $p2p_connection.id                  |
  +--------------------+----------------------+-------------------------------------+
  | remote_socket_port | 2 bytes              | unsigned 16-bit integer             |
  +--------------------+----------------------+-------------------------------------+
  | announced_version  | Determined from data | $network_version                    |
  +--------------------+----------------------+-------------------------------------+
  | private            | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | local_metadata     | 2 bytes              | $X_0                                |
  +--------------------+----------------------+-------------------------------------+
  | remote_metadata    | 2 bytes              | $X_1                                |
  +--------------------+----------------------+-------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+

  

DELETE /network/connections/<peer_id>?[wait]

Forced close of the current P2P connection to the given peer.

Optional query arguments :

  • wait

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

DELETE /network/greylist

Clear all greylists tables. This will unban all addresses and peers automatically greylisted by the system.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/greylist/clear

DEPRECATED: Clear all greylists tables. This will unban all addresses and peers automatically greylisted by the system. Use DELETE `/network/greylist` instead

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/greylist/ips

Returns an object that contains a list of IP and the field "not_reliable_since". If the field "not_reliable_since" is None then the list contains the currently greylisted IP addresses. If the field "not_reliable_since" Contains a date, this means that the greylist has been overflowed and it is no more possible to obtain the exact list of greylisted IPs. Since the greylist of IP addresses has been design to work whatever his size, there is no security issue related to this overflow. Reinitialize the ACL structure by calling "delete /network/greylist" to get back this list reliable.

  { "ips": [ $p2p_address ... ],
    "not_reliable_since": $timestamp.system /* Some */ || null /* None */ }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+--------------------------+
  | Name                  | Size                 | Contents                 |
  +=======================+======================+==========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer  |
  +-----------------------+----------------------+--------------------------+
  | ips                   | Variable             | sequence of $p2p_address |
  +-----------------------+----------------------+--------------------------+
  | not_reliable_since    | Determined from data | $X_0                     |
  +-----------------------+----------------------+--------------------------+


  p2p_address
  ***********

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  None (tag 0)
  ============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Some (tag 1)
  ============

  +-----------------+---------+------------------------+
  | Name            | Size    | Contents               |
  +=================+=========+========================+
  | Tag             | 1 byte  | unsigned 8-bit integer |
  +-----------------+---------+------------------------+
  | Unnamed field 0 | 8 bytes | signed 64-bit integer  |
  +-----------------+---------+------------------------+

  

GET /network/greylist/peers

List of the last greylisted peers.

  [ $Crypto_box.Public_key_hash ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  

GET /network/log

Stream of all network events

  $p2p_connection.pool_event
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_connection.pool_event:
    /* An event that may happen during maintenance of and other operations on
       the p2p connection pool. Typically, it includes connection errors,
       peer swaps, etc. */
    { /* Too_few_connections */
      "event": "too_few_connections" }
    || { /* Too_many_connections */
         "event": "too_many_connections" }
    || { /* New_point */
         "event": "new_point",
         "point": $p2p_point.id }
    || { /* New_peer */
         "event": "new_peer",
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* Incoming_connection */
         "event": "incoming_connection",
         "point": $p2p_point.id }
    || { /* Outgoing_connection */
         "event": "outgoing_connection",
         "point": $p2p_point.id }
    || { /* Authentication_failed */
         "event": "authentication_failed",
         "point": $p2p_point.id }
    || { /* Accepting_request */
         "event": "accepting_request",
         "point": $p2p_point.id,
         "id_point": $p2p_connection.id,
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* Rejecting_request */
         "event": "rejecting_request",
         "point": $p2p_point.id,
         "id_point": $p2p_connection.id,
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* Request_rejected */
         "event": "request_rejected",
         "point": $p2p_point.id,
         "identity"?: [ $p2p_connection.id, $Crypto_box.Public_key_hash ] }
    || { /* Connection_established */
         "event": "connection_established",
         "id_point": $p2p_connection.id,
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* Disconnection */
         "event": "disconnection",
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* External_disconnection */
         "event": "external_disconnection",
         "peer_id": $Crypto_box.Public_key_hash }
    || { /* Gc_points */
         "event": "gc_points" }
    || { /* Gc_peer_ids */
         "event": "gc_peer_ids" }
    || { /* Swap_request_received */
         "event": "swap_request_received",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_ack_received */
         "event": "swap_ack_received",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_request_sent */
         "event": "swap_request_sent",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_ack_sent */
         "event": "swap_ack_sent",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_request_ignored */
         "event": "swap_request_ignored",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_success */
         "event": "swap_success",
         "source": $Crypto_box.Public_key_hash }
    || { /* Swap_failure */
         "event": "swap_failure",
         "source": $Crypto_box.Public_key_hash }
    || { /* Bootstrap_sent */
         "event": "bootstrap_sent",
         "source": $Crypto_box.Public_key_hash }
    || { /* Bootstrap_received */
         "event": "bootstrap_received",
         "source": $Crypto_box.Public_key_hash }
    || { /* Advertise_sent */
         "event": "advertise_sent",
         "source": $Crypto_box.Public_key_hash }
    || { /* Advertise_received */
         "event": "advertise_received",
         "source": $Crypto_box.Public_key_hash }
  $p2p_point.id:
    /* Identifier for a peer point */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+


  X_0
  ***

  +-----------------+----------------------+--------------------+
  | Name            | Size                 | Contents           |
  +=================+======================+====================+
  | Unnamed field 0 | Determined from data | $p2p_connection.id |
  +-----------------+----------------------+--------------------+
  | Unnamed field 1 | 16 bytes             | bytes              |
  +-----------------+----------------------+--------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  p2p_point.id
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Too_few_connections (tag 0)
  ===========================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Too_many_connections (tag 1)
  ============================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  New_point (tag 2)
  =================

  +-------+----------------------+------------------------+
  | Name  | Size                 | Contents               |
  +=======+======================+========================+
  | Tag   | 1 byte               | unsigned 8-bit integer |
  +-------+----------------------+------------------------+
  | point | Determined from data | $p2p_point.id          |
  +-------+----------------------+------------------------+


  New_peer (tag 3)
  ================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  Incoming_connection (tag 4)
  ===========================

  +-------+----------------------+------------------------+
  | Name  | Size                 | Contents               |
  +=======+======================+========================+
  | Tag   | 1 byte               | unsigned 8-bit integer |
  +-------+----------------------+------------------------+
  | point | Determined from data | $p2p_point.id          |
  +-------+----------------------+------------------------+


  Outgoing_connection (tag 5)
  ===========================

  +-------+----------------------+------------------------+
  | Name  | Size                 | Contents               |
  +=======+======================+========================+
  | Tag   | 1 byte               | unsigned 8-bit integer |
  +-------+----------------------+------------------------+
  | point | Determined from data | $p2p_point.id          |
  +-------+----------------------+------------------------+


  Authentication_failed (tag 6)
  =============================

  +-------+----------------------+------------------------+
  | Name  | Size                 | Contents               |
  +=======+======================+========================+
  | Tag   | 1 byte               | unsigned 8-bit integer |
  +-------+----------------------+------------------------+
  | point | Determined from data | $p2p_point.id          |
  +-------+----------------------+------------------------+


  Accepting_request (tag 7)
  =========================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | point    | Determined from data | $p2p_point.id          |
  +----------+----------------------+------------------------+
  | id_point | Determined from data | $p2p_connection.id     |
  +----------+----------------------+------------------------+
  | peer_id  | 16 bytes             | bytes                  |
  +----------+----------------------+------------------------+


  Rejecting_request (tag 8)
  =========================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | point    | Determined from data | $p2p_point.id          |
  +----------+----------------------+------------------------+
  | id_point | Determined from data | $p2p_connection.id     |
  +----------+----------------------+------------------------+
  | peer_id  | 16 bytes             | bytes                  |
  +----------+----------------------+------------------------+


  Request_rejected (tag 9)
  ========================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | point                          | Determined from data | $p2p_point.id                       |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "identity" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | identity                       | Determined from data | $X_0                                |
  +--------------------------------+----------------------+-------------------------------------+


  Connection_established (tag 10)
  ===============================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | id_point | Determined from data | $p2p_connection.id     |
  +----------+----------------------+------------------------+
  | peer_id  | 16 bytes             | bytes                  |
  +----------+----------------------+------------------------+


  Disconnection (tag 11)
  ======================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  External_disconnection (tag 12)
  ===============================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  Gc_points (tag 13)
  ==================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Gc_peer_ids (tag 14)
  ====================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Swap_request_received (tag 15)
  ==============================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_ack_received (tag 16)
  ==========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_request_sent (tag 17)
  ==========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_ack_sent (tag 18)
  ======================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_request_ignored (tag 19)
  =============================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_success (tag 20)
  =====================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_failure (tag 21)
  =====================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Bootstrap_sent (tag 22)
  =======================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Bootstrap_received (tag 23)
  ===========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Advertise_sent (tag 24)
  =======================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Advertise_received (tag 25)
  ===========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+

  

GET /network/peers?(filter=<p2p.point.state_filter>)*

List the peers the node ever met.

Optional query arguments :

  • filter = <p2p.point.state_filter>

  [ [ $Crypto_box.Public_key_hash,
      { "score": number,
        "trusted": boolean,
        "conn_metadata"?:
          { "disable_mempool": boolean,
            "private_node": boolean },
        "peer_metadata":
          { "responses":
              { "sent":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "failed":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "received":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "unexpected": $bignum,
                "outdated": $bignum },
            "requests":
              { "sent":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "received":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "failed":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum },
                "scheduled":
                  { /* peer_metadata.v1 */
                    "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "checkpoint": $bignum,
                    "protocol_branch": $bignum,
                    "predecessor_header": $bignum,
                    "other": $bignum }
                  || { /* peer_metadata.legacy_v0 */
                       "branch": $bignum,
                       "head": $bignum,
                       "block_header": $bignum,
                       "operations": $bignum,
                       "protocols": $bignum,
                       "operation_hashes_for_block": $bignum,
                       "operations_for_block": $bignum,
                       "other": $bignum } },
            "valid_blocks": $bignum,
            "old_heads": $bignum,
            "prevalidator_results":
              { "cannot_download": $bignum,
                "cannot_parse": $bignum,
                "refused_by_prefilter": $bignum,
                "refused_by_postfilter": $bignum,
                "applied": $bignum,
                "branch_delayed": $bignum,
                "branch_refused": $bignum,
                "refused": $bignum,
                "duplicate": $bignum,
                "outdated": $bignum },
            "unactivated_chains": $bignum,
            "inactive_chains": $bignum,
            "future_blocks_advertised": $bignum,
            "unadvertised":
              { "block": $bignum,
                "operations": $bignum,
                "protocol": $bignum },
            "advertisements":
              { "sent": { "head": $bignum,
                          "branch": $bignum },
                "received": { "head": $bignum,
                              "branch": $bignum } } },
        "state": $p2p_peer.state,
        "reachable_at"?: $p2p_connection.id,
        "stat": $p2p_stat,
        "last_failed_connection"?: [ $p2p_connection.id, $timestamp.system ],
        "last_rejected_connection"?:
          [ $p2p_connection.id, $timestamp.system ],
        "last_established_connection"?:
          [ $p2p_connection.id, $timestamp.system ],
        "last_disconnection"?: [ $p2p_connection.id, $timestamp.system ],
        "last_seen"?: [ $p2p_connection.id, $timestamp.system ],
        "last_miss"?: [ $p2p_connection.id, $timestamp.system ] } ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_peer.state:
    /* The state a peer connection can be in: accepted (when the connection
       is being established), running (when the connection is already
       established), disconnected (otherwise). */
    "running" | "accepted" | "disconnected"
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30, 2^30],
      "current_outflow": integer ∈ [-2^30, 2^30] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_2
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  X_4
  ***

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | sent       | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | failed     | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | received   | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | unexpected | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | outdated   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  X_12 (Determined from data, 8-bit tag)
  **************************************


  X_8
  ***

  +-----------+----------------------+----------+
  | Name      | Size                 | Contents |
  +===========+======================+==========+
  | sent      | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | received  | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | failed    | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | scheduled | Determined from data | $X_12    |
  +-----------+----------------------+----------+


  X_13
  ****

  +-----------------------+----------------------+----------+
  | Name                  | Size                 | Contents |
  +=======================+======================+==========+
  | cannot_download       | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | cannot_parse          | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_prefilter  | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_postfilter | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | applied               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_delayed        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_refused        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | duplicate             | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | outdated              | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+


  X_14
  ****

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | block      | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | operations | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | protocol   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  X_17
  ****

  +--------+----------------------+----------+
  | Name   | Size                 | Contents |
  +========+======================+==========+
  | head   | Determined from data | $Z.t     |
  +--------+----------------------+----------+
  | branch | Determined from data | $Z.t     |
  +--------+----------------------+----------+


  X_15
  ****

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | sent     | Determined from data | $X_17    |
  +----------+----------------------+----------+
  | received | Determined from data | $X_17    |
  +----------+----------------------+----------+


  X_3
  ***

  +--------------------------+----------------------+----------+
  | Name                     | Size                 | Contents |
  +==========================+======================+==========+
  | responses                | Determined from data | $X_4     |
  +--------------------------+----------------------+----------+
  | requests                 | Determined from data | $X_8     |
  +--------------------------+----------------------+----------+
  | valid_blocks             | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | old_heads                | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | prevalidator_results     | Determined from data | $X_13    |
  +--------------------------+----------------------+----------+
  | unactivated_chains       | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | inactive_chains          | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | future_blocks_advertised | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | unadvertised             | Determined from data | $X_14    |
  +--------------------------+----------------------+----------+
  | advertisements           | Determined from data | $X_15    |
  +--------------------------+----------------------+----------+


  p2p_peer.state (Enumeration: unsigned 8-bit integer):
  *****************************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | accepted       |
  +-------------+----------------+
  | 1           | running        |
  +-------------+----------------+
  | 2           | disconnected   |
  +-------------+----------------+


  p2p_stat
  ********

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  X_23
  ****

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $p2p_connection.id    |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+


  X_1
  ***

  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | Name                                              | Size                 | Contents                                                            |
  +===================================================+======================+=====================================================================+
  | score                                             | 8 bytes              | double-precision floating-point number                              |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "conn_metadata"               | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | conn_metadata                                     | 2 bytes              | $X_2                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | peer_metadata                                     | Determined from data | $X_3                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see p2p_peer.state) |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | reachable_at                                      | Determined from data | $p2p_connection.id                                                  |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | stat                                              | 24 bytes             | $p2p_stat                                                           |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+


  X_0
  ***

  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | 16 bytes             | bytes    |
  +-----------------+----------------------+----------+
  | Unnamed field 1 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+

  

GET /network/peers/<peer_id>

Details about a given peer.

  { "score": number,
    "trusted": boolean,
    "conn_metadata"?: { "disable_mempool": boolean,
                        "private_node": boolean },
    "peer_metadata":
      { "responses":
          { "sent":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "failed":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "received":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "unexpected": $bignum,
            "outdated": $bignum },
        "requests":
          { "sent":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "received":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "failed":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "scheduled":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum } },
        "valid_blocks": $bignum,
        "old_heads": $bignum,
        "prevalidator_results":
          { "cannot_download": $bignum,
            "cannot_parse": $bignum,
            "refused_by_prefilter": $bignum,
            "refused_by_postfilter": $bignum,
            "applied": $bignum,
            "branch_delayed": $bignum,
            "branch_refused": $bignum,
            "refused": $bignum,
            "duplicate": $bignum,
            "outdated": $bignum },
        "unactivated_chains": $bignum,
        "inactive_chains": $bignum,
        "future_blocks_advertised": $bignum,
        "unadvertised":
          { "block": $bignum,
            "operations": $bignum,
            "protocol": $bignum },
        "advertisements":
          { "sent": { "head": $bignum,
                      "branch": $bignum },
            "received": { "head": $bignum,
                          "branch": $bignum } } },
    "state": $p2p_peer.state,
    "reachable_at"?: $p2p_connection.id,
    "stat": $p2p_stat,
    "last_failed_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_rejected_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_established_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_disconnection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_seen"?: [ $p2p_connection.id, $timestamp.system ],
    "last_miss"?: [ $p2p_connection.id, $timestamp.system ] }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_peer.state:
    /* The state a peer connection can be in: accepted (when the connection
       is being established), running (when the connection is already
       established), disconnected (otherwise). */
    "running" | "accepted" | "disconnected"
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30, 2^30],
      "current_outflow": integer ∈ [-2^30, 2^30] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | Name                                              | Size                 | Contents                                                            |
  +===================================================+======================+=====================================================================+
  | score                                             | 8 bytes              | double-precision floating-point number                              |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "conn_metadata"               | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | conn_metadata                                     | 2 bytes              | $X_0                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | peer_metadata                                     | Determined from data | $X_1                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see p2p_peer.state) |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | reachable_at                                      | Determined from data | $p2p_connection.id                                                  |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | stat                                              | 24 bytes             | $p2p_stat                                                           |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_16                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_17                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_18                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_19                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_20                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_21                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+


  X_0
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  X_2
  ***

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | sent       | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | failed     | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | received   | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | unexpected | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | outdated   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  X_10 (Determined from data, 8-bit tag)
  **************************************


  X_6
  ***

  +-----------+----------------------+----------+
  | Name      | Size                 | Contents |
  +===========+======================+==========+
  | sent      | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | received  | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | failed    | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | scheduled | Determined from data | $X_10    |
  +-----------+----------------------+----------+


  X_11
  ****

  +-----------------------+----------------------+----------+
  | Name                  | Size                 | Contents |
  +=======================+======================+==========+
  | cannot_download       | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | cannot_parse          | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_prefilter  | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_postfilter | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | applied               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_delayed        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_refused        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | duplicate             | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | outdated              | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+


  X_12
  ****

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | block      | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | operations | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | protocol   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  X_15
  ****

  +--------+----------------------+----------+
  | Name   | Size                 | Contents |
  +========+======================+==========+
  | head   | Determined from data | $Z.t     |
  +--------+----------------------+----------+
  | branch | Determined from data | $Z.t     |
  +--------+----------------------+----------+


  X_13
  ****

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | sent     | Determined from data | $X_15    |
  +----------+----------------------+----------+
  | received | Determined from data | $X_15    |
  +----------+----------------------+----------+


  X_1
  ***

  +--------------------------+----------------------+----------+
  | Name                     | Size                 | Contents |
  +==========================+======================+==========+
  | responses                | Determined from data | $X_2     |
  +--------------------------+----------------------+----------+
  | requests                 | Determined from data | $X_6     |
  +--------------------------+----------------------+----------+
  | valid_blocks             | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | old_heads                | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | prevalidator_results     | Determined from data | $X_11    |
  +--------------------------+----------------------+----------+
  | unactivated_chains       | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | inactive_chains          | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | future_blocks_advertised | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | unadvertised             | Determined from data | $X_12    |
  +--------------------------+----------------------+----------+
  | advertisements           | Determined from data | $X_13    |
  +--------------------------+----------------------+----------+


  p2p_peer.state (Enumeration: unsigned 8-bit integer):
  *****************************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | accepted       |
  +-------------+----------------+
  | 1           | running        |
  +-------------+----------------+
  | 2           | disconnected   |
  +-------------+----------------+


  p2p_stat
  ********

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  X_21
  ****

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $p2p_connection.id    |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+

  

PATCH /network/peers/<peer_id>

Change the permissions of a given peer. With `{acl: ban}`: blacklist the given peer and remove it from the whitelist if present. With `{acl: open}`: removes the peer from the blacklist and whitelist. With `{acl: trust}`: trust the given peer permanently and remove it from the blacklist if present. The peer cannot be blocked (but its host IP still can).

  { "acl"?: "open" | "trust" | "ban" }
  +---------------------------+--------+----------------------------------------------------------+
  | Name                      | Size   | Contents                                                 |
  +===========================+========+==========================================================+
  | ? presence of field "acl" | 1 byte | boolean (0 for false, 255 for true)                      |
  +---------------------------+--------+----------------------------------------------------------+
  | acl                       | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_0) |
  +---------------------------+--------+----------------------------------------------------------+


  X_0 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | ban            |
  +-------------+----------------+
  | 1           | trust          |
  +-------------+----------------+
  | 2           | open           |
  +-------------+----------------+

  
  { "score": number,
    "trusted": boolean,
    "conn_metadata"?: { "disable_mempool": boolean,
                        "private_node": boolean },
    "peer_metadata":
      { "responses":
          { "sent":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "failed":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "received":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "unexpected": $bignum,
            "outdated": $bignum },
        "requests":
          { "sent":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "received":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "failed":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum },
            "scheduled":
              { /* peer_metadata.v1 */
                "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "checkpoint": $bignum,
                "protocol_branch": $bignum,
                "predecessor_header": $bignum,
                "other": $bignum }
              || { /* peer_metadata.legacy_v0 */
                   "branch": $bignum,
                   "head": $bignum,
                   "block_header": $bignum,
                   "operations": $bignum,
                   "protocols": $bignum,
                   "operation_hashes_for_block": $bignum,
                   "operations_for_block": $bignum,
                   "other": $bignum } },
        "valid_blocks": $bignum,
        "old_heads": $bignum,
        "prevalidator_results":
          { "cannot_download": $bignum,
            "cannot_parse": $bignum,
            "refused_by_prefilter": $bignum,
            "refused_by_postfilter": $bignum,
            "applied": $bignum,
            "branch_delayed": $bignum,
            "branch_refused": $bignum,
            "refused": $bignum,
            "duplicate": $bignum,
            "outdated": $bignum },
        "unactivated_chains": $bignum,
        "inactive_chains": $bignum,
        "future_blocks_advertised": $bignum,
        "unadvertised":
          { "block": $bignum,
            "operations": $bignum,
            "protocol": $bignum },
        "advertisements":
          { "sent": { "head": $bignum,
                      "branch": $bignum },
            "received": { "head": $bignum,
                          "branch": $bignum } } },
    "state": $p2p_peer.state,
    "reachable_at"?: $p2p_connection.id,
    "stat": $p2p_stat,
    "last_failed_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_rejected_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_established_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_disconnection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_seen"?: [ $p2p_connection.id, $timestamp.system ],
    "last_miss"?: [ $p2p_connection.id, $timestamp.system ] }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_peer.state:
    /* The state a peer connection can be in: accepted (when the connection
       is being established), running (when the connection is already
       established), disconnected (otherwise). */
    "running" | "accepted" | "disconnected"
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30, 2^30],
      "current_outflow": integer ∈ [-2^30, 2^30] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | Name                                              | Size                 | Contents                                                            |
  +===================================================+======================+=====================================================================+
  | score                                             | 8 bytes              | double-precision floating-point number                              |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "conn_metadata"               | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | conn_metadata                                     | 2 bytes              | $X_0                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | peer_metadata                                     | Determined from data | $X_1                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see p2p_peer.state) |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | reachable_at                                      | Determined from data | $p2p_connection.id                                                  |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | stat                                              | 24 bytes             | $p2p_stat                                                           |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_16                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_17                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_18                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_19                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_20                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_21                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+


  X_0
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  X_2
  ***

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | sent       | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | failed     | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | received   | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | unexpected | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | outdated   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  X_10 (Determined from data, 8-bit tag)
  **************************************


  X_6
  ***

  +-----------+----------------------+----------+
  | Name      | Size                 | Contents |
  +===========+======================+==========+
  | sent      | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | received  | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | failed    | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | scheduled | Determined from data | $X_10    |
  +-----------+----------------------+----------+


  X_11
  ****

  +-----------------------+----------------------+----------+
  | Name                  | Size                 | Contents |
  +=======================+======================+==========+
  | cannot_download       | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | cannot_parse          | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_prefilter  | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_postfilter | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | applied               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_delayed        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_refused        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | duplicate             | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | outdated              | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+


  X_12
  ****

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | block      | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | operations | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | protocol   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  X_15
  ****

  +--------+----------------------+----------+
  | Name   | Size                 | Contents |
  +========+======================+==========+
  | head   | Determined from data | $Z.t     |
  +--------+----------------------+----------+
  | branch | Determined from data | $Z.t     |
  +--------+----------------------+----------+


  X_13
  ****

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | sent     | Determined from data | $X_15    |
  +----------+----------------------+----------+
  | received | Determined from data | $X_15    |
  +----------+----------------------+----------+


  X_1
  ***

  +--------------------------+----------------------+----------+
  | Name                     | Size                 | Contents |
  +==========================+======================+==========+
  | responses                | Determined from data | $X_2     |
  +--------------------------+----------------------+----------+
  | requests                 | Determined from data | $X_6     |
  +--------------------------+----------------------+----------+
  | valid_blocks             | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | old_heads                | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | prevalidator_results     | Determined from data | $X_11    |
  +--------------------------+----------------------+----------+
  | unactivated_chains       | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | inactive_chains          | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | future_blocks_advertised | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | unadvertised             | Determined from data | $X_12    |
  +--------------------------+----------------------+----------+
  | advertisements           | Determined from data | $X_13    |
  +--------------------------+----------------------+----------+


  p2p_peer.state (Enumeration: unsigned 8-bit integer):
  *****************************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | accepted       |
  +-------------+----------------+
  | 1           | running        |
  +-------------+----------------+
  | 2           | disconnected   |
  +-------------+----------------+


  p2p_stat
  ********

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------+----------+-------------------------------------+
  | addr                           | Variable | bytes                               |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------+----------+-------------------------------------+


  X_21
  ****

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $p2p_connection.id    |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+

  

GET /network/peers/<peer_id>/ban

DEPRECATED: Blacklist the given peer and remove it from the whitelist if present. Use PATCH `network/peers/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/peers/<peer_id>/banned

Check if a given peer is blacklisted or greylisted.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET /network/peers/<peer_id>/log?[monitor]

Monitor network events related to a given peer.

Optional query arguments :

  • monitor

  [ $p2p_peer.pool_event ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_peer.pool_event:
    /* An event that may happen during maintenance of and other operations on
       the connection to a specific peer. */
    { "kind":
        "rejecting_request"
        | "incoming_request"
        | "disconnection"
        | "external_disconnection"
        | "connection_established"
        | "request_rejected",
      "timestamp": $timestamp.system,
      "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+----------------------------------+
  | Name                  | Size     | Contents                         |
  +=======================+==========+==================================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer          |
  +-----------------------+----------+----------------------------------+
  | Unnamed field 0       | Variable | sequence of $p2p_peer.pool_event |
  +-----------------------+----------+----------------------------------+


  X_0 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+------------------------+
  | Case number | Encoded string         |
  +=============+========================+
  | 0           | incoming_request       |
  +-------------+------------------------+
  | 1           | rejecting_request      |
  +-------------+------------------------+
  | 2           | request_rejected       |
  +-------------+------------------------+
  | 3           | connection_established |
  +-------------+------------------------+
  | 4           | disconnection          |
  +-------------+------------------------+
  | 5           | external_disconnection |
  +-------------+------------------------+


  p2p_peer.pool_event
  *******************

  +--------------------------------+----------+----------------------------------------------------------+
  | Name                           | Size     | Contents                                                 |
  +================================+==========+==========================================================+
  | kind                           | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_0) |
  +--------------------------------+----------+----------------------------------------------------------+
  | timestamp                      | 8 bytes  | signed 64-bit integer                                    |
  +--------------------------------+----------+----------------------------------------------------------+
  | # bytes in field "p2p_address" | 4 bytes  | unsigned 30-bit integer                                  |
  +--------------------------------+----------+----------------------------------------------------------+
  | addr                           | Variable | bytes                                                    |
  +--------------------------------+----------+----------------------------------------------------------+
  | ? presence of field "port"     | 1 byte   | boolean (0 for false, 255 for true)                      |
  +--------------------------------+----------+----------------------------------------------------------+
  | port                           | 2 bytes  | unsigned 16-bit integer                                  |
  +--------------------------------+----------+----------------------------------------------------------+

  

GET /network/peers/<peer_id>/trust

DEPRECATED: Whitelist a given peer permanently and remove it from the blacklist if present. The peer cannot be blocked (but its host IP still can). Use PATCH `network/peers/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/peers/<peer_id>/unban

DEPRECATED: Remove the given peer from the blacklist. Use PATCH `network/peers/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/peers/<peer_id>/untrust

DEPRECATED: Remove a given peer from the whitelist. Use PATCH `network/peers/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/points?(filter=<p2p.point.state_filter>)*

List the pool of known `IP:port` used for establishing P2P connections.

Optional query arguments :

  • filter = <p2p.point.state_filter>

  [ [ $p2p_point.id, $p2p_point.info ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.id:
    /* Identifier for a peer point */
    $unistring
  $p2p_point.info:
    /* Information about a peer point. Includes flags, state, and records
       about past events. */
    { "trusted": boolean,
      "greylisted_until"?: $timestamp.system,
      "state": $p2p_point.state,
      "p2p_peer_id"?: $Crypto_box.Public_key_hash,
      "last_failed_connection"?: $timestamp.system,
      "last_rejected_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_established_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_disconnection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_miss"?: $timestamp.system,
      "expected_peer_id"?: $Crypto_box.Public_key_hash }
  $p2p_point.state:
    /* The state a connection to a peer point can be in: requested
       (connection open from here), accepted (handshake), running (connection
       already established), disconnected (no connection). */
    { /* Requested */
      "event_kind": "requested" }
    || { /* Accepted */
         "event_kind": "accepted",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Running */
         "event_kind": "running",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Disconnected */
         "event_kind": "disconnected" }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  p2p_point.id
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  p2p_point.state (Determined from data, 8-bit tag)
  *************************************************

  Requested (tag 0)
  =================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Accepted (tag 1)
  ================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Running (tag 2)
  ===============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnected (tag 3)
  ====================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_4
  ***

  +-----------------+----------+-----------------------+
  | Name            | Size     | Contents              |
  +=================+==========+=======================+
  | Unnamed field 0 | 16 bytes | bytes                 |
  +-----------------+----------+-----------------------+
  | Unnamed field 1 | 8 bytes  | signed 64-bit integer |
  +-----------------+----------+-----------------------+


  p2p_point.info
  **************

  +---------------------------------------------------+----------------------+-------------------------------------+
  | Name                                              | Size                 | Contents                            |
  +===================================================+======================+=====================================+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "greylisted_until"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | greylisted_until                                  | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | state                                             | Determined from data | $p2p_point.state                    |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "p2p_peer_id"                 | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | p2p_peer_id                                       | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_failed_connection                            | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_rejected_connection                          | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "expected_peer_id"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | expected_peer_id                                  | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  X_0
  ***

  +-----------------+----------------------+-----------------+
  | Name            | Size                 | Contents        |
  +=================+======================+=================+
  | Unnamed field 0 | Determined from data | $p2p_point.id   |
  +-----------------+----------------------+-----------------+
  | Unnamed field 1 | Determined from data | $p2p_point.info |
  +-----------------+----------------------+-----------------+

  

GET /network/points/<point>

Details about a given `IP:addr`.

  $p2p_point.info
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.info:
    /* Information about a peer point. Includes flags, state, and records
       about past events. */
    { "trusted": boolean,
      "greylisted_until"?: $timestamp.system,
      "state": $p2p_point.state,
      "p2p_peer_id"?: $Crypto_box.Public_key_hash,
      "last_failed_connection"?: $timestamp.system,
      "last_rejected_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_established_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_disconnection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_miss"?: $timestamp.system,
      "expected_peer_id"?: $Crypto_box.Public_key_hash }
  $p2p_point.state:
    /* The state a connection to a peer point can be in: requested
       (connection open from here), accepted (handshake), running (connection
       already established), disconnected (no connection). */
    { /* Requested */
      "event_kind": "requested" }
    || { /* Accepted */
         "event_kind": "accepted",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Running */
         "event_kind": "running",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Disconnected */
         "event_kind": "disconnected" }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+-------------------------------------+
  | Name                                              | Size                 | Contents                            |
  +===================================================+======================+=====================================+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "greylisted_until"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | greylisted_until                                  | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | state                                             | Determined from data | $p2p_point.state                    |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "p2p_peer_id"                 | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | p2p_peer_id                                       | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_failed_connection                            | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_rejected_connection                          | 24 bytes             | $X_0                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_1                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_2                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_3                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "expected_peer_id"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | expected_peer_id                                  | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  p2p_point.state (Determined from data, 8-bit tag)
  *************************************************

  Requested (tag 0)
  =================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Accepted (tag 1)
  ================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Running (tag 2)
  ===============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnected (tag 3)
  ====================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_3
  ***

  +-----------------+----------+-----------------------+
  | Name            | Size     | Contents              |
  +=================+==========+=======================+
  | Unnamed field 0 | 16 bytes | bytes                 |
  +-----------------+----------+-----------------------+
  | Unnamed field 1 | 8 bytes  | signed 64-bit integer |
  +-----------------+----------+-----------------------+

  

PUT /network/points/<point>?[timeout=<timespan>]

Connect to a peer

Optional query arguments :

  • timeout = <timespan>

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  
  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

PATCH /network/points/<point>

Change the connectivity state of a given `IP:addr`. With `{acl : ban}`: blacklist the given address and remove it from the whitelist if present. With `{acl: open}`: removes an address from the blacklist and whitelist. With `{acl: trust}`: trust a given address permanently and remove it from the blacklist if present. With `{peer_id: }` set the peerId of the point. Connections from this address can still be closed on authentication if the peer is greylisted.

  { "acl"?: "open" | "trust" | "ban",
    "peer_id"?: $Crypto_box.Public_key_hash }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-------------------------------+----------+----------------------------------------------------------+
  | Name                          | Size     | Contents                                                 |
  +===============================+==========+==========================================================+
  | ? presence of field "acl"     | 1 byte   | boolean (0 for false, 255 for true)                      |
  +-------------------------------+----------+----------------------------------------------------------+
  | acl                           | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_0) |
  +-------------------------------+----------+----------------------------------------------------------+
  | ? presence of field "peer_id" | 1 byte   | boolean (0 for false, 255 for true)                      |
  +-------------------------------+----------+----------------------------------------------------------+
  | peer_id                       | 16 bytes | bytes                                                    |
  +-------------------------------+----------+----------------------------------------------------------+


  X_0 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | ban            |
  +-------------+----------------+
  | 1           | trust          |
  +-------------+----------------+
  | 2           | open           |
  +-------------+----------------+

  
  $p2p_point.info
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.info:
    /* Information about a peer point. Includes flags, state, and records
       about past events. */
    { "trusted": boolean,
      "greylisted_until"?: $timestamp.system,
      "state": $p2p_point.state,
      "p2p_peer_id"?: $Crypto_box.Public_key_hash,
      "last_failed_connection"?: $timestamp.system,
      "last_rejected_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_established_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_disconnection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_miss"?: $timestamp.system,
      "expected_peer_id"?: $Crypto_box.Public_key_hash }
  $p2p_point.state:
    /* The state a connection to a peer point can be in: requested
       (connection open from here), accepted (handshake), running (connection
       already established), disconnected (no connection). */
    { /* Requested */
      "event_kind": "requested" }
    || { /* Accepted */
         "event_kind": "accepted",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Running */
         "event_kind": "running",
         "p2p_peer_id": $Crypto_box.Public_key_hash }
    || { /* Disconnected */
         "event_kind": "disconnected" }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+-------------------------------------+
  | Name                                              | Size                 | Contents                            |
  +===================================================+======================+=====================================+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "greylisted_until"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | greylisted_until                                  | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | state                                             | Determined from data | $p2p_point.state                    |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "p2p_peer_id"                 | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | p2p_peer_id                                       | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_failed_connection                            | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_rejected_connection                          | 24 bytes             | $X_0                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_1                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_2                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_3                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "expected_peer_id"            | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | expected_peer_id                                  | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  p2p_point.state (Determined from data, 8-bit tag)
  *************************************************

  Requested (tag 0)
  =================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Accepted (tag 1)
  ================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Running (tag 2)
  ===============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnected (tag 3)
  ====================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_3
  ***

  +-----------------+----------+-----------------------+
  | Name            | Size     | Contents              |
  +=================+==========+=======================+
  | Unnamed field 0 | 16 bytes | bytes                 |
  +-----------------+----------+-----------------------+
  | Unnamed field 1 | 8 bytes  | signed 64-bit integer |
  +-----------------+----------+-----------------------+

  

GET /network/points/<point>/ban

DEPRECATED: Blacklist the given address and remove it from the whitelist if present. Use PATCH `/network/point/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/points/<point>/banned

Check if a given address is blacklisted or greylisted. Port component is unused.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET /network/points/<point>/log?[monitor]

Monitor network events related to an `IP:addr`.

Optional query arguments :

  • monitor

  [ $p2p_point.pool_event ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.pool_event:
    /* Events happening during maintenance of and operations on a peer point
       pool (such as connections, disconnections, connection requests). */
    [ $timestamp.system,
      { /* Outgoing_request */
        "event_kind": "outgoing_request" }
      || { /* Accepting_request */
           "event_kind": "accepting_request",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { /* Rejecting_request */
           "event_kind": "rejecting_request",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { /* Rejecting_rejected */
           "event_kind": "request_rejected",
           "p2p_peer_id"?: $Crypto_box.Public_key_hash }
      || { /* Connection_established */
           "event_kind": "rejecting_request",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { /* Disconnection */
           "event_kind": "rejecting_request",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { /* External_disconnection */
           "event_kind": "rejecting_request",
           "p2p_peer_id": $Crypto_box.Public_key_hash } ]
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-----------------------------------+
  | Name                  | Size     | Contents                          |
  +=======================+==========+===================================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer           |
  +-----------------------+----------+-----------------------------------+
  | Unnamed field 0       | Variable | sequence of $p2p_point.pool_event |
  +-----------------------+----------+-----------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Outgoing_request (tag 0)
  ========================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Accepting_request (tag 1)
  =========================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Rejecting_request (tag 2)
  =========================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Rejecting_rejected (tag 3)
  ==========================

  +-----------------------------------+----------+-------------------------------------+
  | Name                              | Size     | Contents                            |
  +===================================+==========+=====================================+
  | Tag                               | 1 byte   | unsigned 8-bit integer              |
  +-----------------------------------+----------+-------------------------------------+
  | ? presence of field "p2p_peer_id" | 1 byte   | boolean (0 for false, 255 for true) |
  +-----------------------------------+----------+-------------------------------------+
  | p2p_peer_id                       | 16 bytes | bytes                               |
  +-----------------------------------+----------+-------------------------------------+


  Connection_established (tag 4)
  ==============================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnection (tag 5)
  =====================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  External_disconnection (tag 6)
  ==============================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  p2p_point.pool_event
  ********************

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | Determined from data | $X_0                  |
  +-----------------+----------------------+-----------------------+

  

GET /network/points/<point>/trust

DEPRECATED: Trust a given address permanently and remove it from the blacklist if present. Connections from this address can still be closed on authentication if the peer is greylisted. Use PATCH`/network/point/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/points/<point>/unban

DEPRECATED: Remove an address from the blacklist. Use PATCH `/network/point/:peerid` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/points/<point>/untrust

DEPRECATED: Remove an address from the whitelist. Use PATCH `/network/point/` instead.

  {  }
  +------+------+----------+
  | Name | Size | Contents |
  +======+======+==========+



  

GET /network/self

Return the node's peer id

  $Crypto_box.Public_key_hash
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+----------+
  | Name                       | Size     | Contents |
  +============================+==========+==========+
  | Crypto_box.Public_key_hash | 16 bytes | bytes    |
  +----------------------------+----------+----------+


  

GET /network/stat

Global network bandwidth statistics in B/s.

  $p2p_stat
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30, 2^30],
      "current_outflow": integer ∈ [-2^30, 2^30] }
  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  

GET /network/version

DEPRECATED: use `version` instead.

  $network_version
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  

GET /network/versions

DEPRECATED: use `version` instead.

  [ $network_version ... ]
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+------------------------------+
  | Name                  | Size     | Contents                     |
  +=======================+==========+==============================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer      |
  +-----------------------+----------+------------------------------+
  | Unnamed field 0       | Variable | sequence of $network_version |
  +-----------------------+----------+------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+

  

GET /protocols

  [ $Protocol_hash ... ]
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  

GET /protocols/<Protocol_hash>

  $protocol
  $protocol:
    /* The environment a protocol relies on and the components a protocol is
       made of. */
    { "expected_env_version": $protocol.environment_version,
      "components":
        [ { "name": $unistring,
            "interface"?: $unistring,
            "implementation": $unistring } ... ] }
  $protocol.environment_version: integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | expected_env_version  | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | components            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +---------------------------------+----------------------+-------------------------------------+
  | Name                            | Size                 | Contents                            |
  +=================================+======================+=====================================+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | name                            | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+
  | ? presence of field "interface" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------+----------------------+-------------------------------------+
  | interface                       | Determined from data | $X_1                                |
  +---------------------------------+----------------------+-------------------------------------+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | implementation                  | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+

  

GET /protocols/<Protocol_hash>/environment

  $protocol.environment_version
  $protocol.environment_version: integer ∈ [0, 2^16-1]
  +-----------------+---------+-------------------------+
  | Name            | Size    | Contents                |
  +=================+=========+=========================+
  | Unnamed field 0 | 2 bytes | unsigned 16-bit integer |
  +-----------------+---------+-------------------------+


  

GET /stats/gc

Gets stats from the OCaml Garbage Collector

  { "minor_words": number,
    "promoted_words": number,
    "major_words": number,
    "minor_collections": integer ∈ [-2^30, 2^30],
    "major_collections": integer ∈ [-2^30, 2^30],
    "heap_words": integer ∈ [-2^30, 2^30],
    "heap_chunks": integer ∈ [-2^30, 2^30],
    "live_words": integer ∈ [-2^30, 2^30],
    "live_blocks": integer ∈ [-2^30, 2^30],
    "free_words": integer ∈ [-2^30, 2^30],
    "free_blocks": integer ∈ [-2^30, 2^30],
    "largest_free": integer ∈ [-2^30, 2^30],
    "fragments": integer ∈ [-2^30, 2^30],
    "compactions": integer ∈ [-2^30, 2^30],
    "top_heap_words": integer ∈ [-2^30, 2^30],
    "stack_size": integer ∈ [-2^30, 2^30] }
  +-------------------+---------+--------------------------------------------------------------+
  | Name              | Size    | Contents                                                     |
  +===================+=========+==============================================================+
  | minor_words       | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | promoted_words    | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | major_words       | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | minor_collections | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | major_collections | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | heap_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | heap_chunks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | live_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | live_blocks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | free_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | free_blocks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | largest_free      | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | fragments         | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | compactions       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | top_heap_words    | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | stack_size        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+


  

GET /stats/memory

Gets memory usage stats

  { /* Linux_proc_statm */
    "page_size": integer ∈ [-2^30, 2^30],
    "size": $int64,
    "resident": $int64,
    "shared": $int64,
    "text": $int64,
    "lib": $int64,
    "data": $int64,
    "dt": $int64 }
  || { /* Darwin_ps */
       "page_size": integer ∈ [-2^30, 2^30],
       "mem": number,
       "resident": $int64 }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_0     |
  +-----------------+----------------------+----------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Linux_proc_statm (tag 0)
  ========================

  +-----------+---------+--------------------------------------------------------------+
  | Name      | Size    | Contents                                                     |
  +===========+=========+==============================================================+
  | Tag       | 1 byte  | unsigned 8-bit integer                                       |
  +-----------+---------+--------------------------------------------------------------+
  | page_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------+---------+--------------------------------------------------------------+
  | size      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | resident  | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | shared    | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | text      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | lib       | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | data      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | dt        | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+


  Darwin_ps (tag 1)
  =================

  +-----------+---------+--------------------------------------------------------------+
  | Name      | Size    | Contents                                                     |
  +===========+=========+==============================================================+
  | Tag       | 1 byte  | unsigned 8-bit integer                                       |
  +-----------+---------+--------------------------------------------------------------+
  | page_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------+---------+--------------------------------------------------------------+
  | mem       | 8 bytes | double-precision floating-point number                       |
  +-----------+---------+--------------------------------------------------------------+
  | resident  | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+

  

GET /version

Get information on the node version

  { "version":
      { "major": integer ∈ [-2^30, 2^30],
        "minor": integer ∈ [-2^30, 2^30],
        "additional_info":
          "dev" || { /* RC */
                     "rc": integer ∈ [-2^30, 2^30] } || "release" },
    "network_version": $network_version,
    "commit_info":
      { /* Some */
        "commit_hash": $unistring,
        "commit_date": $unistring }
      || null
      /* None */ }
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+------------------+
  | Name            | Size                 | Contents         |
  +=================+======================+==================+
  | version         | Determined from data | $X_0             |
  +-----------------+----------------------+------------------+
  | network_version | Determined from data | $network_version |
  +-----------------+----------------------+------------------+
  | commit_info     | Determined from data | $X_2             |
  +-----------------+----------------------+------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Dev (tag 0)
  ===========

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  RC (tag 1)
  ==========

  +------+---------+--------------------------------------------------------------+
  | Name | Size    | Contents                                                     |
  +======+=========+==============================================================+
  | Tag  | 1 byte  | unsigned 8-bit integer                                       |
  +------+---------+--------------------------------------------------------------+
  | rc   | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------+---------+--------------------------------------------------------------+


  Release (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_0
  ***

  +-----------------+----------------------+--------------------------------------------------------------+
  | Name            | Size                 | Contents                                                     |
  +=================+======================+==============================================================+
  | major           | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+----------------------+--------------------------------------------------------------+
  | minor           | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+----------------------+--------------------------------------------------------------+
  | additional_info | Determined from data | $X_1                                                         |
  +-----------------+----------------------+--------------------------------------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  X_2 (Determined from data, 8-bit tag)
  *************************************

  None (tag 0)
  ============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Some (tag 1)
  ============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | commit_hash           | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | commit_date           | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /workers/block_validator

Introspect the state of the block_validator worker.

  { "status":
      { /* Launching */
        "phase": "launching",
        "since": $timestamp.system }
      || { /* Running */
           "phase": "running",
           "since": $timestamp.system }
      || { /* Closing */
           "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Closed */
           "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Crashed */
           "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { "block": $block_hash,
              "chain_id": $Chain_id,
              "peer"?: $Crypto_box.Public_key_hash } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { /* validation_success */
                "successful_validation":
                  { "block": $block_hash,
                    "chain_id": $Chain_id,
                    "peer"?: $Crypto_box.Public_key_hash },
                "status":
                  { "pushed": $timestamp.system,
                    "treated": $timespan.system,
                    "completed": $timespan.system } }
              || { /* validation_failure */
                   "failed_validation":
                     { "block": $block_hash,
                       "chain_id": $Chain_id,
                       "peer"?: $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timespan.system,
                       "completed": $timespan.system },
                   "errors"?: $error }
              || { /* could_not_find_context */
                   "block": $block_hash }
              || { /* previously_validated */
                   "block": $block_hash }
              || { /* validating_block */
                   "block": $block_hash } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { "block": $block_hash,
            "chain_id": $Chain_id,
            "peer"?: $Crypto_box.Public_key_hash } } }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timespan.system:
    /* A span of time, as seen by the local computer. */
    number
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_3                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | Determined from data | $X_12                               |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | pushed                | 8 bytes              | signed 64-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | request               | Determined from data | $X_13                   |
  +-----------------------+----------------------+-------------------------+


  X_4 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_10
  ****

  +-----------+---------+----------------------------------------+
  | Name      | Size    | Contents                               |
  +===========+=========+========================================+
  | pushed    | 8 bytes | signed 64-bit integer                  |
  +-----------+---------+----------------------------------------+
  | treated   | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+
  | completed | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+


  X_11 (Determined from data, 8-bit tag)
  **************************************

  validation_success (tag 0)
  ==========================

  +-----------------------+----------------------+------------------------+
  | Name                  | Size                 | Contents               |
  +=======================+======================+========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer |
  +-----------------------+----------------------+------------------------+
  | successful_validation | Determined from data | $X_13                  |
  +-----------------------+----------------------+------------------------+
  | status                | 24 bytes             | $X_10                  |
  +-----------------------+----------------------+------------------------+


  validation_failure (tag 1)
  ==========================

  +--------------------------+----------------------+-------------------------+
  | Name                     | Size                 | Contents                |
  +==========================+======================+=========================+
  | Tag                      | 1 byte               | unsigned 8-bit integer  |
  +--------------------------+----------------------+-------------------------+
  | failed_validation        | Determined from data | $X_13                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_10                   |
  +--------------------------+----------------------+-------------------------+
  | # bytes in field "error" | 4 bytes              | unsigned 30-bit integer |
  +--------------------------+----------------------+-------------------------+
  | errors                   | Variable             | bytes                   |
  +--------------------------+----------------------+-------------------------+


  could_not_find_context (tag 2)
  ==============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  previously_validated (tag 3)
  ============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  validating_block (tag 4)
  ========================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  X_6
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_11                   |
  +-----------------------+----------------------+-------------------------+


  X_5
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_6        |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_4) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_5                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_13
  ****

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | block                      | 32 bytes | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | chain_id                   | 4 bytes  | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "peer" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | peer                       | 16 bytes | bytes                               |
  +----------------------------+----------+-------------------------------------+


  X_12
  ****

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | pushed  | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | treated | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | request | Determined from data | $X_13                 |
  +---------+----------------------+-----------------------+

  

GET /workers/chain_validators

Lists the chain validator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { /* Launching */
          "phase": "launching",
          "since": $timestamp.system }
        || { /* Running */
             "phase": "running",
             "since": $timestamp.system }
        || { /* Closing */
             "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Closed */
             "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Crashed */
             "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30, 2^30],
          "status":
            { /* Launching */
              "phase": "launching",
              "since": $timestamp.system }
            || { /* Running */
                 "phase": "running",
                 "since": $timestamp.system }
            || { /* Closing */
                 "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Closed */
                 "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Crashed */
                 "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30, 2^30] },
      "pipelines": integer ∈ [-2^15, 2^15-1] } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+-----------------------+
  | Name        | Size                 | Contents              |
  +=============+======================+=======================+
  | chain_id    | 4 bytes              | bytes                 |
  +-------------+----------------------+-----------------------+
  | status      | Determined from data | $X_3                  |
  +-------------+----------------------+-----------------------+
  | information | Determined from data | $X_2                  |
  +-------------+----------------------+-----------------------+
  | pipelines   | 2 bytes              | signed 16-bit integer |
  +-------------+----------------------+-----------------------+

  

GET /workers/chain_validators/<chain_id>

Introspect the state of a chain validator worker.

  { "status":
      { /* Launching */
        "phase": "launching",
        "since": $timestamp.system }
      || { /* Running */
           "phase": "running",
           "since": $timestamp.system }
      || { /* Closing */
           "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Closed */
           "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Crashed */
           "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { /* Hash */
              "hash": $block_hash }
            || { /* Peer_id */
                 "peer_id": $Crypto_box.Public_key_hash } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { /* Processed_block */
                "request":
                  { /* Hash */
                    "hash": $block_hash }
                  || { /* Peer_id */
                       "peer_id": $Crypto_box.Public_key_hash },
                "status":
                  { "pushed": $timestamp.system,
                    "treated": $timespan.system,
                    "completed": $timespan.system },
                "outcome": "branch" | "ignored" | "increment",
                "fitness": $fitness,
                "level": integer ∈ [-2^31-1, 2^31],
                "timestamp": $timestamp.protocol }
              || $error
              /* Could_not_switch_testchain */
              || any
              /* Bootstrapped */
              || $chain_status
              /* Sync_status */
              || { /* Bootstrap_active_peers */
                   "active": integer ∈ [-2^30, 2^30],
                   "needed": integer ∈ [-2^30, 2^30] }
              || { /* Bootstrap_active_peers_heads_time */
                   "min_head_time": $timestamp.protocol,
                   "max_head_time": $timestamp.protocol,
                   "most_recent_validation": $timestamp.protocol }
              || { /* notify_branch */
                   "peer_id": $Crypto_box.Public_key_hash }
              || { /* notify_head */
                   "peer_id": $Crypto_box.Public_key_hash }
              || { /* disconnection */
                   "peer_id": $Crypto_box.Public_key_hash }
              || { /* request_failure */
                   "failed_validation":
                     { /* Hash */
                       "hash": $block_hash }
                     || { /* Peer_id */
                          "peer_id": $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timespan.system,
                       "completed": $timespan.system },
                   "errors"?: $error } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { /* Hash */
            "hash": $block_hash }
          || { /* Peer_id */
               "peer_id": $Crypto_box.Public_key_hash } } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $chain_status:
    /* If 'unsynced', the node is not currently synchronized with of its
       peers (it is probably still bootstrapping and its head is lagging
       behind the chain's).
       If 'synced', the node considers itself synchronized with its peers and
       the current head timestamp is recent.
       If 'stuck', the node considers itself synchronized with its peers but
       the chain seems to be halted from its viewpoint. */
    "stuck" | "synced" | "unsynced"
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timespan.system:
    /* A span of time, as seen by the local computer. */
    number
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $unistring
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_3                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | Determined from data | $X_13                               |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | pushed                | 8 bytes              | signed 64-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | request               | Determined from data | $X_14                   |
  +-----------------------+----------------------+-------------------------+


  X_4 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  chain_status (Enumeration: unsigned 8-bit integer):
  ***************************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | synced         |
  +-------------+----------------+
  | 1           | unsynced       |
  +-------------+----------------+
  | 2           | stuck          |
  +-------------+----------------+


  X_10
  ****

  +-----------+---------+----------------------------------------+
  | Name      | Size    | Contents                               |
  +===========+=========+========================================+
  | pushed    | 8 bytes | signed 64-bit integer                  |
  +-----------+---------+----------------------------------------+
  | treated   | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+
  | completed | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+


  X_11 (Enumeration: unsigned 8-bit integer):
  *******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | ignored        |
  +-------------+----------------+
  | 1           | branch         |
  +-------------+----------------+
  | 2           | increment      |
  +-------------+----------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_12 (Determined from data, 8-bit tag)
  **************************************

  Processed_block (tag 0)
  =======================

  +----------------------------+----------------------+-----------------------------------------------------------+
  | Name                       | Size                 | Contents                                                  |
  +============================+======================+===========================================================+
  | Tag                        | 1 byte               | unsigned 8-bit integer                                    |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | request                    | Determined from data | $X_14                                                     |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | status                     | 24 bytes             | $X_10                                                     |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | outcome                    | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_11) |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | # bytes in field "fitness" | 4 bytes              | unsigned 30-bit integer                                   |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | fitness                    | Variable             | sequence of $fitness.elem                                 |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | level                      | 4 bytes              | signed 32-bit integer                                     |
  +----------------------------+----------------------+-----------------------------------------------------------+
  | timestamp                  | 8 bytes              | signed 64-bit integer                                     |
  +----------------------------+----------------------+-----------------------------------------------------------+


  Could_not_switch_testchain (tag 1)
  ==================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Bootstrapped (tag 2)
  ====================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Sync_status (tag 3)
  ===================

  +-----------------+--------+------------------------+
  | Name            | Size   | Contents               |
  +=================+========+========================+
  | Tag             | 1 byte | unsigned 8-bit integer |
  +-----------------+--------+------------------------+
  | Unnamed field 0 | 1 byte | $chain_status          |
  +-----------------+--------+------------------------+


  Bootstrap_active_peers (tag 4)
  ==============================

  +--------+---------+--------------------------------------------------------------+
  | Name   | Size    | Contents                                                     |
  +========+=========+==============================================================+
  | Tag    | 1 byte  | unsigned 8-bit integer                                       |
  +--------+---------+--------------------------------------------------------------+
  | active | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------+---------+--------------------------------------------------------------+
  | needed | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------+---------+--------------------------------------------------------------+


  Bootstrap_active_peers_heads_time (tag 5)
  =========================================

  +------------------------+---------+------------------------+
  | Name                   | Size    | Contents               |
  +========================+=========+========================+
  | Tag                    | 1 byte  | unsigned 8-bit integer |
  +------------------------+---------+------------------------+
  | min_head_time          | 8 bytes | signed 64-bit integer  |
  +------------------------+---------+------------------------+
  | max_head_time          | 8 bytes | signed 64-bit integer  |
  +------------------------+---------+------------------------+
  | most_recent_validation | 8 bytes | signed 64-bit integer  |
  +------------------------+---------+------------------------+


  notify_branch (tag 6)
  =====================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  notify_head (tag 7)
  ===================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  disconnection (tag 8)
  =====================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  request_failure (tag 9)
  =======================

  +--------------------------+----------------------+-------------------------+
  | Name                     | Size                 | Contents                |
  +==========================+======================+=========================+
  | Tag                      | 1 byte               | unsigned 8-bit integer  |
  +--------------------------+----------------------+-------------------------+
  | failed_validation        | Determined from data | $X_14                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_10                   |
  +--------------------------+----------------------+-------------------------+
  | # bytes in field "error" | 4 bytes              | unsigned 30-bit integer |
  +--------------------------+----------------------+-------------------------+
  | errors                   | Variable             | bytes                   |
  +--------------------------+----------------------+-------------------------+


  X_6
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_12                   |
  +-----------------------+----------------------+-------------------------+


  X_5
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_6        |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_4) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_5                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_14 (Determined from data, 8-bit tag)
  **************************************

  Hash (tag 0)
  ============

  +------+----------+------------------------+
  | Name | Size     | Contents               |
  +======+==========+========================+
  | Tag  | 1 byte   | unsigned 8-bit integer |
  +------+----------+------------------------+
  | hash | 32 bytes | bytes                  |
  +------+----------+------------------------+


  Peer_id (tag 1)
  ===============

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  X_13
  ****

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | pushed  | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | treated | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | request | Determined from data | $X_14                 |
  +---------+----------------------+-----------------------+

  

GET /workers/chain_validators/<chain_id>/ddb

Introspect the state of the DDB attached to a chain validator worker.

  { "p2p_readers": integer ∈ [-2^30, 2^30],
    "active_chains": integer ∈ [-2^30, 2^30],
    "operation_db":
      { "table_length": integer ∈ [-2^30, 2^30],
        "scheduler_length": integer ∈ [-2^30, 2^30] },
    "operations_db":
      { "table_length": integer ∈ [-2^30, 2^30],
        "scheduler_length": integer ∈ [-2^30, 2^30] },
    "block_header_db":
      { "table_length": integer ∈ [-2^30, 2^30],
        "scheduler_length": integer ∈ [-2^30, 2^30] },
    "active_connections": integer ∈ [-2^30, 2^30],
    "active_peers": integer ∈ [-2^30, 2^30] }
  +--------------------+---------+--------------------------------------------------------------+
  | Name               | Size    | Contents                                                     |
  +====================+=========+==============================================================+
  | p2p_readers        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------------+---------+--------------------------------------------------------------+
  | active_chains      | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------------+---------+--------------------------------------------------------------+
  | operation_db       | 8 bytes | $X_0                                                         |
  +--------------------+---------+--------------------------------------------------------------+
  | operations_db      | 8 bytes | $X_1                                                         |
  +--------------------+---------+--------------------------------------------------------------+
  | block_header_db    | 8 bytes | $X_2                                                         |
  +--------------------+---------+--------------------------------------------------------------+
  | active_connections | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------------+---------+--------------------------------------------------------------+
  | active_peers       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------------+---------+--------------------------------------------------------------+


  X_2
  ***

  +------------------+---------+--------------------------------------------------------------+
  | Name             | Size    | Contents                                                     |
  +==================+=========+==============================================================+
  | table_length     | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------+---------+--------------------------------------------------------------+
  | scheduler_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------+---------+--------------------------------------------------------------+

  

GET /workers/chain_validators/<chain_id>/peers_validators

Lists the peer validator workers and their status.

  [ { "peer_id": $Crypto_box.Public_key_hash,
      "status":
        { /* Launching */
          "phase": "launching",
          "since": $timestamp.system }
        || { /* Running */
             "phase": "running",
             "since": $timestamp.system }
        || { /* Closing */
             "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Closed */
             "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Crashed */
             "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30, 2^30],
          "status":
            { /* Launching */
              "phase": "launching",
              "since": $timestamp.system }
            || { /* Running */
                 "phase": "running",
                 "since": $timestamp.system }
            || { /* Closing */
                 "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Closed */
                 "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Crashed */
                 "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30, 2^30] },
      "pipelines":
        { "fetched_headers": integer ∈ [-2^30, 2^30],
          "fetched_blocks": integer ∈ [-2^30, 2^30] } } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_4
  ***

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | fetched_headers | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | fetched_blocks  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+----------+
  | Name        | Size                 | Contents |
  +=============+======================+==========+
  | peer_id     | 16 bytes             | bytes    |
  +-------------+----------------------+----------+
  | status      | Determined from data | $X_3     |
  +-------------+----------------------+----------+
  | information | Determined from data | $X_2     |
  +-------------+----------------------+----------+
  | pipelines   | 8 bytes              | $X_4     |
  +-------------+----------------------+----------+

  

GET /workers/chain_validators/<chain_id>/peers_validators/<peer_id>

Introspect the state of a peer validator worker.

  { "status":
      { /* Launching */
        "phase": "launching",
        "since": $timestamp.system }
      || { /* Running */
           "phase": "running",
           "since": $timestamp.system }
      || { /* Closing */
           "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Closed */
           "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Crashed */
           "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { /* New_head */
              "request": "new_head",
              "block": $block_hash }
            || { /* New_branch */
                 "request": "new_branch",
                 "block": $block_hash,
                 "locators": integer ∈ [-2^30, 2^30] } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { /* Request */
                "request":
                  { /* New_head */
                    "request": "new_head",
                    "block": $block_hash }
                  || { /* New_branch */
                       "request": "new_branch",
                       "block": $block_hash,
                       "locators": integer ∈ [-2^30, 2^30] },
                "status":
                  { "pushed": $timestamp.system,
                    "treated": $timespan.system,
                    "completed": $timespan.system } }
              || { /* Failed request */
                   "error": $error,
                   "failed_request":
                     { /* New_head */
                       "request": "new_head",
                       "block": $block_hash }
                     || { /* New_branch */
                          "request": "new_branch",
                          "block": $block_hash,
                          "locators": integer ∈ [-2^30, 2^30] },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timespan.system,
                       "completed": $timespan.system } }
              || { /* validating_new_branch */
                   "peer": $Crypto_box.Public_key_hash,
                   "nb_blocks": integer ∈ [-2^30, 2^30] }
              || { /* new_branch_validated */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* fetching_operations_for_head */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* Requesting_new_head_validation */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* new_head_validation_end */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* ignoring_head */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* ignoring_previously_validated_block */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* ignoring_invalid_block */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* missing_new_head_predecessor */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* ignoring_invalid_locator_branch */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* ignore_branch_without_common_ancestor */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* no_new_head_from_peer */
                   "peer": $Crypto_box.Public_key_hash,
                   "timespan": number }
              || { /* processing_new_head */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* processing_new_branch */
                   "peer": $Crypto_box.Public_key_hash,
                   "block": $block_hash }
              || { /* terminating_worker */
                   "peer": $Crypto_box.Public_key_hash,
                   "reason": $unistring } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { /* New_head */
            "request": "new_head",
            "block": $block_hash }
          || { /* New_branch */
               "request": "new_branch",
               "block": $block_hash,
               "locators": integer ∈ [-2^30, 2^30] } } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timespan.system:
    /* A span of time, as seen by the local computer. */
    number
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_3                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | Determined from data | $X_12                               |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | pushed                | 8 bytes              | signed 64-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | request               | Determined from data | $X_13                   |
  +-----------------------+----------------------+-------------------------+


  X_4 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_10
  ****

  +-----------+---------+----------------------------------------+
  | Name      | Size    | Contents                               |
  +===========+=========+========================================+
  | pushed    | 8 bytes | signed 64-bit integer                  |
  +-----------+---------+----------------------------------------+
  | treated   | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+
  | completed | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+


  X_11 (Determined from data, 8-bit tag)
  **************************************

  Request (tag 0)
  ===============

  +---------+----------------------+------------------------+
  | Name    | Size                 | Contents               |
  +=========+======================+========================+
  | Tag     | 1 byte               | unsigned 8-bit integer |
  +---------+----------------------+------------------------+
  | request | Determined from data | $X_13                  |
  +---------+----------------------+------------------------+
  | status  | 24 bytes             | $X_10                  |
  +---------+----------------------+------------------------+


  Failed request (tag 1)
  ======================

  +--------------------------+----------------------+-------------------------+
  | Name                     | Size                 | Contents                |
  +==========================+======================+=========================+
  | Tag                      | 1 byte               | unsigned 8-bit integer  |
  +--------------------------+----------------------+-------------------------+
  | # bytes in field "error" | 4 bytes              | unsigned 30-bit integer |
  +--------------------------+----------------------+-------------------------+
  | error                    | Variable             | bytes                   |
  +--------------------------+----------------------+-------------------------+
  | failed_request           | Determined from data | $X_13                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_10                   |
  +--------------------------+----------------------+-------------------------+


  validating_new_branch (tag 2)
  =============================

  +-----------+----------+--------------------------------------------------------------+
  | Name      | Size     | Contents                                                     |
  +===========+==========+==============================================================+
  | Tag       | 1 byte   | unsigned 8-bit integer                                       |
  +-----------+----------+--------------------------------------------------------------+
  | peer      | 16 bytes | bytes                                                        |
  +-----------+----------+--------------------------------------------------------------+
  | nb_blocks | 4 bytes  | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------+----------+--------------------------------------------------------------+


  new_branch_validated (tag 3)
  ============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  fetching_operations_for_head (tag 4)
  ====================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Requesting_new_head_validation (tag 5)
  ======================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  new_head_validation_end (tag 6)
  ===============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  ignoring_head (tag 7)
  =====================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  ignoring_previously_validated_block (tag 8)
  ===========================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  ignoring_invalid_block (tag 9)
  ==============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  missing_new_head_predecessor (tag 10)
  =====================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  ignoring_invalid_locator_branch (tag 11)
  ========================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  ignore_branch_without_common_ancestor (tag 12)
  ==============================================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  no_new_head_from_peer (tag 13)
  ==============================

  +----------+----------+----------------------------------------+
  | Name     | Size     | Contents                               |
  +==========+==========+========================================+
  | Tag      | 1 byte   | unsigned 8-bit integer                 |
  +----------+----------+----------------------------------------+
  | peer     | 16 bytes | bytes                                  |
  +----------+----------+----------------------------------------+
  | timespan | 8 bytes  | double-precision floating-point number |
  +----------+----------+----------------------------------------+


  processing_new_head (tag 14)
  ============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  processing_new_branch (tag 15)
  ==============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | peer  | 16 bytes | bytes                  |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  terminating_worker (tag 16)
  ===========================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | peer                  | 16 bytes | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | reason                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_6
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_11                   |
  +-----------------------+----------------------+-------------------------+


  X_5
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_6        |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_4) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_5                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_13 (Determined from data, 8-bit tag)
  **************************************

  New_head (tag 0)
  ================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  New_branch (tag 1)
  ==================

  +----------+----------+--------------------------------------------------------------+
  | Name     | Size     | Contents                                                     |
  +==========+==========+==============================================================+
  | Tag      | 1 byte   | unsigned 8-bit integer                                       |
  +----------+----------+--------------------------------------------------------------+
  | block    | 32 bytes | bytes                                                        |
  +----------+----------+--------------------------------------------------------------+
  | locators | 4 bytes  | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------+----------+--------------------------------------------------------------+


  X_12
  ****

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | pushed  | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | treated | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | request | Determined from data | $X_13                 |
  +---------+----------------------+-----------------------+

  

GET /workers/prevalidators

Lists the Prevalidator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { /* Launching */
          "phase": "launching",
          "since": $timestamp.system }
        || { /* Running */
             "phase": "running",
             "since": $timestamp.system }
        || { /* Closing */
             "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Closed */
             "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { /* Crashed */
             "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30, 2^30],
          "status":
            { /* Launching */
              "phase": "launching",
              "since": $timestamp.system }
            || { /* Running */
                 "phase": "running",
                 "since": $timestamp.system }
            || { /* Closing */
                 "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Closed */
                 "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { /* Crashed */
                 "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30, 2^30] },
      "pipelines": integer ∈ [-2^15, 2^15-1] } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+-----------------------+
  | Name        | Size                 | Contents              |
  +=============+======================+=======================+
  | chain_id    | 4 bytes              | bytes                 |
  +-------------+----------------------+-----------------------+
  | status      | Determined from data | $X_3                  |
  +-------------+----------------------+-----------------------+
  | information | Determined from data | $X_2                  |
  +-------------+----------------------+-----------------------+
  | pipelines   | 2 bytes              | signed 16-bit integer |
  +-------------+----------------------+-----------------------+

  

GET /workers/prevalidators/<chain_id>

Introspect the state of prevalidator workers.

  { "status":
      { /* Launching */
        "phase": "launching",
        "since": $timestamp.system }
      || { /* Running */
           "phase": "running",
           "since": $timestamp.system }
      || { /* Closing */
           "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Closed */
           "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { /* Crashed */
           "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { /* Flush */
              "request": "flush",
              "block": $block_hash }
            || { /* Notify */
                 "request": "notify",
                 "peer": $Crypto_box.Public_key_hash,
                 "mempool": $mempool }
            || { /* Inject */
                 "request": "inject",
                 "operation": $operation }
            || { /* Arrived */
                 "request": "arrived",
                 "operation_hash": $Operation_hash,
                 "operation": $operation }
            || { /* Advertise */
                 "request": "advertise" }
            || { /* Leftover */
                 "request": "leftover" } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { /* Request */
                "request":
                  { /* Flush */
                    "request": "flush",
                    "block": $block_hash }
                  || { /* Notify */
                       "request": "notify",
                       "peer": $Crypto_box.Public_key_hash,
                       "mempool": $mempool }
                  || { /* Inject */
                       "request": "inject",
                       "operation": $operation }
                  || { /* Arrived */
                       "request": "arrived",
                       "operation_hash": $Operation_hash,
                       "operation": $operation }
                  || { /* Advertise */
                       "request": "advertise" }
                  || { /* Leftover */
                       "request": "leftover" },
                "status":
                  { "pushed": $timestamp.system,
                    "treated": $timespan.system,
                    "completed": $timespan.system } }
              || { /* Failed request */
                   "error": $error,
                   "failed_request":
                     { /* Flush */
                       "request": "flush",
                       "block": $block_hash }
                     || { /* Notify */
                          "request": "notify",
                          "peer": $Crypto_box.Public_key_hash,
                          "mempool": $mempool }
                     || { /* Inject */
                          "request": "inject",
                          "operation": $operation }
                     || { /* Arrived */
                          "request": "arrived",
                          "operation_hash": $Operation_hash,
                          "operation": $operation }
                     || { /* Advertise */
                          "request": "advertise" }
                     || { /* Leftover */
                          "request": "leftover" },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timespan.system,
                       "completed": $timespan.system } }
              || { /* invalid_mempool_configuration */
                    }
              || $Operation_hash
              /* unparsable_operation */
              || integer ∈ [-2^30, 2^30]
              /* processing_n_operations */
              || $Operation_hash
              /* fetching_operation */
              || $Operation_hash
              /* operation_included */
              || integer ∈ [-2^30, 2^30]
              /* operations_not_flushed */ ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { /* Flush */
            "request": "flush",
            "block": $block_hash }
          || { /* Notify */
               "request": "notify",
               "peer": $Crypto_box.Public_key_hash,
               "mempool": $mempool }
          || { /* Inject */
               "request": "inject",
               "operation": $operation }
          || { /* Arrived */
               "request": "arrived",
               "operation_hash": $Operation_hash,
               "operation": $operation }
          || { /* Advertise */
               "request": "advertise" }
          || { /* Leftover */
               "request": "leftover" } } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $mempool:
    /* A batch of operation. This format is used to gossip operations between
       peers. */
    { "known_valid": [ $Operation_hash ... ],
      "pending": [ $Operation_hash ... ] }
  $operation:
    /* An operation. The shell_header part indicates a block an operation is
       meant to apply on top of. The proto part is protocol-specific and
       appears as a binary blob. */
    { "branch": $block_hash,
      "data": /^[a-zA-Z0-9]+$/ }
  $timespan.system:
    /* A span of time, as seen by the local computer. */
    number
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc /* RFC encoding */ || $int64 /* Second since epoch */
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | status                | Determined from data | $X_0                    |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | pending_requests      | Variable             | sequence of $X_1        |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | backlog               | Variable             | sequence of $X_4        |
  +-----------------------+----------------------+-------------------------+
  | current_request       | Variable             | $X_15                   |
  +-----------------------+----------------------+-------------------------+


  X_15
  ****

  +---------+----------+-----------------------+
  | Name    | Size     | Contents              |
  +=========+==========+=======================+
  | pushed  | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | treated | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | request | Variable | $X_17                 |
  +---------+----------+-----------------------+


  X_17 (Variable, 8-bit tag)
  **************************

  Flush (tag 0)
  =============

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Notify (tag 1)
  ==============

  +---------+----------------------+------------------------+
  | Name    | Size                 | Contents               |
  +=========+======================+========================+
  | Tag     | 1 byte               | unsigned 8-bit integer |
  +---------+----------------------+------------------------+
  | peer    | 16 bytes             | bytes                  |
  +---------+----------------------+------------------------+
  | mempool | Determined from data | $mempool               |
  +---------+----------------------+------------------------+


  Inject (tag 2)
  ==============

  +-----------+----------+------------------------+
  | Name      | Size     | Contents               |
  +===========+==========+========================+
  | Tag       | 1 byte   | unsigned 8-bit integer |
  +-----------+----------+------------------------+
  | operation | Variable | $operation             |
  +-----------+----------+------------------------+


  Arrived (tag 3)
  ===============

  +----------------+----------+------------------------+
  | Name           | Size     | Contents               |
  +================+==========+========================+
  | Tag            | 1 byte   | unsigned 8-bit integer |
  +----------------+----------+------------------------+
  | operation_hash | 32 bytes | bytes                  |
  +----------------+----------+------------------------+
  | operation      | Variable | $operation             |
  +----------------+----------+------------------------+


  Advertise (tag 4)
  =================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Leftover (tag 5)
  ================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_16
  ****

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  operation
  *********

  +--------+----------+----------+
  | Name   | Size     | Contents |
  +========+==========+==========+
  | branch | 32 bytes | bytes    |
  +--------+----------+----------+
  | data   | Variable | bytes    |
  +--------+----------+----------+


  X_4
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_5) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_6                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_6
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_7        |
  +-----------------------+----------+-------------------------+


  X_7
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | $X_14                   |
  +-----------------------+----------+-------------------------+


  X_14 (Variable, 8-bit tag)
  **************************

  Request (tag 0)
  ===============

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | request | Variable | $X_17                  |
  +---------+----------+------------------------+
  | status  | 24 bytes | $X_13                  |
  +---------+----------+------------------------+


  Failed request (tag 1)
  ======================

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | error                    | Variable | bytes                   |
  +--------------------------+----------+-------------------------+
  | failed_request           | Variable | $X_17                   |
  +--------------------------+----------+-------------------------+
  | status                   | 24 bytes | $X_13                   |
  +--------------------------+----------+-------------------------+


  invalid_mempool_configuration (tag 2)
  =====================================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  unparsable_operation (tag 3)
  ============================

  +----------------+----------+------------------------+
  | Name           | Size     | Contents               |
  +================+==========+========================+
  | Tag            | 1 byte   | unsigned 8-bit integer |
  +----------------+----------+------------------------+
  | Operation_hash | 32 bytes | bytes                  |
  +----------------+----------+------------------------+


  processing_n_operations (tag 4)
  ===============================

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                                       |
  +-----------------+---------+--------------------------------------------------------------+
  | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  fetching_operation (tag 5)
  ==========================

  +----------------+----------+------------------------+
  | Name           | Size     | Contents               |
  +================+==========+========================+
  | Tag            | 1 byte   | unsigned 8-bit integer |
  +----------------+----------+------------------------+
  | Operation_hash | 32 bytes | bytes                  |
  +----------------+----------+------------------------+


  operation_included (tag 6)
  ==========================

  +----------------+----------+------------------------+
  | Name           | Size     | Contents               |
  +================+==========+========================+
  | Tag            | 1 byte   | unsigned 8-bit integer |
  +----------------+----------+------------------------+
  | Operation_hash | 32 bytes | bytes                  |
  +----------------+----------+------------------------+


  operations_not_flushed (tag 7)
  ==============================

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                                       |
  +-----------------+---------+--------------------------------------------------------------+
  | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  X_13
  ****

  +-----------+---------+----------------------------------------+
  | Name      | Size    | Contents                               |
  +===========+=========+========================================+
  | pushed    | 8 bytes | signed 64-bit integer                  |
  +-----------+---------+----------------------------------------+
  | treated   | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+
  | completed | 8 bytes | double-precision floating-point number |
  +-----------+---------+----------------------------------------+


  X_5 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | pushed                | 8 bytes  | signed 64-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | request               | Variable | $X_17                   |
  +-----------------------+----------+-------------------------+


  mempool
  *******

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | known_valid           | Variable             | sequence of bytes       |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | pending               | Determined from data | $X_16                   |
  +-----------------------+----------------------+-------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+