📂 Reference > Packages

# Deployer

Table of Contents

The airnode-deployer (opens new window) package is used primarily by the Docker Images. This CLI tool provides the underlying commands used by the Docker images when deploying an Airnode.

Deploying an Airnode

API providers are strongly encouraged to use the Docker Images when deploying an Airnode and not the deployer CLI commands.

# Usage

The deployer's commands can be run using npx (opens new window), installing a global npm package or by manually building the airnode-deployer package. Using npx is the simplest method to interact with the deployer manually if you do not wish to use the Docker images.

# Using npx

The airnode-deployer package can be run as an npm package using npx. This allows you to run deployer commands without installing the deployer npm package or having to manually build the airnode-deployer package yourself.

npx @api3/airnode-deployer deploy --config config/config.json --secrets config/secrets.env --receipt config/receipt.json
1

# Global Package

The airnode-deployer package can be installed globally with yarn or npm. If installed using yarn make sure yarn bin is added to PATH.

yarn global add @api3/airnode-deployer
# OR
npm install @api3/airnode-deployer -g
# Executing the deployer.
airnode-deployer deploy --config config/config.json --secrets config/secrets.env --receipt config/receipt.json
1
2
3
4
5
6

# Commands

# Airnode Deployment

When creating or updating an Airnode the config.json and secrets.env files are needed. You can use the provided example config.json (opens new window) and secrets.env (opens new window) templates to get started quickly, but you will need to edit these with your own API details and secrets.

Warning about simultaneous deployments

Avoid running multiple deployments simultaneously as doing so might result in a broken deployment. If this occurs, the standard removal approach may not succeed and Manual Removal may be required.

Make sure config.json and secrets.env are available in the path for the --configuration argument.

# deploy

When executed, the deploy command defaults to creating a receipt.json file in the config/ directory, although a different path can be specified using the path and name with the --receipt argument. The receipt contains metadata about the deployment and can be used to remove the Airnode.

If the deployment isn't successful, the command will try to automatically remove deployed resources. You can disable this by running the deploy command with a --no-auto-remove argument.

# Deploys an Airnode instance using the `config.json` and `secrets.env` files.
# This can be used for a new deployment or to update an existing deployment.
Options:
      --version                          Show version number                                                   [boolean]
      --debug                            Run in debug mode                                    [boolean] [default: false]
      --help                             Show help                                                             [boolean]
  -c, --configuration, --config, --conf  Path to configuration file             [string] [default: "config/config.json"]
  -s, --secrets                          Path to secrets file                   [string] [default: "config/secrets.env"]
  -r, --receipt                          Output path for receipt file          [string] [default: "config/receipt.json"]
      --auto-remove                      Enable automatic removal of deployed resources for failed deployments
                                                                                               [boolean] [default: true]
# Basic example
airnode-deployer deploy
# Advanced example
airnode-deployer deploy --config config/config.json --secrets config/secrets.env --receipt config/receipt.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# Airnode Removal

An Airnode can be removed in two different ways:

  • Best: With remove-with-receipt, which uses the deployment receipt created when the Airnode was deployed.
  • Alternate: With remove-with-deployment-details, which uses the Airnode address and cloud provider specifications. The Airnode address can be found in the receipt.json file or obtained via Admin CLI command derive-airnode-address. The other values can be found in config.json.
    • nodeSetting.cloudProvider.type
    • nodeSetting.cloudProvider.region
    • nodeSetting.cloudProvider.projectId (GCP only)
    • nodeSetting.stage

# remove-with-receipt

# Removes a deployed Airnode instance.
Options:
      --version                Show version number                                                             [boolean]
      --debug                  Run in debug mode                                              [boolean] [default: false]
      --help                   Show help                                                                       [boolean]
  -r, --receipt                Path to receipt file                            [string] [default: "config/receipt.json"]
# Basic example
airnode-deployer remove-with-receipt
# Advanced example specifying the receipt file location
airnode-deployer remove-with-receipt --receipt config/receipt.json
1
2
3
4
5
6
7
8
9
10
11
12
13

# remove-with-deployment-details

# Removes a deployed Airnode instance.
Options:
      --version                Show version number                                                             [boolean]
      --debug                  Run in debug mode                                              [boolean] [default: false]
      --help                   Show help                                                                       [boolean]
  -a, --airnode-address        Airnode Address                                                                  [string]
  -s, --stage                  Stage (environment)                                                              [string]
  -c, --cloud-provider         Cloud provider                                                    [choices: "aws", "gcp"]
  -e, --region                 Region                                                                           [string]
  -p, --project-id             Project ID (GCP only)                                                            [string]
# Example
airnode-deployer remove-with-deployment-details --airnode-address 0xaBd9daAdf32fCd96eE4607bf3d5B31e19a244Cac --stage dev --cloud-provider aws --region us-east-1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Last Updated: 12/17/2022, 5:44:01 AM