You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: enable mock servers with intercept command (#1911)
<!--
Please read and fill out this form before submitting your PR.
Please make sure you have reviewed our contributors guide before
submitting your
first PR.
NOTE: PR titles should follow semantic commits:
https://www.conventionalcommits.org/en/v1.0.0/
-->
## Overview
<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
Ex: Closes #<issue number>
-->
This PR does two key things:
1. Handles already running sequencer
2. Enables using mock services with the intercept command.
1 is pretty straight forward as we did this for the DA server as well.
The one thing to note though with this PR is that because we are
checking for already running servers, I just remove the redundant check
of if the flag was set. I add a comment to the code to explain the
reasoning and to document the context for the future.
For 2, this will help us clean up the rollkit docs. Right now, even for
simple ignite apps, you have to run the local da, local sequencer, and
in the future some local execution. This makes the docs and rollkit feel
clunky.
By adding the mock server commands to the intercept command, we can spin
up mock da and mock sequencer for these tutorials to reduce the steps
required by the users.
Enables: evstack/docs#485Closes#1910
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
- **New Features**
- Added command-line option `--rollkit.sequencer_rollup_id` for
specifying the sequencer middleware rollup ID, defaulting to
"mock-rollup."
- Introduced functionality to start mock services for improved testing
and development.
- **Bug Fixes**
- Enhanced error handling for starting mock servers, including checks
for already running services.
- **Documentation**
- Updated documentation to reflect new command-line options and improved
configurations.
- **Refactor**
- Streamlined control flow and error handling in the `InterceptCommand`
and mock server initialization processes.
- Improved code structure and readability for mock server startup logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
returnfmt.Errorf("failed to launch mock da server: %w", err)
138
-
}
139
-
// nolint:errcheck,gosec
140
-
deferfunc() {
141
-
ifsrv!=nil {
142
-
srv.Stop(cmd.Context())
143
-
}
144
-
}()
131
+
// Try and launch a mock JSON RPC DA server if there is no DA server running.
132
+
// NOTE: if the user supplied an address for a running DA server, and the address doesn't match, this will launch a mock DA server. This is ok because the logs will tell the user that a mock DA server is being used.
// Try and launch a mock gRPC sequencer if there is no sequencer running.
150
+
// NOTE: if the user supplied an address for a running sequencer, and the address doesn't match, this will launch a mock sequencer. This is ok because the logs will tell the user that a mock sequencer is being used.
0 commit comments