📂 Concepts and Definitions

# Request-Response Protocol

Table of Contents

The first protocol implemented for Airnode is request–response. An Airnode serving the request–response protocol listens for requests, makes the API call specified by the request, and finally makes the response transaction back on chain.

# Contracts

This sections briefly describes the structure of the request response protocol contracts. You can find more information in the source files on github (opens new window).

The request–response protocol is implemented as a single permissionless contract that all Airnodes interact with, which is named AirnodeRrp.sol. This base contract has the following inheritance tree that compartmentalizes the aspects of the protocol.

rrp-sol-diagram

# AirnodeRrp.sol

The AirnodeRrp.sol (opens new window) contract sits between a requester and the Airnode. It inherits from four additional contracts as illustrated in the diagram above:

This contract has two key responsibilities:

  • It is used by requesters to make requests.
  • It is used by Airnodes to fulfill requests.

However, this contract is shared for all requesters and Airnodes on a particular chain. This means that neither Airnode operators nor requesters need to deploy this contract themselves. Instead, API3 will deploy this contract once per chain and you simply connect your Airnode or requester contract to that deployed contract. See the Airnode contract addresses for reference.

The @api3/airnode-admin package is a CLI tool used to interact with AirnodeRrp.sol and perform administrative actions.

# IAirnodeRrp.sol

The IAirnodeRrp.sol (opens new window) interface describes all functions and events of the AirnodeRrp.sol contract which implements this interface.

This interface inherits:

# AuthorizationUtils.sol

The AuthorizationUtils.sol (opens new window) contract implements Airnode authorization checks.

# WithdrawalUtils.sol

The WithdrawalUtils.sol (opens new window) contract allows the sponsor to trigger a withdrawal request which is later fulfilled by Airnode and all sponsor wallet funds are sent back to the sponsor.

# TemplateUtils.sol

The TemplateUtils.sol (opens new window) contract is used to create and store Airnode templates used to create a template request.

Last Updated: 3/7/2022, 8:32:47 AM