Skip to content

Commit d2e5a04

Browse files
authored
fix: airnode-protocol README and scripts updates (#1887)
* api3dao/chains is the network name source of truth
1 parent 2a98317 commit d2e5a04

4 files changed

Lines changed: 24 additions & 6 deletions

File tree

.changeset/little-spies-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@api3/airnode-protocol': patch
3+
---
4+
5+
Minor README and scripts updates

packages/airnode-protocol/README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ yarn run test:coverage
2121
yarn run test:gas
2222
```
2323

24-
Deploy the contracts on a network (`<NETWORK>` must be one of the names from `credentials.example.json`), verify the
25-
deployment
24+
### Contract deployment
25+
26+
To deploy the contracts on a network first copy `example.env` to `.env`. Enter a mnemonic and any appropriate API keys.
27+
Note that the mnemonic must be present (though can be arbitrary) even if the exclusive goal is contract verification.
28+
The `<NETWORK>` in the below commands must correspond to a filename (without the `.json` extension) from
29+
https://github.com/api3dao/chains/tree/main/chains. If a hardhat error occurs during verification stating that a json
30+
file in `artifacts/build-info` is missing, running `yarn run clean` followed by `yarn run compile` should fix it.
2631

2732
```sh
2833
# Deploys deterministically (does not work on some chains)
@@ -34,8 +39,14 @@ NETWORK=<NETWORK> yarn run deploy:undeterministic
3439
# Verifies the deployment on the respective block explorer (not supported for some chains)
3540
NETWORK=<NETWORK> yarn run deploy:verify
3641

37-
# Verifies the deployment locally (only works for undeterministic deployments)
38-
NETWORK=<NETWORK> yarn run deploy:verify-local
42+
# Verifies the deployments locally
43+
yarn run test:verify-local
44+
45+
# The same as above, but for a specific network
46+
NETWORK=<NETWORK> yarn run test:verify-local:network
47+
48+
# Generates deployments/references.json
49+
yarn run deploy:generate-references
3950
```
4051

4152
### Deterministic deployment addresses
@@ -46,6 +57,8 @@ RequesterAuthorizerWithAirnode: 0xf18c105D0375E80980e4EED829a4A68A539E6178
4657

4758
AccessControlRegistry: 0x92E5125adF385d86beDb950793526106143b6Df1
4859

60+
AirnodeRrpV0DryRun: 0x2e768206bf5112e7D7efAf1d9df614C26475193f
61+
4962
### Integration notes
5063

5164
- `arbitrum`, `avalanche`, `metis` and their testnets do not support deterministic deployment and are deployed

packages/airnode-protocol/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"scripts": {
1212
"build": "yarn run clean && yarn compile",
13-
"clean": "rimraf -g ./src/contracts *.tsbuildinfo ./dist ./build *.tgz",
13+
"clean": "rimraf -g ./src/contracts *.tsbuildinfo ./dist ./build *.tgz && yarn run hardhat clean",
1414
"compile": "yarn run compile:contracts && yarn run compile:tsc",
1515
"compile:contracts": "hardhat compile",
1616
"compile:tsc": "yarn compile:contract-dts && yarn compile:copy-contract-dts && tsc --build tsconfig.json",

packages/airnode-protocol/scripts/generate-references.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ const networks = Object.entries(references.chainNames).reduce((acc, [chainId, na
3030
}, {});
3131
references.networks = networks;
3232

33-
fs.writeFileSync(path.join('deployments', 'references.json'), JSON.stringify(references, null, 2));
33+
fs.writeFileSync(path.join('deployments', 'references.json'), JSON.stringify(references, null, 2) + '\n');

0 commit comments

Comments
 (0)