config.json is the configuration file used for deploying Airnode.
It is composed of four main sections:
ois: A list of OIS objectstriggers: A list of trigger objects, each mapping to an endpoint defined in an OIS in 1nodeSettings: An object containing node configuration parametersid: A UUID that specifies aconfig.json/security.jsonfile pair
Contents of a config.json file:
{
"ois": [
...
],
"triggers": {
...
},
"nodeSettings": {
...
},
"id": "..."
}ois is a list of OIS objects as described in OIS.
Since each OIS defines the integration of a single API to an oracle, this means that a node can serve multiple APIs.
However, this does not mean that nodes can be shared between multiple providers.
Each node serves the APIs of a single provider.
triggers are events that trigger an API call and an Ethereum transaction by Airnode.
Triggers of different types are kept in lists under their respective keys:
request- When the node sees an event with itsproviderIdand this trigger'sendpointIdemitted from the central Airnode contract, it responds to it with the respective endpoint defined in the OIS.endpointIdoisTitleendpointName
{
"request": [
{
"endpointId": "...",
"oisTitle": "...",
"endpointName": "..."
},
...
],
...
}An object containing the following configuration parameters:
-
providerIdShort- The label used to identify this specific provider among the cloud deployments. The deployer uses the first 7 characters of the fullproviderIdby default. For example, if theproviderIdis0x9e5a89de5a7e780b9eb5a61425a3a656f0c891ac4c56c07037d257724af490c9,providerIdShortwould be9e5a89d. This field must not exist for the first deployment, and must exist for redeployments. -
nodeVersion- The node version thisconfig.jsonis supposed to be used with. The deployer checks this and refuses to deploy if its node version does not agree with this field. -
cloudProvider- The cloud provider that will be used to deploy the node. Can beaws. -
region- The cloud provider region that the node will be deployed at. -
stage- The label used to distinguish between multiple deployments of the same provider on a cloud provider. For example, the provider may make multiple deployments withstages set asdev,ropsten,mainnet, where each of these deployments would use the same private key and have the sameproviderId. -
logFormat- The format that Airnode should use to output logs. Eitherjsonorplain. -
chains- A list of blockchain configurations. See chains below.
Airnode can be configured to work with multiple blockchain providers, types and networks.
Configurations for each chain is represented with an object in this chains list.
Required
-
providerAdminForRecordCreation- the master address that will be authorized to update the authorizers of the provider's endpoints. Note that the node only uses this while creating the provider record. Changing this after the provider record is created will not have any effect. This field is optional, but not having it means that the node will not be able to create a provider record on the respective chain. -
id- the corresponding chain (or network) ID. A list of known Ethereum chain IDs can be found at EIP-155, although this list is not exhaustive and theiddoes not necessarily need to be a popular or known value. -
type- the type of blockchain to connect to. Currently onlyevmis supported for Ethereum and other EVM compatible blockchains, although other blockchain types will be supported in the future. -
providers- one or more providers serving the given chain ID and type. Eachprovidermust have the following keys:-
name- a unique name across ALL configured providers inconfig.json -
url- an HTTP endpoint that Airnode should use to connect to.
-
-
contracts- An object that keeps the addresses of the contracts deployed on the respective chain. It has to include the following contract addresses:-
Airnode -
Convenience
-
Optional
-
blockHistoryLimit- the number of block in the past that Airnode should use to search for requests or events. Defaults to600(roughly 1 hour for Ethereum). -
minConfirmations- the number of confirmations required for a request or event to be considered valid. Default to0. -
ignoreBlockedRequestsAfterBlocks- the number of blocks that needs to pass for the node to start ignoring blocked requests. Defaults to20.
An example object from the chains list:
{
"providerAdminForRecordCreation": "0x5e00...F410",
"id": 1,
"type": "evm",
"providers": [
{
"name": "my-infura-mainnet",
"url": "https://mainnet.infura.io/v3/<your key>"
},
{
"name": "secondary-mainnet",
"url": "https://..."
}
],
"contracts": {
"Airnode": "0xf1d4...0bd1",
"Convenience": "0x12ab...de56"
},
"blockHistoryLimit": 600,
"minConfirmations": 6,
"ignoreBlockedRequestsAfterBlocks": 20,
}A more complete example of a nodeSettings configuration:
{
"providerIdShort": "9e5a89d",
"nodeVersion": "0.1.0",
"cloudProvider": "aws",
"region": "us-east-1",
"stage": "testnet",
"logFormat": "plain",
"chains": [
{
"providerAdminForRecordCreation": "0x5e00...F410",
"id": 1,
"type": "evm",
"providers": [
{
"name": "infura-mainnet",
"url": "https://mainnet.infura.io/v3/<your key>"
}
],
"blockHistoryLimit": 600,
"minConfirmations": 0,
"ignoreBlockedRequestsAfterBlocks": 20
},
{
"providerAdminForRecordCreation": "0x5e00...F410",
"id": 3,
"type": "evm",
"providers": [
{
"name": "infura-ropsten",
"url": "https://ropsten.infura.io/v3/<your key>"
}
],
"contracts": {
"Airnode": "0xf1d4...0bd1"
}
}
]
}A UUID defined by the platform for the specific config.json file and its corresponding security.json file.