Skip to content
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

Add the espresso-dev-node server #1709

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Conversation

ImJeremyHe
Copy link
Member

@ImJeremyHe ImJeremyHe commented Jul 15, 2024

Closes #1679

This PR:

  • Expose the prover port
  • Run a server for
    • returning debug information to users
    • providing endpoints for users setting the hotshot up/down

This would be helpful in these cases:

  • Sometimes users run the dev-node without specifying the ports or urls. /api/dev-info shows the urls or ports that are being used. That will be helpful when they are going to debug or report the bugs to us
  • Easily setting the hotshot is down/up without constructing transactions.

Key places to review:

espresso-dev-node.rs and the toml file.

.map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;

let contract = mock_contract.clone();
api.get("freeze", move |req, _| {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should not be GET but POST. GET isn't supposed to have side effects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the debug info
"""

[route.freeze]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the extra indirection by introducing new terminology "freeze/unfreeze" or should we just call it set-hotshot-down/up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes sense. Will use set-hotshot-down/up

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ImJeremyHe ImJeremyHe marked this pull request as ready for review July 16, 2024 06:29
@ImJeremyHe ImJeremyHe merged commit 23b90ba into main Jul 16, 2024
14 checks passed
@ImJeremyHe ImJeremyHe deleted the jh/dev-node-debug-endpoint branch July 16, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run a specific server in dev-node to provide the debug information
3 participants