Author

Topic: [PULL REQUEST SUBMITTED] Creating an "imported private keys" wallet from cli (Read 184 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
freenode has been having some problems so they created a chat room #electrum on liberachat.  you should try that.

Didn't know about freenode having problems as I haven't used it for a while. But I had already attempted to connect my IRC client to liberachat and registered an account there but it's giving me messages that look like "#electrum server is offline" so no luck there unfortunately. I will try firing up Hexchat and see if it goes through.
legendary
Activity: 3682
Merit: 1580
freenode has been having some problems so they created a chat room #electrum on liberachat.  you should try that.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
OK, it's been 3 months now and I admit that I'm quite upset that I'm not even getting feedback on Github from the Electrum maintainers about my PR - as far as I can tell, this is the case for most of the other recent PRs.

This is despite the fact that the maintainers have made several other commits to the codebase since then.

Does anyone know of a way for me to get he attention of the Electrum devs?

Edit: I can't even send a message to their IRC channel, it appears to be offline.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Use restore instead of create.
Example:
Code:
electrum --testnet -w test_wallet1 restore "p2wpkh:cToWRvSSzMJn87KJc7y66c9YfLuPWQf8uBrYvj5pdsa8h1v5NL6Q p2wpkh-p2sh:cMiHrQ32jiRmTzMKXi6NT9RR2m6SUgNzC36ghTf1Z2JAbhBJncji"
Enter the wallet name after the "-w" argument, and the private key(s) (with script type) after "restore".

(the whitespace in between is important, apparently, and can't just be any separator)

I noticed that when I used the restore command, the wallet doesn't automatically get synced, yet the call returns instantly.

Among other things, this causes the balance to be reported as zero for an indefinite amount of time, because the network part of the wallet is never started (there's a reason why the return JSON says: "This wallet has been restored offline").

I made a new command restore_sync that fixes this (apparently it was a TODO in the code as well) and some other commands I found convenient to make. I will make a PR for those shortly.



EDIT: The request has been made: https://github.com/spesmilo/electrum/pull/7584 and I want to merge a few other commands I added (among others, I also have a delete command that deletes wallet files but I don't think that this will make it - it does not tell the difference between wallet files and other random files).
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Use restore instead of create.
Example:
Code:
electrum --testnet -w test_wallet1 restore "p2wpkh:cToWRvSSzMJn87KJc7y66c9YfLuPWQf8uBrYvj5pdsa8h1v5NL6Q p2wpkh-p2sh:cMiHrQ32jiRmTzMKXi6NT9RR2m6SUgNzC36ghTf1Z2JAbhBJncji"
Enter the wallet name after the "-w" argument, and the private key(s) (with script type) after "restore".
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I'm not sure how to create a wallet (from the Electrum command line) without the seed phrase argument.

The problem is that the "create" command always creates a wallet that has a seed phrase in it, and I can't seem to change that behavior from parameters. This causes "imporprivkey" command to refuse to import any private keys inside the wallet, because it already has a seed phrase, as I demonstrate below:

Code:
$ electrum --testnet create
{
    "msg": "Please keep your seed in a safe place; if you lose it, you will not be able to restore your wallet.",
    "path": "",
    "seed": "" # <---- Need to get rid of this return value
}
$  electrum --testnet  importprivkey  "p2wpkh:"
Error: This type of wallet cannot import private keys. Try to create a new wallet with that key.

There doesn't seem to be any other command for creating wallets though and this is another stumbling block.
Jump to: