Artifact Content
Not logged in

Artifact b5230fa01a9fa62fee822748f4a1fc537bcec1aa:


{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "Config.json",
  "title": "Config",
  "description": "Connector configuration schema.",
  "type": "object",
  "properties": {
    "env": {
      "description": "Determines what type of network the connector is a part of. Can be: 'production', 'test'. Default: 'test'",
      "type": "string",
      "enum": ["production", "test"],
      "default": "test"
    },
    "ilpAddress": {
      "description": "ILP address of the connector. This property can be omitted if an account with `relation=parent` is configured under `accounts`.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9._~-]+$",
      "default": "unknown"
    },
    "ilpAddressInheritFrom": {
      "description": "If there are multiple parents, and `ilpAddress` is not set explicit, specify the account ID of the parent that we should load our address from. Defaults to the first parent in the `accounts` map.",
      "type": "string",
      "default": ""
    },
    "accounts": {
      "description": "Description of connector account plugins.",
      "type": "object",
      "default": {},
      "additionalProperties": {
        "description": "Description of individual account.",
        "type": "object",
        "properties": {
          "relation": {
            "description": "Relationship between the connector and the counterparty that the account is with.",
            "enum": ["parent", "peer", "child"]
          },
          "plugin": {
            "description": "Name of the ILP plugin that should be used for this account.",
            "type": "string"
          },
          "assetCode": {
            "description": "Currency code or other asset identifier that will be passed to the backend to select the correct rate for this account.",
            "type": "string"
          },
          "assetScale": {
            "description": "Interledger amounts are integers, but most currencies are typically represented as fractional units, e.g. cents. This property defines how many Interledger units make up one regular units. For dollars, this would usually be set to 9, so that Interledger amounts are expressed in nanodollars.",
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "balance": {
            "description": "Defines whether the connector should maintain and enforce a balance for this account. The balance is always from the connector's perspective. Therefore, a negative balance implies the connector owes money to the counterparty and a positive balance implies the counterparty owes money to the connector. This setting is enforced by the built-in `balance` middleware.",
            "type": "object",
            "properties": {
              "minimum": {
                "description": "Minimum balance (in this account's indivisible base units) the connector must maintain. The connector will reject outgoing packets if they would put it below this balance. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value), `\"-Infinity\"` or `\"Infinity\"`.",
                "type": "string",
                "pattern": "^(0|-?([1-9][0-9]*|Infinity))$"
              },
              "maximum": {
                "description": "Maximum balance (in this account's indivisible base units) the connector will allow. The connector will reject incoming packets if they would put it above this balance. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value), `\"-Infinity\"` or `\"Infinity\"`.",
                "type": "string",
                "pattern": "^(0|-?([1-9][0-9]*|Infinity))$"
              },
              "settleThreshold": {
                "description": "Balance (in this account's indivisible base units) numerically below which the connector will automatically initiate a settlement. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value) or `\"-Infinity\"`.",
                "type": "string",
                "pattern": "^(0|(-?[1-9][0-9]*|-Infinity))$"
              },
              "settleTo": {
                "description": "Balance (in this account's indivisible base units) the connector will attempt to reach when settling. The format is an integer (which may be prefixed with `-` to indicate a negative value) as a string.",
                "type": "string",
                "pattern": "^(0|-?[1-9][0-9]*)$",
                "default": "0"
              }
            },
            "additionalProperties": false,
            "required": ["maximum"]
          },
          "maxPacketAmount": {
            "description": "Maximum amount per packet for incoming prepare packets. Connector will reject any incoming prepare packets from this account with a higher amount. Amount should be provided as an integer in a string (in atomic units). This setting is enforced by the built-in `maxPacketAmount` middleware.",
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "throughput": {
            "description": "Configuration to limit the total amount sent via Interledger per unit of time. This setting is enforced by the built-in `throughput` middleware.",
            "type": "object",
            "properties": {
              "refillPeriod": {
                "description": "Length of time (in milliseconds) during which the token balance increases by `incomingAmount`/`outgoingAmount` tokens. Defaults to one second.",
                "type": "integer",
                "minimum": 100
              },
              "incomingAmount": {
                "description": "Maximum incoming throughput amount (in atomic units; per second) for incoming packets. If this setting is not set, the incoming throughput limit is disabled.",
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "outgoingAmount": {
                "description": "Maximum throughput amount (in atomic units; per second) for outgoing packets. If this setting is not set, the outgoing throughput limit is disabled.",
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            },
            "additionalProperties": false
          },
          "rateLimit": {
            "description": "Maximum rate of incoming packets. Limit is implemented as a token bucket with a constant refill rate. When the token bucket is empty, all requests are immediately rejected. This setting is enforced by the built-in `rateLimit` middleware.",
            "type": "object",
            "properties": {
              "refillPeriod": {
                "description": "Length of time (in milliseconds) during which the token balance increases by `refillCount` tokens. Defaults to one second.",
                "type": "integer",
                "minimum": 100
              },
              "refillCount": {
                "description": "How many tokens are refilled per period. The default refill period is one second, so this would be the average number of requests per second.",
                "type": "integer",
                "minimum": 1
              },
              "capacity": {
                "description": "Maximum number of tokens in the bucket.",
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "sendRoutes": {
            "description": "Whether we should broadcast routes to this peer. Defaults to `false` for `relation=child` and `true` otherwise.",
            "type": "boolean"
          },
          "receiveRoutes": {
            "description": "Whether we should receive and process route broadcasts from this peer. Defaults to `false` for `relation=child` and `true` otherwise.",
            "type": "boolean"
          },
          "options": {
            "description": "Options that will be passed to the plugin constructor.",
            "type": "object",
            "additionalProperties": true
          },
          "ilpAddressSegment": {
            "description": "What segment will be appended to the connector's ILP address to form this account's ILP address. Only applicable to accounts with `relation=child`. Defaults to the id of the account, i.e. the key used in the `accounts` config object.",
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "relation",
          "plugin",
          "assetCode",
          "assetScale"
        ],
        "additionalProperties": false
      }
    },
    "defaultRoute": {
      "description": "Which account should be used as the default route for all other traffic. Can be set to empty string to disable the default route or 'auto' to automatically use the first parent in the `accounts` map. Default: 'auto'",
      "type": "string",
      "default": "auto"
    },
    "routes": {
      "description": "Additional routes to add to the connector's routing table.",
      "type": "array",
      "default": [],
      "items": {
        "description": "Description of a route entry.",
        "type": "object",
        "properties": {
          "targetPrefix": {
            "description": "ILP address prefix that this route applies to. Configured routes take precedence over the same or shorter prefixes that are local or published by peers. More specific prefixes will still take precedence. Prefixes should NOT include a trailing period.",
            "type": "string",
            "pattern": "^[a-zA-Z0-9._~-]+$"
          },
          "peerId": {
            "description": "ID of the account that destinations matching `targetPrefix` should be forwarded to. Must be one of the accounts in `accounts`.",
            "type": "string",
            "pattern": "^[a-zA-Z0-9._~-]+$"
          }
        },
        "required": ["targetPrefix", "peerId"],
        "additionalProperties": false
      }
    },
    "spread": {
      "description": "How much of a spread to add on top of the reference exchange rate. Determines the connector's margin.",
      "type": "number",
      "default": 0.002
    },
    "minMessageWindow": {
      "description": "Minimum time the connector wants to budget for getting a message to the accounts its trading on. In milliseconds.",
      "type": "integer",
      "default": 1000
    },
    "maxHoldTime": {
      "description": "Maximum duration (in milliseconds) the connector is willing to place funds on hold while waiting for the outcome of a transaction.",
      "type": "integer",
      "default": 30000
    },
    "routeBroadcastEnabled": {
      "description": "Whether to broadcast known routes.",
      "type": "boolean",
      "default": true
    },
    "routeBroadcastInterval": {
      "description": "Frequency at which the connector broadcasts its routes to adjacent connectors. (in milliseconds)",
      "type": "integer",
      "default": 30000
    },
    "routeCleanupInterval": {
      "description": "The frequency at which the connector checks for expired routes. (in milliseconds)",
      "type": "integer",
      "default": 1000
    },
    "routeExpiry": {
      "description": "The maximum age of a route provided by this connector. (in milliseconds)",
      "type": "integer",
      "default": 45000
    },
    "quoteExpiry": {
      "description": "The maximum age of a quote provided by this connector. (in milliseconds)",
      "type": "integer",
      "default": 45000
    },
    "routingSecret": {
      "description": "Seed used for generating routing table auth values.",
      "type": "string",
      "default": ""
    },
    "backend": {
      "description": "Name of the backend (can be built-in or a require-able module name). Built-in modules are: fixerio, fixerio-plus-xrp, fixerio-plus-coinmarketcap, one-to-one",
      "type": "string",
      "default": "fixerio"
    },
    "backendConfig": {
      "description": "Additional configuration for the backend.",
      "type": "object",
      "default": {},
      "additionalProperties": true
    },
    "store": {
      "description": "Name of the store (can be built-in or a require-able module name). Built-in modules are: leveldown, memdown",
      "type": "string",
      "default": "leveldown"
    },
    "storePath": {
      "description": "Shorthand for `config.storeConfig.path`.",
      "type": "string",
      "default": ""
    },
    "storeConfig": {
      "description": "Additional options to be passed to the `store`'s constructor.",
      "type": "object",
      "default": {},
      "additionalProperties": true
    },
    "middlewares": {
      "description": "Additional middleware that should be added to the middleware stack.",
      "type": "object",
      "additionalProperties": {
        "description": "Object describing middleware instance.",
        "type": "object",
        "properties": {
          "type": {
            "description": "NPM module that should be `require`d to load the middleware constructor.",
            "type": "string"
          },
          "options": {
            "description": "Options that will be passed to the middleware constructor.",
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "type"
        ]
      },
      "default": {}
    },
    "disableMiddleware": {
      "description": "List of built-in middlewares that should be disabled. Can be used to replace built-in middleware with your own custom version.",
      "type": "array",
      "items": {
        "description": "Name of the middleware to be removed.",
        "enum": ["errorHandler", "rateLimit", "balance", "maxPacketAmount", "throughput", "deduplicate", "validateFulfillment", "expire"]
      },
      "default": []
    },
    "broadcastCurves": {
      "description": "Whether to include liquidity curves when broadcasting routes.",
      "type": "boolean",
      "default": true
    },
    "reflectPayments": {
      "description": "Whether to allow routing payments back to the account that sent them.",
      "type": "boolean",
      "default": true
    },
    "initialConnectTimeout": {
      "description": "How long the connector should wait for account plugins to connect before launching other subsystems. (in milliseconds)",
      "type": "integer",
      "default": 10000
    },
    "adminApi": {
      "description": "Whether the admin API is enabled or not. Default: false (disabled)",
      "type": "boolean",
      "default": false
    },
    "adminApiPort": {
      "description": "Which port the admin API should listen on. Default: 7780",
      "type": "integer",
      "minimum": 0,
      "maximum": 65535,
      "default": 7780
    },
    "adminApiHost": {
      "description": "Host to bind to. Warning: The admin API interface should never be made public! Default: '127.0.0.1'",
      "type": "string",
      "default": "127.0.0.1"
    }
  },
  "required": ["accounts"],
  "additionalProperties": false
}