# @api3/airnode-node

> > The node part of Airnode that allows for connecting multiple blockchains to the rest of the world

Latest version **0.15.0** (published 2025-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @api3/airnode-node
pnpm add @api3/airnode-node
yarn add @api3/airnode-node
bun add @api3/airnode-node
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.15.0 |
| Published | 2025-02-11 |
| First published | 2021-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 559 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | aquarat, dcroote, bbenligiray, siegrift |

## Links

- npm: https://www.npmjs.com/package/@api3/airnode-node
- npm.io page: https://npm.io/package/@api3/airnode-node

## Dependencies (18)

- [zod](https://npm.io/package/zod.md) ^3.22.4
- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.4.7
- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [express](https://npm.io/package/express.md) ^4.21.2
- [date-fns](https://npm.io/package/date-fns.md) ^3.6.0
- [@api3/ois](https://npm.io/package/@api3/ois.md) 2.3.2
- [@api3/chains](https://npm.io/package/@api3/chains.md) ^8.1.1
- [@api3/commons](https://npm.io/package/@api3/commons.md) ^0.9.0
- [@api3/airnode-abi](https://npm.io/package/@api3/airnode-abi.md) ^0.15.0
- [@api3/promise-utils](https://npm.io/package/@api3/promise-utils.md) ^0.4.0
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^9.6.3
- [@api3/airnode-adapter](https://npm.io/package/@api3/airnode-adapter.md) ^0.15.0
- [@api3/airnode-protocol](https://npm.io/package/@api3/airnode-protocol.md) ^0.15.0
- [@aws-sdk/client-lambda](https://npm.io/package/@aws-sdk/client-lambda.md) ^3.525.0
- [@api3/airnode-utilities](https://npm.io/package/@api3/airnode-utilities.md) ^0.15.0
- [@api3/airnode-validator](https://npm.io/package/@api3/airnode-validator.md) ^0.15.0

## Recent versions

- 0.15.0 (latest) — 2025-02-11
- 0.0.0-snapshot-v0.15.0-rc.1-20250210054756 (snapshot-v0.15.0-rc.1) — 2025-02-10
- 0.0.0-snapshot-v0.15.0-20250205061011 (snapshot-v0.15.0) — 2025-02-05
- 0.14.2 (latest-v0.14) — 2024-07-02
- 0.0.0-snapshot-v0.14.1-20240327044816 (snapshot-v0.14.1) — 2024-03-27
- 0.0.0-snapshot-v0.14.0-20240120073728 (snapshot-v0.14.0) — 2024-01-20
- 0.13.0 (latest-v0.13) — 2023-10-31
- 0.0.0-snapshot-v0.13.0-20231025043648 (snapshot-v0.13.0) — 2023-10-25
- 0.12.0 (latest-v0.12) — 2023-07-25
- 0.0.0-snapshot-v0.12.0-20230724135702 (snapshot-v0.12.0) — 2023-07-24
- 0.11.2 (latest-v0.11) — 2023-06-28
- 0.0.0-snapshot-v0.11.2-20230616063534 (snapshot-v0.11.2) — 2023-06-16
- 0.0.0-snapshot-v0.11.1-20230519090453 (snapshot-v0.11.1) — 2023-05-19
- 0.10.1 (latest-v0.10) — 2023-04-11
- 0.0.0-snapshot-v0.11.0-20230411070200 (snapshot-v0.11.0) — 2023-04-11
- … 46 more at https://npm.io/package/@api3/airnode-node/versions

## README

# `@api3/airnode-node`

> The node part of Airnode that allows for connecting multiple blockchains to the rest of the world

## Documentation

You can learn all the information about Airnode in the [docs](https://airnode-docs.api3.org/reference/airnode/latest/).

## For developers

### Build the docker image locally

To build the image follow these [instructions](./docker/README.md).

### Configuration

Before running Airnode, you will need to have a valid `config.json` and `security.json` placed in the
packages/airnode-node folder. You can find more information on these files in the API3 documentation
[repository](https://github.com/api3dao/api3-docs).

### Usage

You must have a valid `config.json` file present in the `__dev__` folder. It is also recommended to use a `.env` file
for handling secrets. See [Development](#Development) below for more details.

### Invoking

Airnode does not yet have an stable API for usage. However, you can run Airnode locally, for development and test
environments, by running the following command:

```sh
# Run Airnode once using the AWS serverless handler
yarn run dev:invoke
```

### Testing API

You can test the endpoints specified in your `config.json` by running the following command:

```sh
# --endpoint-id Endpoint ID
# --parameters Parameters as JSON
yarn run dev:http-data-invoke --endpoint-id "0xd9e8c9bcc8960df5f954c0817757d2f7f9601bd638ea2f94e890ae5481681153" --parameters '{"coinId": "bitcoin"}'
```

### Directory Structure

```sh
src/
├── adapters/            # Modules allowing Airnode access to the outside world
│   └── http/            # The HTTP adapter
├── api/                 # Contains the handler which calls the API provider, performs request processing
├── cli/                 # Contains basic CLI which to invoke the Airnode locally during development and tests
├── config/              # Global Airnode configuration
├── coordinator/         # The "main" function that oversees execution and state
│   └── calls/           # Aggregating, executing and disaggregating API calls
├── evm/                 # EVM specific code
│   ├── authorization/   # Authorizing requesters and requests
│   ├── contracts/       # Contract addresses and ABIs
│   ├── fulfillments/    # Fulfilling EVM requests
│   ├── handlers/        # EVM specific "pipeline" implementations
│   ├── requests/        # Request/response specific code
│   ├── templates        # Fetching and applying request templates
│   └── verification/    # Request verification
├── handlers/            # "Pipeline" type modules that generally serve as entry points
├── providers/           # Provider workers and state
├── reporting/           # Heartbeat implementation
├── requests/            # Generic modules applicable to different blockchains
├── utils/               # General utility functions
└── workers/             # Utility function that allow for "forking"
    └── cloud-platforms/ # Implementations for specific cloud vendors
```

### Local invocation

Before you can use or invoke Airnode locally, you must have a valid `config.json` in the `config` folder. You can find
the specification in the
[config.json documentation](https://airnode-docs.api3.org/reference/airnode/latest/deployment-files/config-json.html).

For your convenience, example `config.json` and `secrets.env` files are provided in the `config` folder. You can simply
copy these files and remove the `.example` from the filename.

### Unit tests

Like with a development setup, it is important to ensure that all sibling dependencies are built before running tests.
Use `yarn run build` from the monorepo root to build all of these packages.

Tests can run using the following commands:

```sh
# From the monorepo root
yarn run test:node
# Watches all changes to node files and re-runs tests when one is changed
yarn run test:node:watch
# Watches all changes to a specific node file and re-runs tests when it is changed
yarn run test:node:watch -f src/evm/handlers/initialize-provider.test.ts
# From the node package
yarn run test
yarn run test:watch
yarn run test:watch -f evm/handlers/initialize-provider.test.ts
```

### E2E tests

End-to-end (E2E) tests test the entire Airnode request–response protocol, from start to finish. This includes (but is
not limited to): deploying Airnode RRP, creating the relevant onchain data, making onchain requests, invoking Airnode
and testing relevant expected outcomes.

In order to run E2E tests, you will need to have both an Ethereum node and the "dummy" web API running. The simplest way
to accomplish this is by running following commands from the repo root:

```sh
# Start an Ethereum node and mock API
yarn run dev:eth-node
yarn run dev:api

# OR

# Start both an Ethereum node and the "dummy" web API as background processes
yarn run dev:background
```

E2E tests are run in parallel and can be run using the following commands:

```sh
# Run all E2E tests in parallel
yarn run test:e2e

# Run a specific E2E test and include Airnode log output. Change the test in package.json
yarn run test:e2e:debug
```

E2E tests are defined in the `test/e2e/` folder and are identified by the `feature.ts` extension.

---
_Source: https://npm.io/package/@api3/airnode-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
