Skip to content

Commit

Permalink
Merge pull request #33 from ensdomains/use-anvil
Browse files Browse the repository at this point in the history
Rewrite ens-test-env to use anvil
  • Loading branch information
TateB authored Aug 15, 2022
2 parents 0cf08cb + 0cc8eb7 commit 2b16d1a
Show file tree
Hide file tree
Showing 23 changed files with 444 additions and 952 deletions.
28 changes: 28 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions packages/ens-test-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"cli-progress": "^3.10.0",
"commander": "^9.3.0",
"concurrently": "^7.1.0",
"docker-compose": "^0.23.17",
"dotenv": "^16.0.0",
"fs-extra": "^10.0.1",
"ganache": "^7.0.4",
Expand Down
40 changes: 4 additions & 36 deletions packages/ens-test-env/src/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,19 @@
import { ConcurrentlyCommandInput } from 'concurrently'
import { ServerOptions } from 'ganache'

/**
* ens-test-env configuration object
* @see [configuration documentation](https://github.com/ensdomains/ensjs-v3/tree/main/packages/ens-test-env/)
*/
export interface ENSTestEnvConfig {
deployCommand?: string
tenderly?: {
user: string
project: string
key: string
}
archive: {
localSubgraphId?: string
subgraphId: string
epochTime: number
blockNumber: number
baseUrl: string
network: string
}
docker: {
file?: string
sudo?: boolean
}
ethereum: {
chain: {
chainId: number
}
fork: {
url: string
blockNumber: number
}
wallet: {
mnemonic: string
}
} & ServerOptions<'ethereum'>
graph?: {
bypassLocal?: boolean
labelHashes?: { hash: string; label: string }[]
}
buildCommand?: string
labelHashes?: { hash: string; label: string }[]
scripts?: (ConcurrentlyCommandInput & {
finishOnExit?: boolean
waitForGraph?: boolean
})[]
paths?: {
archives?: string
data?: string
archive?: string
composeFile?: string
}
}
15 changes: 13 additions & 2 deletions packages/ens-test-env/src/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: '3'
services:
anvil:
image: ghcr.io/ensdomains/anvil:latest
ports:
- '8545:8545'
entrypoint: /bin/sh -c 'anvil --chain-id 1337 --gas-limit 50000000 --timestamp 1659500634'
environment:
ANVIL_IP_ADDR: '0.0.0.0'
graph-node:
image: graphprotocol/graph-node
ports:
Expand All @@ -11,13 +18,14 @@ services:
depends_on:
- ipfs
- postgres
- anvil
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: 'ipfs:5001'
ethereum: '$NETWORK:$DOCKER_RPC_URL'
ethereum: 'mainnet:http://anvil:8545'
GRAPH_LOG: debug
GRAPH_ETHEREUM_CLEANUP_BLOCKS: 'true'
GRAPH_ALLOW_NON_DETERMINISTIC_IPFS: 'true'
Expand All @@ -42,10 +50,13 @@ services:
- $DATA_FOLDER/postgres:/var/lib/postgresql/data
metadata:
image: ghcr.io/ensdomains/ens-metadata-service:latest
depends_on:
- anvil
- graph-node
ports:
- '8080:8080'
environment:
- ADDRESS_ETH_REGISTRAR=$ADDRESS_ETH_REGISTRAR
- ADDRESS_NAME_WRAPPER=$ADDRESS_NAME_WRAPPER
- RPC_PROVIDER=$DOCKER_RPC_URL
- RPC_PROVIDER=http://anvil:8545
- SUBGRAPH_URL=http://graph-node:8000/subgraphs/name/graphprotocol/ens
54 changes: 0 additions & 54 deletions packages/ens-test-env/src/ens-test-env.default.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions packages/ens-test-env/src/ens-test-env.example.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @type {import('./config').ENSTestEnvConfig}
**/
module.exports = {
deployCommand: 'yarn hardhat deploy',
buildCommand: 'yarn build',
labelHashes: [
{
hash: '0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0',
label: 'eth',
},
],
scripts: [
{
command: 'example',
name: 'example',
prefixColor: 'blue.bold',
cwd: path.resolve('./'),
finishOnExit: true,
},
],
paths: {
data: './data',
composeFile: './docker-compose.yml',
},
}
Loading

0 comments on commit 2b16d1a

Please sign in to comment.