{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "alias",
    "color",
    "num_peers",
    "num_pending_channels",
    "num_active_channels",
    "num_inactive_channels",
    "version",
    "blockheight",
    "network",
    "fees_collected_msat",
    "lightning-dir"
  ],
  "properties": {
    "id": {
      "type": "pubkey",
      "description": "The public key unique to this node"
    },
    "alias": {
      "type": "string",
      "description": "The fun alias this node will advertize",
      "maxLength": 32
    },
    "color": {
      "type": "hex",
      "description": "The favorite RGB color this node will advertize",
      "minLength": 6,
      "maxLength": 6
    },
    "num_peers": {
      "type": "u32",
      "description": "The total count of peers, connected or with channels"
    },
    "num_pending_channels": {
      "type": "u32",
      "description": "The total count of channels being opened"
    },
    "num_active_channels": {
      "type": "u32",
      "description": "The total count of channels in normal state"
    },
    "num_inactive_channels": {
      "type": "u32",
      "description": "The total count of channels waiting for opening or closing transactions to be mined"
    },
    "version": {
      "type": "string",
      "description": "Identifies what bugs you are running into"
    },
    "lightning-dir": {
      "type": "string",
      "description": "Identifies where you can find the configuration and other related files"
    },
    "our_features": {
      "type": "object",
      "description": "Our BOLT #9 feature bits (as hexstring) for various contexts",
      "additionalProperties": true,
      "required": [
        "init",
        "node",
        "channel",
        "invoice"
      ],
      "properties": {
        "init": {
          "type": "hex",
          "description": "features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel"
        },
        "node": {
          "type": "hex",
          "description": "features in our node_announcement message"
        },
        "channel": {
          "type": "hex",
          "description": "negotiated channel features we — as channel initiator — publish in the channel_announcement message"
        },
        "invoice": {
          "type": "hex",
          "description": "features in our BOLT11 invoices"
        }
      }
    },
    "blockheight": {
      "type": "u32",
      "description": "The highest block height we've learned"
    },
    "network": {
      "type": "string",
      "description": "represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)"
    },
    "msatoshi_fees_collected": {
      "type": "u64",
      "deprecated": true
    },
    "fees_collected_msat": {
      "type": "msat",
      "description": "Total routing fees collected by this node"
    },
    "address": {
      "type": "array",
      "description": "The addresses we announce to the world",
      "items": {
        "type": "object",
        "required": [
          "type",
          "port"
        ],
        "additionalProperties": true,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "dns",
              "ipv4",
              "ipv6",
              "torv2",
              "torv3",
              "websocket"
            ],
            "description": "Type of connection"
          },
          "port": {
            "type": "u16",
            "description": "port number"
          }
        },
        "if": {
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "dns",
                "ipv4",
                "ipv6",
                "torv2",
                "torv3"
              ]
            }
          }
        },
        "then": {
          "required": [
            "type",
            "address",
            "port"
          ],
          "additionalProperties": false,
          "properties": {
            "type": {},
            "port": {},
            "address": {
              "type": "string",
              "description": "address in expected format for **type**"
            }
          }
        },
        "else": {
          "required": [
            "type",
            "port"
          ],
          "additionalProperties": false,
          "properties": {
            "type": {},
            "port": {}
          }
        }
      }
    },
    "binding": {
      "type": "array",
      "description": "The addresses we are listening on",
      "items": {
        "type": "object",
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "*FIXME*": "The variant in connect.schema.json is more complete",
            "enum": [
              "local socket",
              "ipv4",
              "ipv6",
              "torv2",
              "torv3"
            ],
            "description": "Type of connection"
          },
          "address": {
            "type": "string",
            "description": "address in expected format for **type**"
          },
          "port": {
            "type": "u16",
            "description": "port number"
          },
          "socket": {
            "type": "string",
            "description": "socket filename (only if **type** is \"local socket\")"
          }
        }
      }
    },
    "warning_bitcoind_sync": {
      "type": "string",
      "description": "Bitcoind is not up-to-date with network."
    },
    "warning_lightningd_sync": {
      "type": "string",
      "description": "Lightningd is still loading latest blocks from bitcoind."
    }
  }
}
