Pages:
Author

Topic: libbitcoin - page 10. (Read 92413 times)

legendary
Activity: 1386
Merit: 1097
December 15, 2011, 01:30:24 PM
#78
@slush, try autoreconf -i

Code:
$ 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
full member
Activity: 154
Merit: 101
Bitcoin!
December 15, 2011, 10:10:15 AM
#77
Is this still licensed under the AGPL?
legendary
Activity: 1232
Merit: 1076
December 11, 2011, 03:59:44 PM
#76
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:

Code:
f2(); f1(); f3();

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 Smiley

@slush, try autoreconf -i
legendary
Activity: 1386
Merit: 1097
December 08, 2011, 12:14:41 AM
#75
Any idea? It's fresh git clone.

Code:
$ 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
legendary
Activity: 1372
Merit: 1002
November 30, 2011, 12:48:33 PM
#74
I like "blockchain" more than "backend". But I don't know exactly what functions are there so...
legendary
Activity: 1232
Merit: 1076
November 30, 2011, 12:07:36 PM
#73
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)
sr. member
Activity: 322
Merit: 251
FirstBits: 168Bc
November 29, 2011, 08:36:30 PM
#72
What is 'acting'? I prefer to see personal/private data clearly distinguished from public data by name.
legendary
Activity: 1232
Merit: 1076
November 29, 2011, 05:48:44 PM
#71
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.
newbie
Activity: 10
Merit: 0
November 16, 2011, 04:59:23 PM
#70
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:
Code:
DEPEND="sys-libs/db:5.1 ..."

Thanks, I fixed the ebuild. Also, storage backends are now enabled and disabled by use flags.
legendary
Activity: 1232
Merit: 1076
November 16, 2011, 12:08:03 PM
#69
That's cool Smiley 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
legendary
Activity: 1386
Merit: 1097
November 16, 2011, 10:58:38 AM
#68
genjix, thanks for great work. I have been waiting for python binding and now I have finally something to play with :-).
legendary
Activity: 1232
Merit: 1076
November 16, 2011, 10:03:35 AM
#67
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.
Code:
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:
Code:
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
full member
Activity: 185
Merit: 100
November 16, 2011, 04:26:42 AM
#66
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:
Code:
DEPEND="sys-libs/db:5.1 ..."

Oh, and ridiculous nice work by the way!
legendary
Activity: 1386
Merit: 1097
November 15, 2011, 10:18:04 PM
#65
Ubuntu package available for libbitcoin:

https://launchpad.net/~zgenjix/+archive/libbitcoin

Error: Page not found. It should be probably "genjix" instead of "zgenjix" Wink
sr. member
Activity: 462
Merit: 250
November 13, 2011, 10:12:17 PM
#64
Minor nit: The OP_CHECKSIG wiki page mentions libbitcoin and
Code:
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:
Code:
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::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::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.)
legendary
Activity: 1232
Merit: 1076
November 06, 2011, 05:01:15 PM
#63
Gentoo ebuild

Kamil Domański has made a gentoo ebuild.

Code:
layman -a bitcoin
emerge libbitcoin
legendary
Activity: 1232
Merit: 1076
November 05, 2011, 01:54:30 PM
#62
Ubuntu package available for libbitcoin:

https://launchpad.net/~zgenjix/+archive/libbitcoin

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

Code:
$ 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
legendary
Activity: 1232
Merit: 1076
November 02, 2011, 06:19:20 PM
#61
Command line utilities for messing around with private keys and creating your own transactions:

https://bitcointalksearch.org/topic/m.604667
legendary
Activity: 1232
Merit: 1076
October 26, 2011, 12:18:47 PM
#60
Ahhh true, I forgot about the case insensitivity.

Thanks for the advice.
hero member
Activity: 481
Merit: 529
October 26, 2011, 11:56:54 AM
#59
Does anyone here know how I could do something like:

Code:
SELECT sum(value)
FROM outputs
WHERE script LIKE decode('76a91412ab8dc588ca9', 'hex') + '%';

Where script is a bytea object in order for me to support firstbits?

I think bytea supports BETWEEN, so this could be (UNTESTED) "script BETWEEN decode('76a91412ab8dc588ca9', 'hex') AND decode('76a91412ab8dc588caa', 'hex')".  Abe does something like this:
Code:
                lo = abe.store.binin_hex(q + '0' * (40 - len(q)))
                hi = abe.store.binin_hex(q + 'f' * (40 - len(q)))

That way I could add a fetch_balance_partial(...) method to support this.
Keep in mind that firstbits is case-insensitive.  1a matches 1a* and 1A*.  You seem willing to implement a new, firstbits-like algorithm, and that's okay, but if it doesn't agree with firstbits.com, you shouldn't call it "firstbits".
Pages:
Jump to: