Skip to content

Commit

Permalink
fix: airnode-protocol README and scripts updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dcroote committed Sep 20, 2023
1 parent 2a98317 commit 1405a92
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-spies-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-protocol': patch
---

Minor README and scripts updates
21 changes: 17 additions & 4 deletions packages/airnode-protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ yarn run test:coverage
yarn run test:gas
```

Deploy the contracts on a network (`<NETWORK>` must be one of the names from `credentials.example.json`), verify the
deployment
### Contract deployment

To deploy the contracts on a network first copy `example.env` to `.env`. Enter a mnemonic and any appropriate API keys.
Note that the mnemonic must be present (though can be arbitrary) even if the exclusive goal is contract verification.
The `<NETWORK>` in the below commands must correspond to a network in `TODO`. If a hardhat error occurs during
verification stating that a json file in `artifacts/build-info` is missing, running `yarn run clean` followed by
`yarn run compile` should fix it.

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

# Verifies the deployment locally (only works for undeterministic deployments)
NETWORK=<NETWORK> yarn run deploy:verify-local
# Verifies the deployments locally
yarn run test:verify-local

# The same as above, but for a specific network
NETWORK=<NETWORK> yarn run test:verify-local:network

# Generates deployments/references.json
yarn run deploy:generate-references
```

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

AccessControlRegistry: 0x92E5125adF385d86beDb950793526106143b6Df1

AirnodeRrpV0DryRun: 0x2e768206bf5112e7D7efAf1d9df614C26475193f

### Integration notes

- `arbitrum`, `avalanche`, `metis` and their testnets do not support deterministic deployment and are deployed
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"scripts": {
"build": "yarn run clean && yarn compile",
"clean": "rimraf -g ./src/contracts *.tsbuildinfo ./dist ./build *.tgz",
"clean": "rimraf -g ./src/contracts *.tsbuildinfo ./dist ./build *.tgz && yarn run hardhat clean",
"compile": "yarn run compile:contracts && yarn run compile:tsc",
"compile:contracts": "hardhat compile",
"compile:tsc": "yarn compile:contract-dts && yarn compile:copy-contract-dts && tsc --build tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-protocol/scripts/generate-references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ const networks = Object.entries(references.chainNames).reduce((acc, [chainId, na
}, {});
references.networks = networks;

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

0 comments on commit 1405a92

Please sign in to comment.