Skip to content

Commit

Permalink
Improvements to the way we start the fork
Browse files Browse the repository at this point in the history
  • Loading branch information
elenadimitrova committed Mar 11, 2021
1 parent bf28a1e commit a38b785
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"compile": "npm run compile:infrastructure && npm run compile:modules && npm run compile:wallet",
"cc": "rm -rf build && rm -rf build-legacy && npm run compile:lib && npm run compile && npm run compile:legacy && npm run compile:test && npm run provision:lib:artefacts",
"ganache": "npx ganache-cli --chainId 1895 --networkId 1597649375983 --gasLimit=20700000 -e 10000 --acctKeys=\"./ganache-accounts.json\" --deterministic",
"mainnet-fork": "npx ganache-cli --chainId 1895 --port 3601 --deterministic --fork https://mainnet.infura.io/v3/$(cat .env | sed -En 's/INFURA_KEY=''\"''([^''\"'']+)''\"''/\\1/p')",
"mainnet-fork": "bash ./scripts/start_mainnet_fork.sh",
"test": "npx truffle test --compile-none",
"ctest": "npm run compile && npm run test",
"test:integration": "npx truffle test --compile-none --network prodFork test-integration/filter-lido.js",
Expand Down
11 changes: 11 additions & 0 deletions scripts/start_mainnet_fork.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [ -z "$CI" ]; then
source .env

lsof -i tcp:3601 | grep LISTEN | awk '{print $2}' | xargs kill
fi

# Exit script as soon as a command fails.
set -o errexit

node_modules/.bin/ganache-cli --chainId 1895 --port 3601 --deterministic --fork https://mainnet.infura.io/v3/"$INFURA_KEY"

0 comments on commit a38b785

Please sign in to comment.