Skip to content

Commit

Permalink
Playground startup fix (#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz authored Apr 29, 2024
1 parent 7c9673f commit 16d0963
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.vscode
/.idea
**/testing.*.toml
/playground/.env
39 changes: 27 additions & 12 deletions playground/docker-compose.fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ services:
# with simple bytecode that always returns a solidity `true` value, alleviating
# the requirement to register a solver's private key for the sake of testing on
# a fork.
test: [
"CMD",
"/usr/local/bin/cast",
"rpc",
"-r",
"http://127.0.0.1:8545",
"anvil_setCode",
"0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE",
"0x600160005260206000F3"
]
interval: 1m30s
test: [ "CMD-SHELL", "
response=$$(wget -qO- --header='Content-Type: application/json' --post-data='{\"jsonrpc\":\"2.0\", \"method\":\"eth_blockNumber\", \"params\":[], \"id\":1}' http://127.0.0.1:8545);
block=$$(echo $$response | sed -n 's/.*\"result\":\"\\([^\"\\]*\\)\".*/\\1/p');
if [ -n \"$$block\" ] && [ \"$$block\" != \"0x0\" ] && [ \"$$block\" != \"null\" ]; then
/usr/local/bin/cast rpc -r http://127.0.0.1:8545 anvil_setCode 0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE 0x600160005260206000F3;
exit 0;
else
exit 1;
fi;
" ]
interval: 5s
timeout: 30s
retries: 5
start_period: 5s
Expand Down Expand Up @@ -82,6 +82,8 @@ services:
- BIND_ADDRESS=0.0.0.0:80
- CHAIN_ID=$CHAIN
- BASELINE_SOURCES=None
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
depends_on:
- db-migrations
ports:
Expand Down Expand Up @@ -110,8 +112,13 @@ services:
- DRIVERS=baseline|http://driver/baseline
- SKIP_EVENT_SYNC=true
- BASELINE_SOURCES=None
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
depends_on:
- orderbook
orderbook:
condition: service_started
chain:
condition: service_healthy
driver:
build:
Expand All @@ -123,10 +130,15 @@ services:
environment:
- ETHRPC=http://chain:8545
- ADDR=0.0.0.0:80
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
volumes:
- ./driver.toml:/driver.toml
ports:
- 9000:80
depends_on:
chain:
condition: service_healthy
# baseline (solver engine)
baseline:
Expand All @@ -139,6 +151,8 @@ services:
environment:
- ADDR=0.0.0.0:80
- LOG=solvers=trace,shared=trace
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
volumes:
- ./baseline.toml:/baseline.toml
ports:
Expand All @@ -163,5 +177,6 @@ services:
- ETH_RPC_URL=http://127.0.0.1:8545
ports:
- 8001:80
volumes:
postgres:
8 changes: 2 additions & 6 deletions playground/driver.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ relative-slippage = "0.1" # Percentage in the [0, 1] range
account = "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6" # Known test private key

[submission]
gas-price-cap = 1e12
additional-tip-percentage = 0.05
gas-price-cap = "1000000000000"

[[submission.mempool]]
mempool = "public"

[liquidity]
base-tokens = [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", # WETH
"0x6B175474E89094C44Da98b954EedeAC495271d0F", # DAI
"0x6B175474E89094C44Da98b954EedeAC495271d0F", # DAI
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", # USDC
"0xdAC17F958D2ee523a2206206994597C13D831ec7", # USDT
"0xc00e94Cb662C3520282E6f5717214004A7f26888", # COMP
Expand All @@ -26,6 +25,3 @@ base-tokens = [

[[liquidity.uniswap-v2]] # Uniswap V2 configuration
preset = "uniswap-v2"

[[liquidity.balancer-v2]]
preset = "balancer-v2"

0 comments on commit 16d0963

Please sign in to comment.