📂 API Providers > Build an Airnode

# Deploying Airnode

Table of Contents

After integrating your API (API Integration) and creating the configuration files (Configuring Airnode), the next step is to deploy the Airnode.

Complete the following before deploying your Airnode.

# Deploy with Docker

The recommended way to deploy Airnode is by using the Docker deployer image. This image is simply a wrapper around the deployer CLI (opens new window). Try out the Quick Deploy tutorial if you wish to become familiar with the deployer image first.

The deployer interacts with a cloud provider (AWS) to deploy Airnode programmatically, without requiring you to click through a lot of ever-changing graphical interfaces. For it to do so, an aws.env file is required and was discussed in Configuring an Airnode.

# Install Docker

The deployer image is containerized as a Docker image. This will deploy the Airnode to AWS Lambda without the worry of installing dependencies and is the recommended way to do a deployment. If you do not already have docker installed go to the Docker website (opens new window) and install it.

# Deployment

At this point your project should resemble the following. The config.json, secrets.env and aws.env files should be ready to go. Other files you may have added are expected but not used by the deployer image.

my-airnode
├── aws.env
├── config
│   ├── config.json
│   └── secrets.env
└── output
    ├── receipt.json
1
2
3
4
5
6
7

From the root of the project directory run the Docker deployer image which will deploy the Airnode to AWS. When the deployment has completed a receipt.json file will be written to the /output folder. This file contains important configuration information about the Airnode and is needed to remove the Airnode should the need arise.

Normally (for Linux/Mac/WSL2) the deployer image deploy command is run by the user root. This may cause permission issues when the receipt.json file is generated. Optionally you can specify the UID (user identifier) and GID (group identifier) that the deployer image should use. Do so by setting the environment variables USER_ID and GROUP_ID, otherwise omit the line containing the variables.

When the deployment is complete a receipt.json' file is placed into the/output` folder.

# receipt.json

The receipt.json file is a product of a successful deployment. It contains configuration information for the Airnode and must be used to remove the Airnode should you choose.

{
  "airnodeWallet": {
    "airnodeAddress": "0xaBd9daAdf32fCd96eE4607bf3d5B31e19a244Cac",
    "airnodeAddressShort": "abd9daa",
    "xpub": "xpub661MyMwAqRbcGHp9uC7...vbeziJwFHuNs"
  },
  "deployment": {
    "airnodeAddressShort": "abd9daa",
    "cloudProvider": "aws",
    "region": "us-east-1",
    "stage": "dev",
    "nodeVersion": "0.2.2"
  },
  "api": {
    "httpGatewayUrl": "https://6vmx3xp8tj.execute-api.us-east-1.amazonaws.com/v1/test"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Testing with HTTP Gateway

If you opted to enable the HTTP Gateway it can be used to test the Airnode while bypassing the chain it was deployed to. There are two examples in other docs that detail how to do this.

# Removing the Airnode

When the Airnode was deployed a receipt.json file was created in the /output folder. This file is needed to remove an Airnode.

  • --env-file: Location of the aws.env file.
  • -v: Location of the receipt.json file.

# Calling the Airnode

Once the Airnode is deployed, see Calling an Airnode to learn how requests are made to it.

Last Updated: 8/9/2022, 2:28:25 PM