Bitcoin Forum
May 09, 2024, 03:22:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum command line - import xpub - watch only wallet  (Read 646 times)
BuySomeBitcoins (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 253



View Profile
May 04, 2017, 03:28:05 AM
 #1

Hello,

I am trying electrum command line on a server (not GUI) and would like to important an xpub / Watch only wallet.

Can somebody provide me the command line or a link to a doc to check out ?

Thank you.

1715268120
Hero Member
*
Offline Offline

Posts: 1715268120

View Profile Personal Message (Offline)

Ignore
1715268120
Reply with quote  #2

1715268120
Report to moderator
1715268120
Hero Member
*
Offline Offline

Posts: 1715268120

View Profile Personal Message (Offline)

Ignore
1715268120
Reply with quote  #2

1715268120
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715268120
Hero Member
*
Offline Offline

Posts: 1715268120

View Profile Personal Message (Offline)

Ignore
1715268120
Reply with quote  #2

1715268120
Report to moderator
1715268120
Hero Member
*
Offline Offline

Posts: 1715268120

View Profile Personal Message (Offline)

Ignore
1715268120
Reply with quote  #2

1715268120
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
May 04, 2017, 04:40:05 AM
 #2

http://docs.electrum.org/en/latest/cmdline.html
http://docs.electrum.org/en/latest/coldstorage_cmdline.html

but it doesn't have the answer to the question you are asking! but i think you should use the restore command in console to restore from a xpub (master public key).

"Restore a wallet from text. Text can be a seed phrase, a master public key, a master private key, a list of bitcoin addresses or bitcoin private keys. If you want to be prompted for your seed, type '?' or ':' (concealed)"
https://github.com/spesmilo/electrum/blob/master/lib/commands.py#L122-L127

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BuySomeBitcoins (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 253



View Profile
May 04, 2017, 05:40:58 PM
 #3

It worked indeed

for users who may want to do the same or end up on this thread after a google search, these are the commands.

Code:
$ electrum restore xpub

OutPut

Code:
Recovering wallet...
Recovery successful
Wallet saved in '/home/ubuntu/.electrum/wallets/default_wallet'




I had this error though, wonder what is the issue

Exception in thread Thread-10 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 763, in run
  File "/usr/local/lib/python2.7/dist-packages/electrum/blockchain.py", line 119, in init_headers_file
  File "/usr/lib/python2.7/urllib.py", line 94, in urlretrieve
  File "/usr/lib/python2.7/urllib.py", line 279, in retrieve
  File "/usr/lib/python2.7/urllib.py", line 975, in close
  File "/usr/lib/python2.7/socket.py", line 282, in close
  File "/usr/lib/python2.7/ssl.py", line 397, in close
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'close'
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!