Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
9 changes: 9 additions & 0 deletions .changeset/tough-sloths-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@api3/airnode-utilities': minor
'@api3/airnode-deployer': minor
'@api3/airnode-examples': minor
'@api3/airnode-admin': minor
'@api3/airnode-node': minor
---

Replace Node.js 18 with Node.js 20
6 changes: 5 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
DOCKER_BUILDKIT: 1
TARGET_NODE_VERSION: '18.14.0'
TARGET_NODE_VERSION: '20.10.0'

jobs:
documentation:
Expand Down Expand Up @@ -139,6 +139,8 @@ jobs:
with:
node-version: ${{ env.TARGET_NODE_VERSION }}
cache: yarn
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Start background services
run: yarn run dev:background
- run: yarn run test:e2e-${{ matrix.package }}
Expand All @@ -159,6 +161,8 @@ jobs:
with:
node-version: ${{ env.TARGET_NODE_VERSION }}
cache: yarn
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Start background services
run: yarn run dev:background
- run: yarn run test:e2e-examples
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/protocol-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
DOCKER_BUILDKIT: 1
TARGET_NODE_VERSION: '18.14.0'
TARGET_NODE_VERSION: '20.10.0'

jobs:
pre-build:
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.17 AS environment
FROM node:20.10.0-alpine3.17 AS environment

ENV appDir="/app" \
buildDir="/build" \
Expand All @@ -7,7 +7,7 @@ ENV appDir="/app" \
CI="true"

RUN apk add --update --no-cache git rsync docker $([ $(arch) == "aarch64" ] && echo "python3 make g++") && \
yarn global add npm@^9.8.1 && \
yarn global add npm && \
# Download both solidity compilers as per: https://github.com/nomiclabs/hardhat/issues/1280#issuecomment-949822371
mkdir -p /root/.cache/hardhat-nodejs/compilers-v2/wasm && \
wget -O /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.9+commit.e5eed63a.js https://solc-bin.ethereum.org/wasm/soljson-v0.8.9+commit.e5eed63a.js && \
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"private": true,
"engines": {
"node": "^18.14.0"
"node": "^20.10.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -110,7 +110,7 @@
"@changesets/cli": "^2.27.1",
"@octokit/core": "^5.1.0",
"@types/libsodium-wrappers": "^0.7.13",
"@types/node": "^18.19.21",
"@types/node": "^20.10.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vercel/ncc": "^0.38.1",
Expand All @@ -131,5 +131,6 @@
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"yargs": "^17.7.2"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion packages/airnode-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/mocha": "^10.0.6",
"chai": "^4.4.1",
"ethereum-waffle": "^4.0.10",
"hardhat": "^2.14.1",
"hardhat": "^2.23.0-dev.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This didn't help.

"jest": "^29.7.0",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('buildingRequest', () => {
const options = fixtures.buildRequestOptions();
const res = build.buildRequest(options);
expect(res).toEqual({
baseUrl: 'http://localhost:5000',
baseUrl: 'http://localhost:5005',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mac OS runs an Airdrop service on this port.

data: {
access_key: 'super-secret-key',
amount: '1',
Expand Down
20 changes: 10 additions & 10 deletions packages/airnode-adapter/src/request-building/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('executeRequest', () => {
it('executes simple GET requests', async () => {
responseMock.mockResolvedValueOnce({ value: '10000' });
const request: Request = {
baseUrl: 'http://localhost:5000',
baseUrl: 'http://localhost:5005',
data: { from: 'ETH', to: 'USD' },
headers: { api_key: 'supersecret' },
method: 'get',
Expand All @@ -20,7 +20,7 @@ describe('executeRequest', () => {
expect(res).toEqual({ value: '10000' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'get',
headers: { api_key: 'supersecret' },
params: { from: 'ETH', to: 'USD' },
Expand All @@ -30,7 +30,7 @@ describe('executeRequest', () => {
it('executes GET requests with config', async () => {
responseMock.mockResolvedValueOnce({ value: '10000' });
const request: Request = {
baseUrl: 'http://localhost:5000',
baseUrl: 'http://localhost:5005',
data: { from: 'ETH', to: 'USD' },
headers: { api_key: 'supersecret' },
method: 'get',
Expand All @@ -40,7 +40,7 @@ describe('executeRequest', () => {
expect(res).toEqual({ value: '10000' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'get',
headers: { api_key: 'supersecret' },
params: { from: 'ETH', to: 'USD' },
Expand All @@ -51,7 +51,7 @@ describe('executeRequest', () => {
it('executes simple POST requests', async () => {
responseMock.mockResolvedValueOnce({ value: '10000' });
const request: Request = {
baseUrl: 'http://localhost:5000',
baseUrl: 'http://localhost:5005',
data: { from: 'ETH', to: 'USD' },
headers: { api_key: 'supersecret' },
method: 'post',
Expand All @@ -61,7 +61,7 @@ describe('executeRequest', () => {
expect(res).toEqual({ value: '10000' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'post',
headers: { api_key: 'supersecret' },
data: { from: 'ETH', to: 'USD' },
Expand All @@ -71,7 +71,7 @@ describe('executeRequest', () => {
it('executes POST requests with config', async () => {
responseMock.mockResolvedValueOnce({ value: '10000' });
const request: Request = {
baseUrl: 'http://localhost:5000',
baseUrl: 'http://localhost:5005',
data: { from: 'ETH', to: 'USD' },
headers: { api_key: 'supersecret' },
method: 'post',
Expand All @@ -81,7 +81,7 @@ describe('executeRequest', () => {
expect(res).toEqual({ value: '10000' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'post',
headers: { api_key: 'supersecret' },
data: { from: 'ETH', to: 'USD' },
Expand All @@ -98,7 +98,7 @@ describe('buildAndExecuteRequest', () => {
expect(res).toEqual({ value: '10000' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'get',
headers: {},
params: {
Expand All @@ -117,7 +117,7 @@ describe('buildAndExecuteRequest', () => {
expect(res).toEqual({ value: '7777' });
expect(axios).toHaveBeenCalledTimes(1);
expect(axios).toHaveBeenCalledWith({
url: 'http://localhost:5000/convert',
url: 'http://localhost:5005/convert',
method: 'get',
headers: {},
params: {
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-adapter/test/fixtures/ois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function buildOIS(overrides?: Partial<OIS>): OIS {
apiSpecifications: {
servers: [
{
url: 'http://localhost:5000',
url: 'http://localhost:5005',
},
],
paths: {
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-admin/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.17
FROM node:20.10.0-alpine3.17

ARG npmRegistryUrl=https://registry.npmjs.org/
ARG npmTag=latest
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@types/lodash": "^4.14.202",
"@types/node": "^18.19.21",
"@types/node": "^20.10.0",
"@types/yargs": "^17.0.32",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/airnode-admin/test/e2e/cli.feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ it('has disabled DEBUG_COMMANDS flag', () => {
expect(DEBUG_COMMANDS).toBe(false);
});

describe('CLI', () => {
jest.setTimeout(45_000);
jest.setTimeout(120_000);

describe('CLI', () => {
let provider: ethers.providers.JsonRpcProvider;
let deployer: ethers.providers.JsonRpcSigner;
const aliceDerivationPath = "m/44'/60'/0'/0/1";
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('CLI', () => {
['--max-fee', 20],
['--max-priority-fee', 10]
)
).toThrow('Transaction requires at least 21560 gas but got 1');
).toThrow();
});

it('stops sponsoring requester', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-admin/test/e2e/sdk.feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('SDK', () => {

it('uses transaction overrides', async () => {
await expect(sdk.sponsorRequester(wallet.address, { gasLimit: 1 })).rejects.toThrow(
'Transaction requires at least 21572 gas but got 1'
expect.objectContaining({ name: expect.stringContaining('Error'), message: expect.stringContaining('gas') })
);
});
});
2 changes: 1 addition & 1 deletion packages/airnode-deployer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.17
FROM node:20.10.0-alpine3.17

ARG npmRegistryUrl=https://registry.npmjs.org/
ARG npmTag=latest
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/adm-zip": "^0.5.5",
"@types/aws-lambda": "^8.10.136",
"@types/lodash": "^4.14.202",
"@types/node": "^18.19.21",
"@types/node": "^20.10.0",
"@types/yargs": "^17.0.32",
"aws-sdk-client-mock": "^3.0.1",
"aws-sdk-client-mock-jest": "^3.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "aws_lambda_function" "lambda" {
function_name = var.name
handler = var.handler
memory_size = var.memory_size
runtime = "nodejs18.x"
runtime = "nodejs20.x"
role = aws_iam_role.lambda_role.arn
timeout = var.timeout
reserved_concurrent_executions = var.reserved_concurrent_executions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "google_storage_bucket_object" "function_zip" {

resource "google_cloudfunctions_function" "function" {
name = var.name
runtime = "nodejs18"
runtime = "nodejs20"

available_memory_mb = var.memory_size
source_archive_bucket = google_storage_bucket_object.function_zip.bucket
Expand Down
4 changes: 2 additions & 2 deletions packages/airnode-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.21",
"@types/node": "^20.10.0",
"@types/prompts": "^2.4.9",
"chalk": "^4.1.2",
"dotenv": "^16.4.5",
"ethereum-waffle": "^4.0.10",
"hardhat": "^2.14.1",
"hardhat": "^2.23.0-dev.3",
"jest": "^29.7.0",
"prompts": "^2.4.2",
"ts-jest": "^29.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-node/config/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"apiSpecifications": {
"servers": [
{
"url": "http://localhost:5000"
"url": "http://localhost:5005"
}
],
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-node/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.17
FROM node:20.10.0-alpine3.17

ARG npmRegistryUrl=https://registry.npmjs.org/
ARG npmTag=latest
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/node": "^18.19.21",
"@types/node": "^20.10.0",
"@types/yargs": "^17.0.32",
"aws-sdk-client-mock": "^3.0.1",
"aws-sdk-client-mock-jest": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-node/test/fixtures/config/ois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function buildOIS(ois?: Partial<OIS>): OIS {
apiSpecifications: {
servers: [
{
url: 'http://localhost:5000',
url: 'http://localhost:5005',
},
],
paths: {
Expand Down
34 changes: 33 additions & 1 deletion packages/airnode-operation/ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},
{
name: 'ethereum-node',
script: 'hardhat node',
script: 'anvil',
env: {
NODE_ENV: 'development',
},
Expand All @@ -37,5 +37,37 @@ module.exports = {
out_file: 'logs/ethereum-node.log',
merge_logs: true,
},
// {
// name: 'ethereum-node-anvil',
// script: 'anvil --port 8546',
// env: {
// NODE_ENV: 'development',
// },
// env_production: {
// NODE_ENV: 'production',
// },
//
// // Logs
// log_date_format: 'YYYY-MM-DD HH:mm:ss',
// error_file: 'logs/ethereum-node-anvil.log',
// out_file: 'logs/ethereum-node-anvil.log',
// merge_logs: true,
// },
// {
// name: 'ethereum-node',
// script: 'hardhat node',
// env: {
// NODE_ENV: 'development',
// },
// env_production: {
// NODE_ENV: 'production',
// },
//
// // Logs
// log_date_format: 'YYYY-MM-DD HH:mm:ss',
// error_file: 'logs/ethereum-node.log',
// out_file: 'logs/ethereum-node.log',
// merge_logs: true,
// },
],
};
9 changes: 0 additions & 9 deletions packages/airnode-operation/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ const config: HardhatUserConfig = {
compilers: [{ version: '0.6.12', settings: {} }],
},
networks: {
hardhat: {
accounts: {
// These accounts are used to deploy contracts and fund all Airnode
// related accounts. Make sure they have more than enough ETH to
// do this (1m ETH each).
accountsBalance: '1000000000000000000000000',
count: 100,
},
},
localhost: {
url: 'http://127.0.0.1:8545/',
},
Expand Down
Loading