0xPolygonMiden / miden-node

Reference implementation of the node for the Polygon Miden rollup
MIT License
53 stars 37 forks source link

Add CLI interface to interact with the servers #95

Open hackaugusto opened 11 months ago

hackaugusto commented 11 months ago

Implement a small CLI interface to interact and inspect the state of the servers. This is not the same as the miden wallet/client, it is intended to interact with all the endpoints of the internal servers, used for testing and scripting.

hackaugusto commented 11 months ago

Note: I kinda enjoy having these commands on the RPC server https://github.com/0xPolygonMiden/miden-node/blob/main/rpc/src/cli/mod.rs#L36-L43 . I think it would make sense to have something similar for the others services.

One advantage of using the CLI is that we can hex encode binary data, and use a mock tool https://github.com/0xPolygonMiden/miden-node/issues/96 to create it, something like (rough sketch, haven't thought about the API much):

miden-rpc account create $(mock account new --fungible)
bobbinth commented 11 months ago

Re format, I'd probably try to see if we can use Postman first, and if that proves to be too limiting, write a simple CLI.

Note: I kinda enjoy having these commands on the RPC server https://github.com/0xPolygonMiden/miden-node/blob/main/rpc/src/cli/mod.rs#L36-L43 . I think it would make sense to have something similar for the others services.

I like these too - but how would we use them in the context of a single binary?

hackaugusto commented 9 months ago

related to: https://github.com/0xPolygonMiden/miden-node/issues/137

hackaugusto commented 9 months ago

Re format, I'd probably try to see if we can use Postman first, and if that proves to be too limiting, write a simple CLI.

I'm hijinking this issue to be CLI only, we have #137 for a GUI

okcan commented 9 months ago

It may be useful to use the CLI structure here, as found in some of our projects.

hackaugusto commented 9 months ago

@okcan are there any operations you would consider a must to be implemented in the CLI? So far I have only considered adding graceful shutdown and hot-config reloading. Other

okcan commented 9 months ago

Actually, it would be more useful to ask this to a blockchain developer, but I can give these projects as examples that I know of. https://github.com/maticnetwork/matic-cli https://github.com/maticnetwork/polygon-cli