-
Notifications
You must be signed in to change notification settings - Fork 772
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
Ethjs JavaScript REPL #3781
base: master
Are you sure you want to change the base?
Ethjs JavaScript REPL #3781
Conversation
packages/client/bin/repl.ts
Outdated
ignoreUndefined: true, | ||
}) | ||
|
||
// bootstrap contexts or modules |
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.
We could potentially make the rpc servers and the API's they serve available as contexts here, but on first look, this wouldn't be very usable. A more user friendly option might be defining commands in the repl that would interact with the client and rpc server objects that could be called like this: .getBlock 0x01
.
packages/client/bin/repl.ts
Outdated
process.exit() | ||
}) | ||
|
||
// define commands |
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.
Commands can be defined as such that would allow use to simplify rpc API function calls and passing input parameters. Any other processing can also be done in the command callback implementation, but we should be careful not to e.g. reimplement rpc functions here.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
Another thing that would be really cool would be to be able to turn on the different log levels dynamically in the client (and also maybe the |
Can we take the
This might also be a candidate for a separate PR. I have the general impression that this might be a good strategic approach, respectively that this here (the REPL PR) is somewhat of a "sub task trigger PR" 🙂 So it's pretty likely that this will let one stumble upon refactoring tasks, clean-up TODOs and the like and then I think it might also be good to continue like this: to then extract these as separate/small pieces of work and keep this PR here lean and small and updated. |
(but then likely do the PRs on top of each other, so that you do not always have to wait a day until one of these is merged. So basically (PR order) from clean (mergeable, e.g. a `admin_addPeer PR with tests) to dirty (likely the REPL PR for some time 😁)) |
…mjs/ethereumjs-monorepo into ethjs-repl
Agree. This has been working well for the verkle stuff. |
…mjs/ethereumjs-monorepo into ethjs-repl
…o into ethjs-repl
…mjs/ethereumjs-monorepo into ethjs-repl
This change continues from a PoC created in #3776 to add a repl to the ethereumjs client module.
This current repl npm script can be expanded by switching over to bash in order to run a consensus client as well and sync networks so that the provided repl can have some applied use-cases met.
The current goal with this PoC expansion is to provide a repl with features similar to geth's and we can potentially expand use cases.