genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
February 17, 2012, 09:28:00 PM |
|
@znort, try google-protobuf or something. And dont use the boost headers in ubuntu... they are missing async_connect function. Use 1.48 from boostr website as per instructions above.
In case anyone is actually interested, the package is actually called "libprotobuf-dev" These requirements makes libbitcoin fairly unusable for a large number of developers: installing the very latest and greatest g++ and boost are: A) a fairly annoying undertaking. B) not always an option, in particular for production systems Also, note that the --with-boost= flag to configure seems to have no effect whatsoever: the Makefile generated keeps on using the system boost headers instead of the ones in the boost directory specified on the configure cmd line. This precludes having multiple installs of boost (which is required for a whole swath of other things to keep functionning). The only way I got the damn thing to compile was to force a -I to point in the right place in the CXX and CC env. vars prior to running configure, not exactly a clean or particularly obvious way to get there. Bottom line: libbitcoin seems nice, but it's a PITA to compile and adoption will thereby suffer. https://bitcoinconsultancy.com/wiki/Build_libbitcoinFollow that. I'm using boost built to a local directory. The library is still early. These dependencies will all become standard and part of Linux distributions within a few months. It's a worthwhile gamble since they add significant quality to the library. Add these 2 lines to the end of your /etc/apt/sources.list deb http://ppa.launchpad.net/zgenjix/libbitcoin/ubuntu oneiric main deb-src http://ppa.launchpad.net/zgenjix/libbitcoin/ubuntu oneiric main I think this should be " http://ppa.launchpad.net/genjix" without a "z" I also added it to "/etc/apt/sources.list.d/libbitcoin.list" instead of "/etc/apt/sources.list" Now lets see if I can get the python bindings built [user@silo python-bitcoin]$ make mkdir -p bitcoin g++ -fPIC -Wall -ansi `pkg-config --cflags libbitcoin` -I/usr/include/python2.7 -c main.cpp -o main.o In file included from /home/user/usr/include/bitcoin/exporter.hpp:7:0, from /home/user/usr/include/bitcoin/network/channel.hpp:17, from /home/user/usr/include/bitcoin/bitcoin.hpp:8, from main.cpp:4: /home/user/usr/include/bitcoin/constants.hpp:37:75: warning: missing braces around initializer for ‘std::array<unsigned char, 32ul>::value_type [32] {aka unsigned char [32]}’ [-Wmissing-braces] /home/user/usr/include/bitcoin/constants.hpp:39:62: warning: missing braces around initializer for ‘std::array<unsigned char, 20ul>::value_type [20] {aka unsigned char [20]}’ [-Wmissing-braces] main.cpp: In member function ‘void handshake_wrapper::start(boost::python::api::object)’: main.cpp:288:61: error: no matching function for call to ‘libbitcoin::handshake::start(pyfunction<const std::error_code&>)’ main.cpp:288:61: note: candidate is: /home/user/usr/include/bitcoin/network/handshake.hpp:31:10: note: void libbitcoin::handshake::start(libbitcoin::channel_ptr, libbitcoin::handshake::handshake_handler) /home/user/usr/include/bitcoin/network/handshake.hpp:31:10: note: candidate expects 2 arguments, 1 provided main.cpp: In member function ‘void handshake_wrapper::ready(channel_wrapper, boost::python::api::object)’: main.cpp:299:14: error: ‘class libbitcoin::handshake’ has no member named ‘ready’ /home/user/usr/include/boost/system/error_code.hpp: At global scope: /home/user/usr/include/boost/system/error_code.hpp:214:35: warning: ‘boost::system::posix_category’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/system/error_code.hpp:215:35: warning: ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/system/error_code.hpp:216:35: warning: ‘boost::system::native_ecat’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/asio/error.hpp:244:45: warning: ‘boost::asio::error::system_category’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/asio/error.hpp:246:45: warning: ‘boost::asio::error::netdb_category’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/asio/error.hpp:248:45: warning: ‘boost::asio::error::addrinfo_category’ defined but not used [-Wunused-variable] /home/user/usr/include/boost/asio/error.hpp:250:45: warning: ‘boost::asio::error::misc_category’ defined but not used [-Wunused-variable] make: *** [default] Error 1
I would stay away from the packages for the time being. Once I make a 1.0 release this month then I will update them. If anyone manages to get it to build, then build instructions would be much appreciated. I wrote these: https://bitcoinconsultancy.com/wiki/Build_libbitcoinoff the top of my head. I don't have a clean environment around to test, and I'm also very stressed for time what with the exchange, bitcoin media, libbitcoin and bitcoin conference requirements. I'm trying to devote 80% of my time on this library so it means I have to be really efficient with my time. Also there's a new tutorial I will post below!
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
February 17, 2012, 09:28:23 PM |
|
[libbitcoin] First 500 blockslibbitcoin is a toolkit based library and can be leveraged with different design patterns depending on the task or application. Previously we examined using libbitcoin using an active object pattern. In this example we will use an imperative style program to connect to a bitcoin node and download the first 500 blocks.
|
|
|
|
Red Emerald
|
|
February 17, 2012, 10:20:09 PM |
|
I would stay away from the packages for the time being. Once I make a 1.0 release this month then I will update them. If anyone manages to get it to build, then build instructions would be much appreciated. I wrote these: https://bitcoinconsultancy.com/wiki/Build_libbitcoinI installed from the package first, and when that didn't work I used the guide at bitcoinconsultancy. While that works, I still can't get the python bindings built. I'm flying blind though since you don't have any docs for the python module.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
February 17, 2012, 10:39:51 PM |
|
are you using the latest repos from http://gitorious.org/libbitcoin/ ? If so can you paste the error here (if different from above). It looks like you're using a libbitcoin from a few days ago but latest python bindings.
|
|
|
|
Red Emerald
|
|
February 18, 2012, 12:19:56 AM Last edit: February 18, 2012, 12:53:19 AM by Red Emerald |
|
are you using the latest repos from http://gitorious.org/libbitcoin/ ? If so can you paste the error here (if different from above). It looks like you're using a libbitcoin from a few days ago but latest python bindings. Updating to the newest git head for libbitcoin seems to have fixed the last error. I don't know how I ended up with versions that didn't match considering I literally installed the system fresh last night and checked out the projects one after the other, but w/e. Weeee! (env)[user@silo onion-coin]$ python -i Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import bitcoin >>> dir(bitcoin) ['_1', '_2', '_3', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '_bitcoin', 'acceptor', 'address', 'address_to_short_hash', 'bdb_blockchain', 'bind', 'block', 'block_info', 'block_locator', 'block_locator_indices', 'block_reward', 'block_status', 'block_value', 'block_work', 'blockchain', 'bytes_from_pretty', 'channel', 'coin_price', 'coinbase_maturity', 'coinbase_script', 'data_chunk', 'decode_base58', 'elliptic_curve_key', 'encode_base58', 'error', 'error_code', 'exporter', 'generate_merkle_root', 'generate_ripemd_hash', 'generate_sha256_checksum', 'generate_sha256_hash', 'genesis_block', 'get_address', 'get_blocks', 'get_data', 'handshake', 'hash_block_header', 'hash_digest', 'hash_digest_from_pretty', 'hash_transaction', 'header', 'indices_list', 'input_point', 'inventory', 'inventory_list', 'inventory_type', 'inventory_vector', 'is_coinbase', 'magic_value', 'max_bits', 'max_money', 'max_target', 'network', 'network_address', 'network_address_list', 'null_hash', 'null_short_hash', 'opcode', 'opcode_to_string', 'operation', 'operation_stack', 'output_point', 'output_point_list', 'parse_script', 'payment_type', 'ping', 'previous_output_is_null', 'public_key_to_address', 'readjustment_interval', 'reward_interval', 'satoshi_exporter', 'save_script', 'script', 'setup_bdb_blockchain', 'short_hash', 'short_hash_from_pretty', 'short_hash_wrapper', 'sighash', 'string_to_opcode', 'target_spacing', 'target_timespan', 'total_output_value', 'transaction', 'transaction_input', 'transaction_input_list', 'transaction_list', 'transaction_output', 'transaction_output_list', 'verack', 'version']
So I'm trying to use your tutorials, but they aren't working for me. I'm not running bitcoind locally, so I think that might be why. Both tutorial.py and first500.py give this: $ python tutorial.py s: version (112 bytes) Bad header received.
For tutorial.py, I changed self.net.connect to my system running bitcoind and also I tried changing vers.address_you.ip. For first500.py, I changed hs.connect to my system, but it also failed. I am trying to build a lightweight tool for querying nodes to get their version. Right now, one of my systems has all of the tor hidden services added as nodes, but many of those services are offline and it takes forever trying to connect to all of them. I was hoping to use PyTorCtl and libbitcoin to map all of the addresses and then return versions for all of the nodes that are up. I could then drop this list of nodes that I know to be online and running current versions into my bitcoin.conf. From there it wouldn't be too much work to make it into a bot that updates the wiki page. It seems to connect, but the handshake is failing.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
February 18, 2012, 08:56:03 AM |
|
Yes, that's very weird. It should be fine connecting to localhost. Have you got an IP address I can connect to your bitcoind? It could be that you're running an old version of bitcoin (the version packet has changed since older versions). If that's the case then trying the latest should work.
I'm on Skype as zgenjix or Freenode IRC in #bitcoinconsultancy as genjix
Ring ring, live support. How can I help you sir?
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
March 17, 2012, 07:39:26 PM |
|
|
|
|
|
shackra
Full Member
Offline
Activity: 237
Merit: 102
1 Pedro 3:15-16 (DHH)
|
|
April 28, 2012, 12:00:34 AM |
|
same problem here with GCC4.7
|
|
|
|
|
grondilu
Legendary
Offline
Activity: 1288
Merit: 1080
|
|
June 03, 2012, 12:26:17 PM |
|
Berkeley DB, as it's being used in the existing bitcoin client, is a perfect example of why not to use NoSQL.
Has Satoshi ever explained his choice for BerkeleyDB instead of a SQL-based relationnal db?
|
|
|
|
Dusty
|
|
June 04, 2012, 05:36:16 AM |
|
Berkeley DB, as it's being used in the existing bitcoin client, is a perfect example of why not to use NoSQL.
Could you please elaborate...?
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
June 06, 2012, 02:14:53 PM |
|
OK, seems like Ubuntu Quantal uses g++ 4.7 (release date is October) and many distributions are phasing in the new toolchain. I think it's because g++ 4.7 implements the vast majority of the new C++ standard so it's being fast tracked in.
I'm upgrading to a system with 4.7 so hopefully I should be get it working with the new compiler now.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
June 06, 2012, 04:39:31 PM |
|
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
June 10, 2012, 02:31:06 AM |
|
- serialisation has changed. more intuitive and uses native c++ features to support extendability for saving and loading of bitcoin messages. - async_service now provides access to underlying io_service ptr which is now the requirement for services.
|
|
|
|
da2ce7
Legendary
Offline
Activity: 1222
Merit: 1016
Live and Let Live
|
|
June 11, 2012, 01:38:04 AM |
|
I'm putting a bounty down for the creation of a QT client based upon libbitcoin. (must be judged to be 'beta' by me).
10btc.
|
One off NP-Hard.
|
|
|
|
|
Andreas Schildbach
|
|
June 25, 2012, 10:12:40 PM |
|
Ubuntu 12.10 is still 4 months away. Also, many people (like me) will stay on 12.04 because this is a release with long term support.
|
|
|
|
Red Emerald
|
|
June 25, 2012, 11:47:35 PM |
|
Ubuntu 12.10 is still 4 months away. Also, many people (like me) will stay on 12.04 because this is a release with long term support.
+1 I plan on running LTS for a while. If that means libbitcoin is going to be a PITA, that is too bad.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
June 26, 2012, 02:45:59 AM |
|
Ubuntu 12.10 is still 4 months away. Also, many people (like me) will stay on 12.04 because this is a release with long term support.
+1 I plan on running LTS for a while. If that means libbitcoin is going to be a PITA, that is too bad. Hmmm OK. I'll setup a new VPS to get compatibility with the LTS again. I'm making some simplifications, optimisations and cleanup of the interface for the next release.
|
|
|
|
|