From c80828680517885c5d8332d5dd3b2d0e7621b09c Mon Sep 17 00:00:00 2001 From: Derek Croote Date: Tue, 26 Apr 2022 22:11:30 -0700 Subject: [PATCH 1/2] Clarify airnode-examples README for users and devs --- .changeset/tough-bags-teach.md | 5 +++ packages/airnode-examples/README.md | 58 ++++++++++++----------------- 2 files changed, 28 insertions(+), 35 deletions(-) create mode 100644 .changeset/tough-bags-teach.md diff --git a/.changeset/tough-bags-teach.md b/.changeset/tough-bags-teach.md new file mode 100644 index 0000000000..be9fc8a220 --- /dev/null +++ b/.changeset/tough-bags-teach.md @@ -0,0 +1,5 @@ +--- +'@api3/airnode-examples': patch +--- + +Clarify airnode-examples instructions for users and developers diff --git a/packages/airnode-examples/README.md b/packages/airnode-examples/README.md index d1866c38aa..6c44208e29 100644 --- a/packages/airnode-examples/README.md +++ b/packages/airnode-examples/README.md @@ -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. 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:0.6.0 ``` -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. 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:0.6.0 ``` -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 @@ -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 @@ -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. @@ -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: @@ -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: @@ -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: From 9dc1f55d9dead47a1ac3755b644758ddf61b98de Mon Sep 17 00:00:00 2001 From: Derek Croote Date: Wed, 27 Apr 2022 06:41:06 -0700 Subject: [PATCH 2/2] Address review comments --- packages/airnode-examples/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/airnode-examples/README.md b/packages/airnode-examples/README.md index 6c44208e29..4cfc6d5f5b 100644 --- a/packages/airnode-examples/README.md +++ b/packages/airnode-examples/README.md @@ -183,15 +183,15 @@ Now you're ready to deploy Airnode on the cloud provider. To proceed, run: yarn deploy-airnode ``` -This command will use the released deployer Docker image corresponding to the tag checked out during 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. +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. 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 api3/airnode-deployer:0.6.0 +yarn deploy-airnode api3/airnode-deployer-dev:bb9b8118940ec852c4223b13eba5a6eb97aa3b97 ``` ### 10. (Only if running Airnode locally) Run the Airnode container @@ -200,15 +200,15 @@ yarn deploy-airnode api3/airnode-deployer:0.6.0 yarn run-airnode-locally ``` -This command will use the released client Docker image corresponding to the tag checked out during Setup. Note that the -containerized version runs a cron job which triggers every minute - this means that Airnode logs won't start appearing -immediately. +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. 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 api3/airnode-client:0.6.0 +yarn run-airnode-locally api3/airnode-client-dev:bb9b8118940ec852c4223b13eba5a6eb97aa3b97 ``` ### 11. Deploy a requester