Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify airnode-examples README for users and devs #1040

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tough-bags-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-examples': patch
---

Clarify airnode-examples instructions for users and developers
58 changes: 23 additions & 35 deletions packages/airnode-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,55 +175,43 @@ Refer to the
[documentation](https://docs.api3.org/airnode/latest/grp-providers/guides/build-an-airnode/configuring-airnode.html) for
more details.

### 9. Build docker artifacts
### 9. (Only if deploying to a cloud provider) Deploy Airnode

The docker images are based on a common container called "artifacts". This intermediate container is used by both
[deployer](https://github.com/api3dao/airnode/tree/master/packages/airnode-deployer) and
[airnode](https://github.com/api3dao/airnode/tree/master/packages/airnode-node). The artifacts container can be built by
running:

```sh
yarn rebuild-artifacts-container
```

### 10. (Only if deploying to a cloud provider) Build deployer container
Now you're ready to deploy Airnode on the cloud provider. To proceed, run:

```sh
yarn rebuild-deployer-container
yarn deploy-airnode
```

This command will use the previously built artifacts container to build the deployer.
This command will use the released deployer Docker image corresponding to the tag checked out during [Setup](#setup).
The image itself is based on the [deployer](https://github.com/api3dao/airnode/tree/master/packages/airnode-deployer)
package. Note that deployment may take some time and should not be interrupted. Please be patient.

### 11. (Only if deploying to a cloud provider) Deploy Airnode

Now you're ready to deploy Airnode on the cloud provider. To proceed, run:
If you are a developer and would like to use a different deployer Docker image, provide the full image name as an
additional argument. For example:

```sh
yarn deploy-airnode
yarn deploy-airnode api3/airnode-deployer-dev:bb9b8118940ec852c4223b13eba5a6eb97aa3b97
```

This command will use the [deployer](https://github.com/api3dao/airnode/tree/master/packages/airnode-deployer) package
to deploy your Airnode. Deployment may take some time and should not be interrupted. Please be patient.

### 12. (Only if running Airnode locally) Build Airnode docker container
### 10. (Only if running Airnode locally) Run the Airnode container

```sh
yarn rebuild-airnode-container
yarn run-airnode-locally
```

This command will utilise the previously built artifacts container to build the containerized version of Airnode which
you can then run locally.
This command will use the released client Docker image corresponding to the tag checked out during [Setup](#setup). Note
that the containerized version runs a cron job which triggers every minute - this means that Airnode logs won't start
appearing immediately.

### 13. (Only if running Airnode locally) Run the Airnode container
If you are a developer and would like to use a different client Docker image, provide the full image name as an
additional argument. For example:

```sh
yarn run-airnode-locally
yarn run-airnode-locally api3/airnode-client-dev:bb9b8118940ec852c4223b13eba5a6eb97aa3b97
```

Runs the previously built version of Airnode container. Note that the containerized version runs a cron job which
triggers every minute - this means that Airnode logs won't start appearing immediately.

### 14. Deploy a requester
### 11. Deploy a requester

At this point, you have an RRP contract deployed. You will also either have Airnode running as a Docker container
locally or deployed to a cloud provider. Airnode is now listening for events (requests to be made) from the RRP
Expand All @@ -236,7 +224,7 @@ To deploy a requester contract, run:
yarn deploy-requester
```

### 15. Derive and fund the sponsor wallet
### 12. Derive and fund the sponsor wallet

Airnode requests require a [sponsor](https://docs.api3.org/airnode/latest/concepts/sponsor.html), which will pay for the
response transaction made by Airnode. Each sponsor has a dedicated wallet for a given Airnode. This wallet is called a
Expand All @@ -254,7 +242,7 @@ yarn derive-and-fund-sponsor-wallet
This script will first derive the sponsor wallet and then fund it with 0.1 ETH. This means that your account (derived
from the mnemonic by `choose-integration` script) must have enough funds.

### 16. Allow the sponsor to pay for requests made by the requester
### 13. Allow the sponsor to pay for requests made by the requester

In order to prevent misuse, each sponsor has to explicitly approve a requester. Once the requester is approved, requests
can be paid by this sponsor.
Expand All @@ -263,7 +251,7 @@ can be paid by this sponsor.
yarn sponsor-requester
```

### 17. Make the request
### 14. Make the request

The last step is to trigger an Airnode request using the requester contract:

Expand All @@ -276,7 +264,7 @@ emit an event in response, which Airnode will detect during its next cycle. On r
will perform the associated API call and submit the response back on chain. The above command will wait for all of this
to take place and once the request has been fulfilled the output will be sent to the terminal.

### 18. (Optional) Make a withdrawal request
### 15. (Optional) Make a withdrawal request

Withdrawal requests instruct the Airnode return the funds of particular sponsor wallet back to the sponsor. This step is
useful when testing on public testnets. To execute a withdrawal request run:
Expand All @@ -285,7 +273,7 @@ useful when testing on public testnets. To execute a withdrawal request run:
yarn make-withdrawal-request
```

### 19. (Only if deploying to a cloud provider) Remove Airnode from the cloud provider
### 16. (Only if deploying to a cloud provider) Remove Airnode from the cloud provider

If you wish to tear down the Airnode from the cloud provider run:

Expand Down