Pages:
Author

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

member
Activity: 81
Merit: 1002
It was only the wind.
Hi! The instructions are here:

http://libbitcoin.dyne.org/obelisk-setup.html

But you can also use a public Obelisk server as listed here:

http://libbitcoin.dyne.org/servers.html

(some might be down but after the crowd funding we are going to setup some nice stable servers for people)

The config file for sx is in PREFIX/share/sx/sx.cfg. Copy this to ~/.sx.cfg (PREFIX is usually /usr/local/share/)

You can install sx, obelisk and everything using:

wget http://sx.dyne.org/install-sx.sh
sudo bash install-sx.sh

Wolf0, not sure why you get that?

jago, everything works now?

I installed from the AUR, have no sx.cfg that I know of, and always get testnet addresses.
hero member
Activity: 900
Merit: 1000
Crypto Geek
Could really do with an RPM...
sr. member
Activity: 462
Merit: 250
Just got sx built under Ubuntu, thanks! Just wondering how portable 'sx' is to windows? Do I need cygwin, or is it possible to compile with VC++? Any build instructions anywhere (or pre-built binaries)?
member
Activity: 81
Merit: 1002
It was only the wind.
Are the sx tools stuck on testnet?

No, it's fully operational AFAIK.

Moderate: Thanks for that, missed the leveldb. ./configure should have spotted it. Will search and try again

I always get addresses that start with m.
oys
newbie
Activity: 17
Merit: 0
This is absolutely awesome. There are so many usecases for this. The one I am currently trying to solve is how to quickly fetch the history associated with an address.

I am running my own obelisk server which looks to be working, but the history command does not return anything even after letting it run for several minutes.

bci-history works great, but relies on trusting blockchain.info from what I understand.

Is my understanding correct that sx history should return a value within a couple of seconds at most, or does it parse the entire blockchain?

-----

Edit: to answer my own question, it looks like I was trying to query a public obelisk server since that's the default. Reading the documentation and adding service = "tcp://localhost:9091" to ~/.sx.cfg fixed things.
legendary
Activity: 1232
Merit: 1076
Hi! The instructions are here:

http://libbitcoin.dyne.org/obelisk-setup.html

But you can also use a public Obelisk server as listed here:

http://libbitcoin.dyne.org/servers.html

(some might be down but after the crowd funding we are going to setup some nice stable servers for people)

The config file for sx is in PREFIX/share/sx/sx.cfg. Copy this to ~/.sx.cfg (PREFIX is usually /usr/local/share/)

You can install sx, obelisk and everything using:

wget http://sx.dyne.org/install-sx.sh
sudo bash install-sx.sh

Wolf0, not sure why you get that?

jago, everything works now?
member
Activity: 81
Merit: 1002
It was only the wind.
Are the sx tools stuck on testnet?
hero member
Activity: 900
Merit: 1000
Crypto Geek
Are the sx tools stuck on testnet?

No, it's fully operational AFAIK.

Moderate: Thanks for that, missed the leveldb. ./configure should have spotted it. Will search and try again
legendary
Activity: 2097
Merit: 1070
Maybe not related but could this be something to do with CentOS disabling all Elliptic Curve functionality in their standard packaged OpenSSL distribution ?

However in the next version which is going to be released very soon it will be restored after a long period of on and off support.
member
Activity: 98
Merit: 10
nearly dead

Code:

./../include/bitcoin/blockchain/leveldb_blockchain.hpp:7:24: fatal error: leveldb/db.h: No such file or directory

hero member
Activity: 900
Merit: 1000
Crypto Geek
Some deps that might be useful for CentOS? Hopefully might see a rpm for that at some stage - would be useful seeing as most webservers are CentOS.

fedora:
Code:
libcurl-devel.x86_64 openssl-devel.x86_64 gcc-c++ asio-devel leveldb.x86_64

Got through the deps but libbitcoin doesn't compile for me:
Code:
libbitcoin-git]$ ./configure --enable-leveldb --prefix /usr/local/
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking whether make supports nested variables... (cached) yes
checking --enable-testnet argument... no
checking for boostlib >= 1.20.0... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SSL... yes
checking for CURL... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/bitcoin/Makefile
config.status: creating src/Makefile
config.status: creating libbitcoin.pc
config.status: executing depfiles commands
config.status: executing libtool commands
[j@localhost libbitcoin-git]$ make
Making all in include/bitcoin
make[1]: Entering directory `/home/j/src/libbitcoin-git/include/bitcoin'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/j/src/libbitcoin-git/include/bitcoin'
Making all in src
make[1]: Entering directory `/home/j/src/libbitcoin-git/src'
  CXX      satoshi_serialize.lo
  CXX      deterministic_wallet.lo
  CXX      getx_responder.lo
  CXX      threadpool.lo
  CXX      network/network.lo
  CXX      network/handshake.lo
  CXX      network/channel.lo
  CXX      network/hosts.lo
  CXX      network/protocol.lo
  CXX      poller.lo
  CXX      utility/logger.lo
  CXX      utility/sha256.lo
  CXX      address.lo
  CXX      format.lo
  CXX      script.lo
  CXX      utility/ripemd.lo
  CXX      block.lo
  CXX      utility/elliptic_curve_key.lo
  CXX      transaction.lo
  CXX      error.lo
  CXX      validate.lo
  CXX      session.lo
session.cpp:133:6: warning: unused parameter 'packet' [-Wunused-parameter]
 void session::get_data(const std::error_code& ec,
      ^
session.cpp:147:6: warning: unused parameter 'packet' [-Wunused-parameter]
 void session::get_blocks(const std::error_code& ec,
      ^
  CXX      utility/base58.lo
  CXX      utility/big_number.lo
  CXX      utility/key_formats.lo
  CXX      utility/timed_section.lo
  CXX      utility/mnemonic.lo
  CXX      constants.lo
  CXX      blockchain/organizer.lo
blockchain/organizer.cpp: In member function 'void libbitcoin::organizer::replace_chain(int, libbitcoin::block_detail_list&)':
blockchain/organizer.cpp:166:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int orphan_index = 0; orphan_index < orphan_chain.size();
                                                                 ^
blockchain/organizer.cpp:204:73: warning: narrowing conversion of 'arrival_index' from 'int' to 'size_t {aka long unsigned int}' inside { } [-Wnarrowing]
         arrival_block->set_info({block_status::confirmed, arrival_index});
                                                                         ^
  CXX      blockchain/blockchain.lo
  CXX      transaction_pool.lo
  CXX      transaction_indexer.lo
transaction_indexer.cpp: In function 'void libbitcoin::indexer_history_fetched(const std::error_code&, const output_info_list&, const spend_info_list&, libbitcoin::blockchain::history_list, libbitcoin::blockchain::fetch_handler_history)':
transaction_indexer.cpp:233:14: warning: variable 'found' set but not used [-Wunused-but-set-variable]
         bool found = false;
              ^
  CXX      blockchain/leveldb/leveldb_blockchain.lo
In file included from blockchain/leveldb/leveldb_blockchain.cpp:1:0:
./../include/bitcoin/blockchain/leveldb_blockchain.hpp:7:24: fatal error: leveldb/db.h: No such file or directory
 #include
                        ^
compilation terminated.
make[1]: *** [blockchain/leveldb/leveldb_blockchain.lo] Error 1
make[1]: Leaving directory `/home/j/src/libbitcoin-git/src'
make: *** [all-recursive] Error 1
hero member
Activity: 900
Merit: 1000
Crypto Geek
Just a quick one to say thanks and congrats for the first user level multisig implementation.

The stage is set for a website programmer now to build a frontend to assist democratic voting through payments.
legendary
Activity: 1232
Merit: 1076
history/balance/wallet commands:

My host is unreachable for a bit: http://wiki.hetzner.de/index.php/Netzwerkkonfiguration_wegen_Switchanpassung/en

Once my server is available, everything should be working again.
hero member
Activity: 714
Merit: 500

If you want to create your own:

$ mkdir blockchain
$ sx initchain blockchain/
INFO: Imported genesis block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f


Hey Amir thanks for the reply.

I guess I have a dodgy build then, as when I do 'sx initchain blockchain/' it just silently hangs Sad

But what does this command actually do? Where is it trying to get the data from?

Anyways ill come back to this when it is released, it looks very promising Smiley
legendary
Activity: 1232
Merit: 1076
Forgive the newbie question, but how do I actually configure SX so it has a blockchain database to query?

I just want to run the command `sx balance 1...` but this simply hangs with no output.

I am guessing this is because it has no idea about how to get the information, i.e. it has no blockchain database.

So please how do I configure this? Does it depend on bitcoin-qt/bitcoind ?

cheers!


Edit: I have tried an `sx initchain path-to-bitcoin-qt-blockchain` to no avail. this also just hangs with no response


Hey,

My email is [email protected] if you ever want to reach me directly with questions.

I've been making changes recently, so my server might sometimes experience downtime. Obelisk and SX aren't released yet but a release will be happening soon. Then we will create a stable production server, and keep a separate one for development.

If you want to create your own:

$ mkdir blockchain
$ sx initchain blockchain/
INFO: Imported genesis block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

You now have a blockchain with the genesis block.

If you start the worker, it will begin downloading the blockchain. The rsync tool is obselete. We're working on a tool to bootstrap the Bitcoin blockchain but it is experimental:

https://github.com/spesmilo/libbitcoin/tree/master/tools

So you'll be able to use rtorrent to download it from bittorrent, then import it into libbitcoin (Obelisk).

The blockchain path is in /etc/obelisk/worker.cfg

That compile error is with ZeroMQ, and should be fixed by them. Since the problem doesn't occur in Debian Wheezy or Ubuntu 13.04, it's probably fixed.

Thanks!
hero member
Activity: 714
Merit: 500

Where do you create the blockchain directory? I mean the config file does not mention a full path.

I don't have any answers im afraid Sad

Do you get any sort of output when executing `sx initchain blockchain/` ?  I get literally zero and nothing in debug or error logs. It just hangs silently.

I have no idea if it is expecting that directory to be an existing blockchain-dir (i.e. from bitcoin-qt) or a leveldb-based one. Or what that command is supposed to do, is it converting an existing blockchain? or connecting to the bitcoin network to build it up itself?

There is a script /usr/local/bin/download-blockchain.sh  which seems to try to rsync the blockchain from some server. But of course it fails miserably as it cannot authenticate.

Im not making much progress Sad
legendary
Activity: 3710
Merit: 1586
Hey,

We're just working on a tool to convert the bitcoind bootstrap.dat into a libbitcoin blockchain which would make the transition easier.

For now I would look at the config in /etc/obelisk/. You want the port of the frontend in balancer.cfg for your sx.cfg

Commands to run:

# Initialize blockchain
$ mkdir blockchain
$ sx initchain blockchain/
# Run the load balancer
$ obbalancer
# Run a worker
$ obworker

You can view debug.log and error.log to see the output of the worker.

It's important that everyone setup an Obelisk server though. I will make a proper release though soon, and then it will include instructions and I'll be ready for everyone to run versions. Soon soon.

Where do you create the blockchain directory? I mean the config file does not mention a full path.
hero member
Activity: 714
Merit: 500
Forgive the newbie question, but how do I actually configure SX so it has a blockchain database to query?

I just want to run the command `sx balance 1...` but this simply hangs with no output.

I am guessing this is because it has no idea about how to get the information, i.e. it has no blockchain database.

So please how do I configure this? Does it depend on bitcoin-qt/bitcoind ?

cheers!


Edit: I have tried an `sx initchain path-to-bitcoin-qt-blockchain` to no avail. this also just hangs with no response
hero member
Activity: 714
Merit: 500
The simplest way to install sx, is to use the *install-sx.sh* bash
script.

Code:
   $ wget http://sx.dyne.org/install-sx.sh
   $ sudo bash ./install-sx.sh

sx should now be installed.


Just a quick note for future reference.

Under Ubuntu 12.04 the script fails to install for a few reasons.

Quote
DEPENDENCIES="git build-essential autoconf libtool libboost-all-dev pkg-config libcurl4-openssl-dev libleveldb-dev libzmq-dev libconfig++-dev libncurses-dev"

Firstly, in order to build libbitcoin, I require libboost1.48-all-dev instead of libboost-all-dev, which breaks your dependency checking.

The same can be said for other dependencies which on my system, are named slightly differently - e.g. I have 'libncurses5-dev' which also breaks the dependency checking.

Also I was unable to build obelisk without making modifications, I get
Quote
In file included from worker/publisher.hpp:4:0,
                 from worker/publisher.cpp:1:
/usr/include/zmq.hpp: In member function ‘zmq::context_t& zmq::context_t::operator=(zmq::context_t&&)’:
/usr/include/zmq.hpp:207:13: error: ‘swap’ is not a member of ‘std’
             std::swap(ptr, rhs.ptr);

Which I fixed by making sure to include in various places in the code.

Now it seems to be all nicely installed so I will have a play Smiley
legendary
Activity: 1232
Merit: 1076
Hey,

We're just working on a tool to convert the bitcoind bootstrap.dat into a libbitcoin blockchain which would make the transition easier.

For now I would look at the config in /etc/obelisk/. You want the port of the frontend in balancer.cfg for your sx.cfg

Commands to run:

# Initialize blockchain
$ mkdir blockchain
$ sx initchain blockchain/
# Run the load balancer
$ obbalancer
# Run a worker
$ obworker

You can view debug.log and error.log to see the output of the worker.

It's important that everyone setup an Obelisk server though. I will make a proper release though soon, and then it will include instructions and I'll be ready for everyone to run versions. Soon soon.
Pages:
Jump to: