Bitcoin Forum
December 05, 2016, 10:44:36 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 »  All
  Print  
Author Topic: libbitcoin  (Read 83442 times)
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
February 17, 2012, 09:28:00 PM
 #121


@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_libbitcoin

Follow 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
Code:
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 Smiley



Sad

Code:
[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_libbitcoin
off 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!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480934676
Hero Member
*
Offline Offline

Posts: 1480934676

View Profile Personal Message (Offline)

Ignore
1480934676
Reply with quote  #2

1480934676
Report to moderator
1480934676
Hero Member
*
Offline Offline

Posts: 1480934676

View Profile Personal Message (Offline)

Ignore
1480934676
Reply with quote  #2

1480934676
Report to moderator
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
February 17, 2012, 09:28:23 PM
 #122

[libbitcoin] First 500 blocks
libbitcoin 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
Hero Member
*****
Offline Offline

Activity: 742



View Profile WWW
February 17, 2012, 10:20:09 PM
 #123

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_libbitcoin
I 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
Legendary
*
Offline Offline

Activity: 1232


View Profile
February 17, 2012, 10:39:51 PM
 #124

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
Hero Member
*****
Offline Offline

Activity: 742



View Profile WWW
February 18, 2012, 12:19:56 AM
 #125

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!

Code:
(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:

Code:
$ 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
Legendary
*
Offline Offline

Activity: 1232


View Profile
February 18, 2012, 08:56:03 AM
 #126

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
Legendary
*
Offline Offline

Activity: 1232


View Profile
March 17, 2012, 07:39:26 PM
 #127

client with a single private key, http://gitorious.org/libbitcoin/libbitcoin/blobs/master/tests/crap/main.cpp
(bad hackjob code for testing)
shackra
Full Member
***
Offline Offline

Activity: 238


1 Pedro 3:15-16 (DHH)


View Profile WWW
April 28, 2012, 12:00:34 AM
 #128

same problem here with GCC4.7 Tongue

Bitcoin-OTC | GPG: 43C5AF3C1C559BA2
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
April 30, 2012, 09:06:54 AM
 #129

same problem here with GCC4.7 Tongue

GCC 4.7 has a bug in it. http://stackoverflow.com/questions/4940259/c11-lambdas-require-capturing-this-to-call-static-member-function

I need to get around to installing that compiler and adding a workaround for that. GCC 4.6 is fine.

No idea why Linux distributions like Arch are including an unstable compiler!!
grondilu
Legendary
*
Offline Offline

Activity: 1134


View Profile
June 03, 2012, 12:26:17 PM
 #130

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
Hero Member
*****
Offline Offline

Activity: 722


Libertas a calumnia


View Profile WWW
June 04, 2012, 05:36:16 AM
 #131

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...?

Articoli bitcoin: Il portico dipinto
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 06, 2012, 02:14:53 PM
 #132

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
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 06, 2012, 04:39:31 PM
 #133

Fixed for g++ 4.7

Related: http://gcc.gnu.org/ml/gcc-help/2012-02/msg00201.html
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 10, 2012, 02:31:06 AM
 #134

- 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 Offline

Activity: 1218


Live and Let Live


View Profile
June 11, 2012, 01:38:04 AM
 #135

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.
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 13, 2012, 02:00:36 PM
 #136

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.

Example quick text-interface client for anyone who wants to have a go at trying to make a Qt version: https://gitorious.org/libbitcoin/libbitcoin/blobs/master/tests/crap/main.cpp
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 25, 2012, 08:48:37 PM
 #137

The problem is that all the Linux distributions are moving towards g++ 4.7 which implements the C++11 standard fully and were complaining about compilation problems.

It turns out that g++ 4.6 implements the C++11 incorrectly which causes an incompatibility for me (that I had to workaround using macros). I eventually said whatever and decided to fully transition to 4.7 as it will become the norm in the new Ubuntu which is being released in ~2 months time.

More info:
http://gcc.gnu.org/projects/cxx0x.html
http://stackoverflow.com/questions/7214623/rule-for-lambda-capture-variable
https://llvm.org/viewvc/llvm-project/libcxx/trunk/include/system_error?view=markup&pathrev=153194 (incorrect noexcept specifier in 4.6)

I plan to make Ubuntu builds again when the new version (Quantal) is released.
Andreas Schildbach
Hero Member
*****
Offline Offline

Activity: 563



View Profile WWW
June 25, 2012, 10:12:40 PM
 #138

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.

Bitcoin Wallet for Android: Your own Bitcoins, in your own pocket!
https://play.google.com/store/apps/details?id=de.schildbach.wallet
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742



View Profile WWW
June 25, 2012, 11:47:35 PM
 #139

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
Legendary
*
Offline Offline

Activity: 1232


View Profile
June 26, 2012, 02:45:59 AM
 #140

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.
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!