# Self-serve Integration
Assuming you have determined that your platform is compatible, you can attempt to do the integration yourself by following the steps below.
# Part 1: Protocol contract deployment
Replace parts starting with $
- Clone the Airnode monorepo (opens new window) (currently you need to use the
pre-alpha
branch)
git clone --single-branch --branch pre-alpha https://github.com/api3dao/airnode.git
- Install its dependencies and build it
cd airnode
yarn run bootstrap
yarn run build
2
3
- Go to the protocol package (opens new window)
cd packages/protocol
- Create a
credentials.json
file, similar to credentials.example.json (opens new window)
cp credentials.example.json credentials.json
- Add the following entry to
credentials.json
"$CHAIN_NAME" :{
"mnemonic": "$MNEMONIC",
"providerUrl": "$PROVIDER_URL"
}
2
3
4
$CHAIN_NAME
is the name that will be used to refer to your chain.
$MNEMONIC
is the mnemonic of the wallet that you will use to deploy the protocol contracts.
Make sure that it is funded (if applicable).
$PROVIDER_URL
is the URL of the node JSON-RPC API you will use to deploy the protocol contracts.
- Add the following entry to hardhat.config.js (opens new window)
$CHAIN_NAME: {
url: credentials.$CHAIN_NAME.providerUrl || '',
accounts: { mnemonic: credentials.$CHAIN_NAME.mnemonic || '' },
}
2
3
4
- Add the following script to package.json (opens new window)
"deploy:$CHAIN_NAME": "hardhat deploy --network $CHAIN_NAME"
- Finally, run the added script to deploy the contracts, which will record the deployment details including the contract address in the
/deployments
(opens new window) directory.
yarn run deploy:$CHAIN_NAME
If your chain has a customized flow for deploying contracts, you can find the bytecodes of the compiled contracts in the artifacts/
directory.
Note that you will need to deploy both Airnode.sol and Convenience.sol.
# Part 2: Make a test call
After completing Part 1, you must have two contract addresses, one for Airnode.sol
and one for Convenience.sol
.
Now follow the steps below to make a test call:
- Clone the airnode-starter (opens new window) repo
git clone --single-branch --branch pre-alpha https://github.com/api3dao/airnode-starter.git
Open the config.example.json (opens new window) file in
config/
. Replace the following values:nodeSettings.chains.0.id
:3
-> The ID of your chainnodeSettings.chains.contracts.Airnode
:0xF8d32C3e53F7DA6e7CB82323f2cAB2159776b832
-> The address of theAirnode.sol
contract you have deployednodeSettings.chains.contracts.Convenience
:0x1552cF617711D6Da04E0EDC9e5C26eBbA08625ac
-> The address of theConvenience.sol
contract you have deployed
Follow the instructions (opens new window) (both Step 1 and 2). Note that you can use the
$MNEMONIC
and the$PROVIDER_URL
you have used while deploying the contracts in your.env
file.
The final step of the instructions is to run the make-request
script, which will make a request on your chain for the Airnode to fulfill it.
This example project working as intended is a very good indicator that the integration has succeeded.
After doing this, you are recommended to take a deep dive into our docs (opens new window) next to learn more about Airnode and its protocol.