Run the following command to install all the dependencies:
npm install
-
You will need an Amazon Web Services (AWS) account before Airnode can be deployed
-
You will need Docker installed locally
-
Get your AWS IAM Access Keys with Administrator Access policy. You can watch this video if you're not sure how to obtain them.
-
Populate the aws.env file with your
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY -
Under the config directory, look for
secrets.envand add in yourAIRNODE_WALLET_MNEMONIC. Make sure you use the same mnemonic that you used to sign in with ChainAPI otherwise it will show your deployment as "inactive" on the ChainAPI's deployments section. -
Add in your
POLYGON_MUMBAI_TESTNET_1_PROVIDER_URL. You can have a different name for the Provider URL depending on what network you choose during integration. -
Your secrets file will also have
HEARTBEAT_URL,HEARTBEAT_IDandHEARTBEAT_API_KEYthat is automatically generated by ChainAPI to check if an Airnode is active or not. You can disable it inconfig.jsonbut it is not recommended as your deployments on ChainAPI will be marked as “inactive” and limit future opportunities. -
You can add in your
HTTP_SIGNED_DATA_GATEWAY_API_KEYandHTTP_GATEWAY_API_KEY_BETWEEN_30_TO_120_CHARACTERS(You can also use the values that are pre-filled by ChainAPI). The HTTP gateway is an optional service that allows authenticated users to make HTTP requests to your deployed Airnode instance. This is used for testing and future services provided by API3 and ChainAPI.
-
Open a terminal and change directory to where you extracted these files.
-
Run the following Docker command based on your current operating system. Follow any prompts or instructions.
-
You can more detailed information in the API3 Deployment Tutorial
docker run -it --rm ^
--env-file aws.env ^
-v "%cd%/config:/app/config" ^
-v "%cd%/output:/app/output" ^
api3/airnode-deployer:0.7.3 deploy
docker run -it --rm \
--env-file aws.env \
-e USER_ID=$(id -u) -e GROUP_ID=$(id -g) \
-v "$(pwd)/config:/app/config" \
-v "$(pwd)/output:/app/output" \
api3/airnode-deployer:0.7.3 deploy
docker run -it --rm \
--env-file aws.env \
-e USER_ID=$(id -u) -e GROUP_ID=$(id -g) \
-v "$(pwd)/config:/app/config" \
-v "$(pwd)/output:/app/output" \
api3/airnode-deployer:0.7.3 deploy
-
Clone and set up the Airnode Monorepo. install and build all the dependencies and packages to be able to access the Airnode CLI.
-
Using Remix IDE to deploy and call the Requester contract on the Polygon Mumbai Testnet.
-
Wallet with enough Matic to sponsor the
sponsorWallet. You can get some from the Mumbai Faucet.
- Head on to
src/encodeParams.jsand edit it to encode your parameters. - To get the encoded parameters:
node .\src\encodeParams.js
-
Compile and Deploy the
Requester.solcontract on Remix. Select the_rrpAddressfrom here. -
Derive your
sponsorWalletaddress using the Airnode CLI.
Note: The sponsor-address here will be the address of the Requester Contract that you just deployed.
npx @api3/airnode-admin derive-sponsor-wallet-address \
--airnode-xpub xpub6CUGRUo... \
--airnode-address 0xe1...dF05s \
--sponsor-address 0xF4...dDyu9
npx @api3/airnode-admin derive-sponsor-wallet-address ^
--airnode-xpub xpub6CUGRUo... ^
--airnode-address 0xe1...dF05s ^
--sponsor-address 0xF4...dDyu9
Fund the sponsorWallet with some test MATIC
-
Pass in your
airnode,endpointID,sponsor(The Requester contract itself),sponsorWallet(derived from the Airnode CLI) andparametersto call themakeRequestfunction. -
Check the latest transaction from the
sponsorWalletand go to its logs. The requested data will be encoded inbytes32. -
You can get the
requestIdfrom the transaction logs and then pass it through thefulfilledDatafunction to get the decoded output.