Skip to content

Commit 4c4d213

Browse files
wakamexclaude
andcommitted
feat: add configurable RPC port support
- Allow custom port via PORT environment variable (defaults to 8545) - Update deploy-scenario.sh to accept RPC_URL environment variable - Document usage in README for cases where default port is in use 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9dff0ba commit 4c4d213

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ First [install foundry](https://getfoundry.sh/) then run:
2020

2121
If all goes well, your RPC will be available on the standard `http://127.0.0.1:8545` endpoint.
2222

23+
To use a custom port (e.g., if 8545 is already in use):
24+
25+
PORT=8546 ./devland.sh
26+
27+
You can also deploy scenarios to a different RPC endpoint directly:
28+
29+
RPC_URL=http://127.0.0.1:8546 ./deploy-scenario.sh EulerSwapBasic
30+
2331
### Private keys
2432

2533
The default is just to use the standard anvil mnemonic. For example this is user 0:

deploy-scenario.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SCENARIO=$1
77
rm -rf dev-ctx/
88
mkdir -p dev-ctx/{addresses,labels,priceapi}/31337
99

10-
forge script --rpc-url http://127.0.0.1:8545 "script/scenarios/$SCENARIO.s.sol" --broadcast --code-size-limit 100000
10+
forge script --rpc-url ${RPC_URL:-http://127.0.0.1:8545} "script/scenarios/$SCENARIO.s.sol" --broadcast --code-size-limit 100000
1111
cast rpc evm_increaseTime 86400
1212
cast rpc evm_mine
1313

devland.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ function cleanup {
1212
trap cleanup EXIT
1313

1414

15-
anvil --code-size-limit 100000 &
15+
PORT=${PORT:-8545}
16+
anvil --port $PORT --code-size-limit 100000 &
1617
sleep 1
1718

1819

19-
bash ./deploy-scenario.sh "$SCENARIO"
20+
RPC_URL=http://127.0.0.1:$PORT bash ./deploy-scenario.sh "$SCENARIO"
2021

2122

2223
echo -------------------------------

0 commit comments

Comments
 (0)