Title: Subvertx Ubuntu packages (Oneiric Ocelot only) Post by: genjix on November 06, 2011, 12:52:22 AM Main thread: https://bitcointalk.org/index.php?topic=50721.0
Leave your comments there. These are a simple set of utilities for working with the bitcoin network/protocol. Together you can use them as a 'flyweight' client. I like small sets of inter-working programs because it is the UNIX philosophy about building small bricks which you can piece together to create a set of highly configurable inter-locking mechanism of programs and daemons. This is a proof of concept built off of the work-in-progress libbitcoin (https://bitcointalk.org/index.php?topic=30646.0). Subvertx is a suite of 4 tools: - poller, downloads the blockchain from a bitcoind into a PostgreSQL database. - balance, queries the PostgreSQL database downloaded with poller to find the balance of a bitcoin address. - priv, create a new private key, sign data, verify data or show the bitcoin address of that key. - mktx, connects to a bitcoind and sends some money from an output to a new address. You can use this in conjunction with a site like blockexplorer.com as a tool to make transactions very simply. Show help: Code: genjix@random:~/subvertx$ priv Make a new private key, sign and verify a transaction hash: Code: genjix@random:~/subvertx$ priv new > /tmp/private_key Show your bitcoin address: Code: genjix@random:~/subvertx$ priv address < /tmp/private_key To send some bitcoins, you need to send some bitcoins to the address you generated above (in our case 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z). Then you need to search the transaction on blockexplorer (http://blockexplorer.com) and find which output it got sent to. In our case (http://blockexplorer.com/tx/125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5#o1), the bitcoins we sent went to transaction 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5 (the hash) and output 1. Our destination address will be: 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23 The amount of bitcoins to send is specified in the bitcoin internal format (which is amount * 10^8): 0.01 BTC = 100 0000 It will then connect to the bitcoind on localhost:8333 and send it the transaction, which will be propagated throughout the network. Code: genjix@random:~/subvertx$ mktx localhost 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5:1 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23 1000000 < /tmp/private_key Those numbers are the transaction hash which can be looked up on blockexplorer. poller To use the poller you first need to import the schema which can be downloaded from here (http://libbitcoin.org/bitcoin.sql) (a pre-downloaded blockchain is here (http://libbitcoin.org/bitcoin-sql.tar.bz2)). Code: # do all the postgres stuff to make a new database Poller is doing full blockchain validation. It will take a long time since it's an SQL database and it's validating all the blocks. Balance needs the full blockchain otherwise you might not get an up-to-date balance reported back. It's fairly simple to use: Code: $ balance postgresql:database:username:password 1jkjsjkdskjb2kkjbkjdsk Ubuntu packages The PPA can be viewed on launchpad (https://launchpad.net/~genjix/+archive/libbitcoin). Add these 2 lines to the end of your /etc/apt/sources.list Code: deb http://ppa.launchpad.net/genjix/libbitcoin/ubuntu oneiric main Code: $ wget -q "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4F8AE60DB3FC740E" -O- | sudo apt-key add - This PPA also has a package for libbitcoin-dev although the API is undocumented at the moment. ;D Kamil Domański is working on an gentoo ebuild which should be ready tomorrow. Source code for the non-Ubuntu paupers: https://gitorious.org/libbitcoin/libbitcoin https://gitorious.org/libbitcoin/subvertx I can't stress enough for people to use this at their own peril as it's alpha software. Thanks goes to, Kamil Domański (kdomanski) Jan Engelhardt (se7) <jengelh@medozas.de> Patrick Strateman (phantomcircuit) Denis Roio (jaromil) Amir Taaki (genjix) <genjix@riseup.net> Title: Re: Subvertx Ubuntu packages (Oneiric Ocelot only) Post by: genjix on November 06, 2011, 01:09:00 AM Source installation instructions
You will need: - g++ 4.6 - cppdb - boost - libpq-dev - postgresql Build cppdb using the instructions on their site. $ svn co http://cppcms.svn.sourceforge.net/svnroot/cppcms/cppdb/trunk cppdb-trunk $ cd cppdb-trunk $ mkdir build $ cd build You can use -DCMAKE_INSTALL_PREFIX if you wish to install to a non-standard place such as a local directory. $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/cppdb/ .. -DPQ_BACKEND_INTERNAL=1 $ make # make install Clone repo and build. $ git clone git://gitorious.org/libbitcoin/libbitcoin.git $ cd libbitcoin $ ./configure $ make # make install Don't forget to initialise and create a database (see first post above for more details how). $ psql bitcoin < bitcoin.sql Same for the subvertx suite $ git clone git://gitorious.org/libbitcoin/subvertx.git $ cd subvertx $ ./configure $ make # make install |