0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
27 stars 23 forks source link

`miden-client init` defaults #288

Closed igamigo closed 2 months ago

igamigo commented 2 months ago

What should be done?

Update the init command to enable initialization of the config file with good defaults

How should it be done?

We need two flags:

When is this task done?

When the two flags are implemented.

Additional context

Tagging @Dominik1999 in case he wants to provide more context

bobbinth commented 2 months ago

Is the primary job of the init command adding node endpoint to the client config? If so, it's probably pass the endpoint as a parameter. For example:

miden-clinet init --rpc devnet.miden.io
miden-clinet init --rpc testnet.miden.io

The --rpc parameter could take anything that is a URL - e.g., it could be an IP address (with or without port number).

I think the overall effect is the same, but what is happening is a bit more explicit.

igamigo commented 2 months ago

The init command creates the miden-client.toml in the current dir, so it initializes the RPC and the Store config. I think your suggestion would work fine anyway.

bobbinth commented 2 months ago

In the future, we could also add an option to specify that a default account should be created at init time. This way, after init completes, the client should be immediately usable.