Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: airnode-protocol README and scripts updates #1887

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 filename (without the `.json` extension) from
https://github.com/api3dao/chains/tree/main/chains. 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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠

Loading