-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.anvil.yaml
51 lines (45 loc) · 1.46 KB
/
docker-compose.anvil.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
services:
ethereum:
image: ${DEVNET_IMAGE}
profiles:
- "anvil"
# without --block-time we're in "automine" mode and blocks are mined
# as soon as transactions are received, or with manual commands.
# this is "hecking fast" mode.
command: |
'anvil --load-state ./data --host 0.0.0.0 --code-size-limit 9999999999 --chain-id ${CHAIN_ID}'
volumes:
- artifacts:/src/artifacts/
# Mine the first block to prevent overflow/underflow errors on the first
# read calls.
mine:
image: curlimages/curl:latest
profiles:
- "anvil"
command: |
/bin/sh -c "sleep 2; curl -X POST -H \"Content-Type: application/json\" --data '{\"jsonrpc\":\"2.0\", \"method\":\"anvil_mine\", \"params\":[], \"id\":1}' ${RPC_URI}"
artifacts:
image: ${ARTIFACTS_IMAGE}
profiles:
- "anvil"
volumes:
- artifacts:/var/www/artifacts/
# Set the block timestamp interval
timestamp_interval:
image: curlimages/curl:latest
profiles:
- "blocktime"
command: |
/bin/sh -c "sleep 5; curl -X POST -H \"Content-Type: application/json\" --data '{\"jsonrpc\":\"2.0\", \"method\":\"anvil_setBlockTimestampInterval\", \"params\":[${BLOCK_TIMESTAMP_INTERVAL}], \"id\":1}' ${RPC_URI}"
# Set account balances
fund-accounts:
image: ${FUND_ACCOUNTS_IMAGE}
profiles:
- "fund-accounts"
volumes:
- ./accounts:/accounts/
- artifacts:/artifacts/
env_file:
- .env
volumes:
artifacts: