-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use hardhat in v3 tests, kapi image
- Loading branch information
Showing
31 changed files
with
18,930 additions
and
2,577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:18.14.2 | ||
|
||
WORKDIR /app | ||
|
||
COPY hardhat.config.ts ./hardhat.config.ts | ||
|
||
RUN npm install -g hardhat | ||
|
||
|
||
CMD ["npx", "hardhat", "node"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
version: '3.7' | ||
|
||
services: | ||
e2e_pgdb: | ||
container_name: e2e_pgdb | ||
image: postgres:14-alpine | ||
restart: unless-stopped | ||
environment: | ||
- POSTGRES_DB=node_operator_keys_service_db | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
expose: | ||
- "5432:5432" | ||
ports: | ||
- "5433:5432" | ||
volumes: | ||
- ./.volumes/pgdata-17000/:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
hardhat_node: | ||
container_name: hardhat_node | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.hardhat.yml | ||
ports: | ||
- "8545:8545" | ||
environment: | ||
- FORK_URL=${FORK_URL} | ||
- FORK_BLOCK=${FORK_BLOCK} | ||
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY} | ||
volumes: | ||
- .:/app | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -s http://127.0.0.1:8545 >/dev/null || exit 1"] | ||
interval: 10s | ||
retries: 10 | ||
|
||
e2e_keys_api: | ||
container_name: e2e_keys_api | ||
image: lidofinance/lido-keys-api:staging | ||
command: ["yarn", "start:dev"] | ||
platform: linux/amd64 | ||
environment: | ||
- NODE_ENV=production | ||
- DB_NAME=node_operator_keys_service_db | ||
- DB_PORT=5432 | ||
- DB_HOST=e2e_pgdb | ||
- DB_USER=postgres | ||
- DB_PASSWORD=postgres | ||
- PROVIDERS_URLS=http://hardhat_node:8545 | ||
- VALIDATOR_REGISTRY_ENABLE=false | ||
- CHAIN_ID=17000 | ||
- CL_API_URLS="" | ||
depends_on: | ||
e2e_pgdb: | ||
condition: service_healthy | ||
ports: | ||
- "3000:3000" | ||
|
||
links: | ||
- e2e_pgdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { HardhatUserConfig } from 'hardhat/config'; | ||
import * as dotenv from 'dotenv'; | ||
dotenv.config(); | ||
// for v3 version | ||
export const FORK_BLOCK = 2038357; | ||
|
||
// TODO: add check that RPC_URL is for holesky | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const RPC_URL = process.env.FORK_URL!; | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const secretKey = process.env.WALLET_PRIVATE_KEY!; | ||
|
||
const config: HardhatUserConfig = { | ||
networks: { | ||
hardhat: { | ||
forking: { | ||
url: RPC_URL, | ||
// use latest | ||
blockNumber: FORK_BLOCK, | ||
}, | ||
chainId: 17000, | ||
accounts: [ | ||
{ | ||
privateKey: secretKey, | ||
balance: (BigInt(1e18) * BigInt(100)).toString(), | ||
}, | ||
], | ||
}, | ||
}, | ||
solidity: '0.8.4', | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.