-
Notifications
You must be signed in to change notification settings - Fork 1
chore(local-test): unify mainnet/hoodi scripts with MORPH_NETWORK selector #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Local Test Scripts | ||
|
|
||
| Scripts for running a morph-reth + morphnode full node locally, supporting both **mainnet** and **Hoodi testnet**. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - **morph-reth**: `cargo build --release --bin morph-reth` | ||
| - **morphnode**: `cd ../morph/node && make build` | ||
| - **pm2**: `npm install -g pm2` | ||
| - **jq**, **curl**, **unzip** | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```bash | ||
| # Mainnet (default) | ||
| ./local-test/start-all.sh | ||
|
|
||
| # Hoodi testnet | ||
| ./local-test/start-all.sh hoodi | ||
| ``` | ||
|
|
||
| All scripts accept an optional network argument as the first positional parameter. If omitted, defaults to `mainnet`. | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `start-all.sh [network]` | Prepare config, start morph-reth, wait for RPC, start morphnode | | ||
| | `stop-all.sh [network]` | Stop morphnode and morph-reth | | ||
| | `status.sh [network]` | Show process status, RPC info, and morphnode sync progress | | ||
| | `reset.sh [network] [--yes]` | Wipe chain data (keeps config/keys), requires confirmation | | ||
| | `prepare.sh [network]` | Download config bundle and generate JWT secret if missing | | ||
| | `reth-start.sh [network]` | Start morph-reth only | | ||
| | `reth-stop.sh [network]` | Stop morph-reth only | | ||
| | `node-start.sh [network]` | Start morphnode only | | ||
| | `node-stop.sh [network]` | Stop morphnode only | | ||
|
|
||
| ## Data Directory Layout | ||
|
|
||
| Each network gets its own isolated data directory: | ||
|
|
||
| ``` | ||
| local-test/ | ||
| jwt-secret.txt # Shared JWT secret (auto-generated) | ||
| mainnet/ | ||
| reth-data/ # morph-reth chain database | ||
| node-data/config/ # genesis.json, config.toml, keys | ||
| node-data/data/ # Tendermint state | ||
| reth.log, node.log | ||
| hoodi/ | ||
| reth-data/ | ||
| node-data/config/ | ||
| node-data/data/ | ||
| reth.log, node.log | ||
| ``` | ||
|
|
||
| Switching networks does not require a reset — data is fully isolated. | ||
|
|
||
| ## Configuration | ||
|
|
||
| All defaults can be overridden via environment variables. Common ones: | ||
|
|
||
| | Variable | Default | Description | | ||
| |----------|---------|-------------| | ||
| | `MORPH_NETWORK` | `mainnet` | Network selection (`mainnet` or `hoodi`) | | ||
| | `RETH_BIN` | `./target/release/morph-reth` | Path to morph-reth binary | | ||
| | `MORPHNODE_BIN` | `../morph/node/build/bin/morphnode` | Path to morphnode binary | | ||
| | `RETH_HTTP_PORT` | `8545` | HTTP RPC port | | ||
| | `RETH_AUTHRPC_PORT` | `8551` | Engine API auth RPC port | | ||
| | `RETH_BOOTNODES` | *(empty)* | Comma-separated enode URLs | | ||
| | `MORPH_NODE_L1_RPC` | *(per-network default)* | L1 Ethereum RPC endpoint | | ||
| | `MORPH_MAX_TX_PAYLOAD_BYTES` | `122880` | Max transaction payload size | | ||
|
|
||
| Example with overrides: | ||
|
|
||
| ```bash | ||
| RETH_HTTP_PORT=9545 RETH_BOOTNODES="enode://abc@1.2.3.4:30303" ./local-test/start-all.sh hoodi | ||
| ``` | ||
|
|
||
| ## Monitoring | ||
|
|
||
| ```bash | ||
| pm2 list # Process status | ||
| pm2 logs # All logs (live) | ||
| pm2 logs morph-reth # morph-reth logs only | ||
| pm2 logs morph-node # morphnode logs only | ||
| pm2 monit # Real-time resource monitoring | ||
| ./local-test/status.sh # RPC status + morphnode sync info | ||
| ``` | ||
|
|
||
| ## Reset | ||
|
|
||
| To wipe chain data and start syncing from scratch: | ||
|
|
||
| ```bash | ||
| ./local-test/reset.sh # Reset mainnet (interactive) | ||
| ./local-test/reset.sh hoodi --yes # Reset hoodi (no confirmation) | ||
| ``` | ||
|
|
||
| This removes `reth-data/db`, `reth-data/static_files`, and `node-data/data/` for the specified network. Config files (genesis, keys) are preserved. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a language identifier to the fenced block.
The directory layout block is missing a fence language, which triggers markdownlint MD040.
💡 Proposed fix
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents