Pages:
Author

Topic: sx command line utilities - Empower The Sysadmin With Bitcoin Tools - page 2. (Read 240157 times)

newbie
Activity: 50
Merit: 0
do I need to run obelisk to get response from "sx balance addreess" command
also it seems that i cant install obelisk -
 ERROR: --> You need to have installed libbitcoin, sx and obelisk before run this script.
 Read the header of this script:


after i install-sx.sh

Please advise. Thank you.

yes, though you can point it at public servers rather than a local one if you dont want to / cant run it.

http://sx.dyne.org/introduction.html#installation  (note running the install script as root)
hero member
Activity: 708
Merit: 502
do I need to run obelisk to get response from "sx balance addreess" command
also it seems that i cant install obelisk -
 ERROR: --> You need to have installed libbitcoin, sx and obelisk before run this script.
 Read the header of this script:


after i install-sx.sh

Please advise. Thank you.
newbie
Activity: 50
Merit: 0
I'm now on my fifth attempt using 2 different servers (one a pretty much clean Debian VM and one an established server).. every time I get nearly to the end of the blockchain sync it just seems to sit around not receiving new blocks and spewing reams of errors such as below. I'm assuming blockchain database corruption but it always seems to be somewhere in the 27#### block range (I've just noticed this). Is this normal? Is there maybe something about this range of blocks, was that when someone was spamming the blockchain? Getting a bit frustrated here sapping so much time and bandwidth and still haven't got a sync'd copy to play with. I don't want to download a torrent copy.


WARNING: Error storing memory pool transaction c0c958698d61b260a885115a7e2ccec1a25c8a121c0da9ec6165f0ce11920c9b: Spent input not found


I am having this exact same issue on Ubuntu 64 (latest version) running in VirtualBox on my MacBook Pro Retina.  I have 70GB of SSD and 6GB RAM allocated to the VM.  The block chain has simply stopped updating at right around 300,000 block height.  What solved this problem for you?

I'm afraid nothing solved the problem for me, I gave it a good go but submitted defeat assuming that the h/ware I was using was too slow. I'll try again though one day when I have spare hardware in the hope that whatever caused it is solved.
hero member
Activity: 658
Merit: 501
big changes coming to libbitcoin, obelisk and sx. stay tuned...

Wow , exciting and I thought this video was concerning a new version of the Liberator:

https://www.youtube.com/watch?v=fO30z2o6-t0

An update on libbitcoin is more important, but I would be happy with either.

Thanks for your hard work.

legendary
Activity: 1232
Merit: 1076
big changes coming to libbitcoin, obelisk and sx. stay tuned...
full member
Activity: 135
Merit: 107
I'm now on my fifth attempt using 2 different servers (one a pretty much clean Debian VM and one an established server).. every time I get nearly to the end of the blockchain sync it just seems to sit around not receiving new blocks and spewing reams of errors such as below. I'm assuming blockchain database corruption but it always seems to be somewhere in the 27#### block range (I've just noticed this). Is this normal? Is there maybe something about this range of blocks, was that when someone was spamming the blockchain? Getting a bit frustrated here sapping so much time and bandwidth and still haven't got a sync'd copy to play with. I don't want to download a torrent copy.


WARNING: Error storing memory pool transaction c0c958698d61b260a885115a7e2ccec1a25c8a121c0da9ec6165f0ce11920c9b: Spent input not found


I am having this exact same issue on Ubuntu 64 (latest version) running in VirtualBox on my MacBook Pro Retina.  I have 70GB of SSD and 6GB RAM allocated to the VM.  The block chain has simply stopped updating at right around 300,000 block height.  What solved this problem for you?
legendary
Activity: 1008
Merit: 1001
Let the chips fall where they may.
I ran into a similar problem trying to follow the tutorial here for offline transactions:
Code:
james@torchlight:~/coinjoin$ sx mktx jun272014pool.tx --input 43f1c3e735560f7b1e4c396a55a2e62d2e83b7c4ed1efc5a7d29358c84ca7807:1 --output 1Ft1DZ4EcpH1jFttDoPwsFbe11a6diyZ1H:25000000
Added input 43f1c3e735560f7b1e4c396a55a2e62d2e83b7c4ed1efc5a7d29358c84ca7807:1
Added output sending 25000000 Satoshis to 1Ft1DZ4EcpH1jFttDoPwsFbe11a6diyZ1H.
james@torchlight:~/coinjoin$ DECODED_ADDR=$(cat 1ExAmpLEf.key | sx addr | sx decode-addr)
james@torchlight:~/coinjoin$ PREVOUT_SCRIPT=$(sx rawscript dup hash160 [ $DECODED_ADDR ] equalverify checksig)
james@torchlight:~/coinjoin$ SIGNATURE=$(cat 1ExAmpLEf.key | sx sign-input jun272014pool.tx 0 $PREVOUT_SCRIPT)
james@torchlight:~/coinjoin$ sx rawscript [ $SIGNATURE ] [ $(cat 1ExAmpLEf.key | sx pubkey) ] | sx set-input jun272014pool.tx 0 > signed.tx
Usage: set-input FILENAME N SIGNATURE_AND_PUBKEY_SCRIPT

After some trial and error, I find this works:

Code:
james@torchlight:~/coinjoin$ sx set-input jun272014pool.tx 0 $(sx rawscript [ $SIGNATURE ] [ $(cat 1ExAmpLEf.key | sx pubkey) ]) > signed.tx
james@torchlight:~/coinjoin$ sx validtx signed.tx
Status: Success

I also found that Bitcoind 0.9.2 seems to ignore transactions sent with sendtx-node. This appears to be a regression, since I believe I had it work at least once in the past. I since updated and rebuilt sx tools. I may have upgraded the bitcoind node to 0.9.2  (from 0.8.x) as well.

I really need to keep better maintenance logs Tongue

PS: I briefly considered posting on the unsystem forum, but I see no categories. I have always thought web-forums are a poor imitation of USENET, but doing away with categories altogether (because people don't use them?) is worse IMO.
sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
No actually, this is a toy build I'm using to play. In fact the source is not that of an actual release... It's a post 0.9.2 clone and carries a warning.

I thought I might be making an obvious bash mistake. I should note that if I were to do

Code:
echo $priv

literally copy the resulting string and verbosely do

Code:
bitcoind importprivkey ""

At least there isn't an error message. But I'm not home now and can't recall if that totally worked or not.
legendary
Activity: 3472
Merit: 4801
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?

Is your wallet encrypted?

If so, you'll probably need to unlock the wallet with walletpassphrase before you try to import a private key.
sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
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?
sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
This is the greatest thing of all time.  Thanks.
legendary
Activity: 1232
Merit: 1076
We have a forum for collaboration and discussion of all related projects (darkwallet, libbitcoin, sx .etc):

Forum: https://forum.unsystem.net/
newbie
Activity: 50
Merit: 0
how many special terms are here! I don't understand a word!
legendary
Activity: 1232
Merit: 1076
libbitcoin has to be rebuilt with testnet support, so you need to make clean libbitcoin, and ./configure needs the argument --enable-testnet

I just looked, and the latest install script (with --testnet) wasn't uploaded. OK now I've re-uploaded it.

So redownload http://sx.dyne.org/install-sx.sh and see the help text.
newbie
Activity: 50
Merit: 0
Hm, adding --enable-testnet to ./configure doesn't seem to be working. I did it for libbitcoin, obelisk, and sx. It is still giving me the following, which is the hash of mainnet genesis block. Yes I am sure I am using the correct sx binary.

Code:
~/sx/worker$ ../bin/sx initchain blockchain/
INFO: Imported genesis block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

try:

$ make clean
$ make
...

it probably didn't rebuild the modules

Nope, I deleted the entire ~/sx directory and reran the installer with the --enable-test on libbitcoin, obelisk, and sx. I saw it rebuild everything. I still get the same genesis block hash.
legendary
Activity: 1232
Merit: 1076
Hm, adding --enable-testnet to ./configure doesn't seem to be working. I did it for libbitcoin, obelisk, and sx. It is still giving me the following, which is the hash of mainnet genesis block. Yes I am sure I am using the correct sx binary.

Code:
~/sx/worker$ ../bin/sx initchain blockchain/
INFO: Imported genesis block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

try:

$ make clean
$ make
...

it probably didn't rebuild the modules
newbie
Activity: 50
Merit: 0
Hm, adding --enable-testnet to ./configure doesn't seem to be working. I did it for libbitcoin, obelisk, and sx. It is still giving me the following, which is the hash of mainnet genesis block. Yes I am sure I am using the correct sx binary.

Code:
~/sx/worker$ ../bin/sx initchain blockchain/
INFO: Imported genesis block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
newbie
Activity: 50
Merit: 0
sorry, I am trying to be helpful, I didnt actually run it with --help I just looked at the install script which clearly shows that it would display info that would help you see that you need to add --testnet .. but seemingly that's not what you're seeing when you actually execute it.


Sorry, I guess there was a misunderstanding. The latest version of the installation script does not have a testnet option.
newbie
Activity: 50
Merit: 0
sorry, I am trying to be helpful, I didnt actually run it with --help I just looked at the install script which clearly shows that it would display info that would help you see that you need to add --testnet .. but seemingly that's not what you're seeing when you actually execute it.


Code:
usage() {
    echo " [+] Install script usage:"
    echo
    echo " [sudo] bash install-sx.sh [<--argument> [...]]"
    echo
    echo " If no arguments are provided, defaults will be used, and sudo is mandatory."
    echo
    echo " Default path for installation is $INSTALL_PREFIX"
    echo " Default path for the conf files is $CONF_DIR"
    echo " Stable versions of toolchain packages (from git $TOOLCHAIN_BRANCH branches) will be installed for libbitcoin, libwallet, obelisk and sx tools."
    echo
    echo " Optional arguments:"
    echo " --prefix   Path prefix to install to, e.g. /home/user/usr"
    echo " --branch   libbitcoin toolchain branch to use, e.g. develop"
    echo " --branch-keep    Don't check out from git for libbitcoin toolchain or dependencies, takes no value"
    echo " --testnet        Build for testnet, takes no value"
}
newbie
Activity: 50
Merit: 0

RTFM doesn't tell him shit - you have to configure libbitcoin with --enable-testnet.

Thank you, for actually being helpful.
Pages:
Jump to: