Post
Topic
Board Development & Technical Discussion
Re: sx command line utilities - Empower The Sysadmin With Bitcoin Tools
by
Altoidnerd
on 25/06/2014, 11:16:56 UTC
I like using bitcoind together with sx

Code:
altoidnerd@LEPTON:~$ bitcoind getnewaddress > a.txt; a=$(cat a.txt);bitcoind dumpprivkey $a | sx addr
1AhAcnWk92uce89jq5jTQNjHt9T4DuAKAZ
altoidnerd@LEPTON:~$ cat a.txt
1AhAcnWk92uce89jq5jTQNjHt9T4DuAKAZ

It works!  But in the other direction, I can't get it quite right;

Code:
altoidnerd@LEPTON:~$ priv=$(sx newkey); echo $priv | sx addr > a.txt; a=$(cat a.txt); echo $a
1H441WDHRuXPTDosqjUKN54C44yuHY3upM

I want to do something like

Code:
altoidnerd@LEPTON:~$ bitcoind importprivkey $priv

or

Code:
altoidnerd@LEPTON:~$ echo $priv | bitcoind importprivkey

both of which seem to freeze bitcoind or return an error. I guess because bitcoind importprivkey doesn't like stdin?