|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 05, 2011, 05:54:30 PM |
|
Ubuntu package available for libbitcoin: https://launchpad.net/~zgenjix/+archive/libbitcoinAdd 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 $ wget -q "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4F8AE60DB3FC740E" -O- | sudo apt-key add - $ sudo apt-get update $ sudo apt-get install libbitcoin-dev
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 06, 2011, 09:01:15 PM |
|
Gentoo ebuild Kamil Domański has made a gentoo ebuild. layman -a bitcoin emerge libbitcoin
|
|
|
|
fivebells
|
|
November 14, 2011, 02:12:17 AM |
|
Minor nit: The OP_CHECKSIG wiki page mentions libbitcoin and make ec-key && ./bin/tests/ec-key I had to use the development-makefile to get this to start compiling. Also, it's failing as follows: lap% make -f development-makefile ec-key g++ -std=c++0x -Wall -pedantic -pthread -Wextra -fstack-protector-all -ggdb -fPIC -Iinclude/ -Iusr/include/ -c -o obj/ec-key.o tests/ec-key.cpp tests/ec-key.cpp: In function ‘bool op_checksig_test()’: tests/ec-key.cpp:23:221: warning: missing braces around initializer for ‘std::array<unsigned char, 32ul>::value_type [32] {aka unsigned char [32]}’ [-Wmissing-braces] tests/ec-key.cpp: In function ‘void privkey_tests()’: tests/ec-key.cpp:114:44: warning: missing braces around initializer for ‘std::array<unsigned char, 32ul>::value_type [32] {aka unsigned char [32]}’ [-Wmissing-braces] Assembler messages: Fatal error: can't create obj/ec-key.o: No such file or directory make: *** [obj/ec-key.o] Error 1 "mkdir obj" corrects this. (This is with the apt-get source libbitcoin source.)
|
|
|
|
slush
Legendary
Offline
Activity: 1386
Merit: 1097
|
|
November 16, 2011, 02:18:04 AM |
|
Error: Page not found. It should be probably "genjix" instead of "zgenjix"
|
|
|
|
bitclown
|
|
November 16, 2011, 08:26:42 AM |
|
The config script now checks for bdb 5.1, but 5.1 is not included in the list of versions checked at m4/ax_berkeley_db_cxx.m4:60. The Gentoo ebuild should pull it in a slot: DEPEND="sys-libs/db:5.1 ..." Oh, and ridiculous nice work by the way!
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 16, 2011, 02:03:35 PM |
|
Thanks both. We'll correct those things. I've made experimental alpha bindings for libbitcoin. Caveat emptor. Program which connects to a bitcoin node and downloads the first 500 block hashes. from bitcoin import * import time
net = network() chandle = None
def receive_inv(inv_packet): print inv_packet for inventory in inv_packet.invs: print inventory.type, inventory.hash
def handle_send_getblocks(ec): if ec: # do something print ec
def create_getblocks_message(): packet = getblocks() gen_block = genesis_block() print 'c' packet.locator_start_hashes.append(hash_block_header(gen_block)) packet.hash_stop.nullify() return packet
def handle_handshake(ec, host_id): if ec: # do something print ec return chandle = host_id net.subscribe_inv(chandle, receive_inv) net.send_getblocks(chandle, create_getblocks_message(), handle_send_getblocks)
if __name__ == '__main__': handshake_connect(net, "localhost", 8333, handle_handshake) time.sleep(2)
Another hacked up example just to test everything: from bitcoin import * import time i = net_addr() i.ip_addr = [1, 2, 3] print i.ip_addr print inv_type.block h = hash_digest([1, 2, 3]) h[12] = 110 print h[12] vers = version() vers.version = 100 vers.sub_version_num = "abc" print vers # from block 170 pubkey = data_chunk([0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3]) print len(pubkey) print pubkey print pubkey_to_address(pubkey) print genesis_block().merkle print 'Only', max_money(), 'bitcoins will ever exist' print original_dialect() s = script() o = operation() o.code = opcode.special s.push_operation(o) o.code = opcode.nop o.data = data_chunk([0xde, 0xad, 0xbe, 0xef]) s.push_operation(o) o = operation() o.code = opcode.hash160 s.push_operation(o) print s tx = transaction() print tx
n = network()
def foo(ec, hostid): if ec: print ec print 'connected', hostid
handshake_connect(n, "localhost", 8333, foo)
time.sleep(10)
I'm not too knowledgeable on making bindings, so consider this an experiment. https://gitorious.org/libbitcoin/python-bitcoin
|
|
|
|
slush
Legendary
Offline
Activity: 1386
Merit: 1097
|
|
November 16, 2011, 02:58:38 PM |
|
genjix, thanks for great work. I have been waiting for python binding and now I have finally something to play with :-).
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 16, 2011, 04:08:03 PM |
|
That's cool But beware that they're a total experimental hack since I don't know what I'm doing when it comes to bindings. If you need to ask me questions, I'm on Freenode IRC in #bitcoinconsultancy as genjix
|
|
|
|
kdomanski
Newbie
Offline
Activity: 10
Merit: 0
|
|
November 16, 2011, 08:59:23 PM |
|
The config script now checks for bdb 5.1, but 5.1 is not included in the list of versions checked at m4/ax_berkeley_db_cxx.m4:60. The Gentoo ebuild should pull it in a slot: DEPEND="sys-libs/db:5.1 ..." Thanks, I fixed the ebuild. Also, storage backends are now enabled and disabled by use flags.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 29, 2011, 09:48:44 PM |
|
What is a good name for the blockchain + acting functions? Currently it's called 'storage'
ledger blockchain backend ...
There are other components for 'wallet' and 'node_list'. This only concerns blocks, block locators and transactions in the block chain.
I'm leaning towards backend.
|
|
|
|
netrin
Sr. Member
Offline
Activity: 322
Merit: 251
FirstBits: 168Bc
|
|
November 30, 2011, 12:36:30 AM |
|
What is 'acting'? I prefer to see personal/private data clearly distinguished from public data by name.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
November 30, 2011, 04:07:36 PM |
|
What is 'acting'? I prefer to see personal/private data clearly distinguished from public data by name.
acting = functions that transform or perform operations on the data (public member functions of the interface)
|
|
|
|
jtimon
Legendary
Offline
Activity: 1372
Merit: 1002
|
|
November 30, 2011, 04:48:33 PM |
|
I like "blockchain" more than "backend". But I don't know exactly what functions are there so...
|
|
|
|
slush
Legendary
Offline
Activity: 1386
Merit: 1097
|
|
December 08, 2011, 04:14:41 AM |
|
Any idea? It's fresh git clone. $ autoconf configure.ac:5: error: possibly undefined macro: AM_INIT_AUTOMAKE If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:18: error: possibly undefined macro: AM_CONDITIONAL configure.ac:33: error: possibly undefined macro: AC_MSG_ERROR
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
December 11, 2011, 07:59:44 PM |
|
ok storage is now called blockchain. Also, on http://libbitcoin.org/ is a video about the design philosophy behind libbitcoin. I make one mistake in the video: Will be called in the order 2, 1, 3, but not be allowed to run at the same time. Not sure why I tripped up there on that- guess it was being on the spot kind of thing @slush, try autoreconf -i
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
December 15, 2011, 02:10:15 PM |
|
Is this still licensed under the AGPL?
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
slush
Legendary
Offline
Activity: 1386
Merit: 1097
|
|
December 15, 2011, 05:30:24 PM |
|
@slush, try autoreconf -i
$ autoreconf -i Can't exec "libtoolize": Adresář nebo soubor neexistuje at /usr/bin/autoreconf line 196. Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196. src/Makefile.am:1: Libtool library used but `LIBTOOL' is undefined src/Makefile.am:1: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL' src/Makefile.am:1: to `configure.ac' and run `aclocal' and `autoconf' again. src/Makefile.am:1: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure src/Makefile.am:1: its definition is in aclocal's search path. autoreconf: automake failed with exit status: 1
|
|
|
|
slush
Legendary
Offline
Activity: 1386
Merit: 1097
|
|
December 15, 2011, 05:37:06 PM |
|
OK, I just made clean git clone. Autoconf failed again, autoconf -i did something, then autoconf passed. I have another error in ./configure now: $ ./configure configure: error: cannot find install-sh, install.sh, or shtool in build-aux "."/build-aux
I'm little confused. Am I doing anything wrong? My system is pretty standard Ubuntu 11.10.
|
|
|
|
genjix (OP)
Legendary
Offline
Activity: 1232
Merit: 1076
|
|
December 18, 2011, 01:05:04 PM |
|
OK, I just made clean git clone. Autoconf failed again, autoconf -i did something, then autoconf passed. I have another error in ./configure now: $ ./configure configure: error: cannot find install-sh, install.sh, or shtool in build-aux "."/build-aux
I'm little confused. Am I doing anything wrong? My system is pretty standard Ubuntu 11.10. Try this: $ sudo apt-get install build-essential autoconf libtool libdb++-dev protobuf pkg-config libboost-all-dev $ autoreconf -i I'm not on the forums too often. Feel free to poke me on Freenode. I'm either in #bitcoinconsultancy or I'm lurking. Or you can use my email: genjix@riseup.netThen for fun, you can run the test cases as: $ make -f development-makefile net bdb-test $ ./bin/tests/nettest $ mkdir database $ ./bin/tests/bdb-test
... and so on (look under tests/)
|
|
|
|
|