Closed nikkolasg closed 2 months ago
I'm not in favor of support this via rpc calls or anything that needs to interact with a running node, but I agree that would be a nice feature to have.
we have the cast wallet
command which generates single keypairs, I'd propose we add support for mnemonic key generation, I don't think we have something like this yet, right @onbjerg ?
something like cast wallet mnemonic "...."
with an --anvil
flag to dump the default keys?
I'm not in favor of support this via rpc calls or anything that needs to interact with a running node
Oh no I was thinking stg far more simpler like anvil --secrets-to keys.json
when you start anvil or stg. That way, when you start anvil you can programmatically get the already-funded private keys easily (instead of doing the parsing yourself).
right,
anvil --secrets-to keys.json
that makes sense, but will also need some additional arguments, like mnemonic, hdpath, index perhaps, (same that anvil supports)
I think this would be useful on its own and is not limited to anvil.
we could add this to cast wallet
which is more fitting I believe, but could then reuse this for anvil as well.
anvil --secrets-to keys.json that makes sense, but will also need some additional arguments, like mnemonic, hdpath, index perhaps, (same that anvil supports)
I guess in the end, what this feature is about is get all the info anvil prints out in a easily parsable fashion instead of handwriting regexp, so maybe anvil --info-out info.json
or stg to also add the mnemonics etc.
Also a good idea for cast wallet
for sure yeah !
Currently cast wallet
only operates on a single JSON keystore, but it is also a bit broken last time I tried it. The details are in another issue related to keystores: #926
@robertabbott check this out
Additional context: https://github.com/foundry-rs/foundry/issues/3818
Marking as complete, requested feature is available using anvil --config-out
and loading a mnemonic in an encrypted keystore was added here: https://github.com/foundry-rs/foundry/issues/3818
Component
Anvil
Describe the feature you would like
It would be nice to have the ability to ask Anvil to spit out the private keys into a JSON file or stg as to enable programmatic interaction with it (instead of manually copy paste the key(s)).
Additional context
No response