Allow for changing name of wallet
NorbertBodziony opened this issue · 2 comments
This is problem specific for application that use cli as interface to communication with zcash network. Right now all application will try to use same wallet. Custom names for wallet will solve this issue.
@adityapk00 this is creating an issue for both zecwallet lite and zbay. whichever one somebody installs first, they won't be able to install the other one with a separate wallet file.
Actually, instead of renaming, I'd recommend using the Lightclient's in-memory wallet feature.
You can create a lightclient instance from a byte-array (i.e., the wallet file's contents). Here: https://github.com/adityapk00/zecwallet-light-cli/blob/master/lib/src/lightclient.rs#L500
After syncing, sending etc..., when you are ready to save the file, you can request the wallet as a byte array that you can save to disk. Here: https://github.com/adityapk00/zecwallet-light-cli/blob/master/lib/src/lightclient.rs#L764
This way, you can manage the saving/loading wallets from Zbay, instead of relying on the library reading from disk. You can also juggle multiple wallets this way.
The mobile apps use the library this way, reading / writing the files from outside the library, and passing the byte-array file contents to the library. Here: https://github.com/zecwalletco/zecwallet-mobile/blob/master/rust/lib/src/lib.rs#L83