Bitcoin Forum
December 03, 2016, 09:55:45 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 83423 times)
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 02, 2011, 10:19:20 PM
 #61

Command line utilities for messing around with private keys and creating your own transactions:

https://bitcointalk.org/index.php?topic=50721.msg604667#msg604667
1480758945
Hero Member
*
Offline Offline

Posts: 1480758945

View Profile Personal Message (Offline)

Ignore
1480758945
Reply with quote  #2

1480758945
Report to moderator
1480758945
Hero Member
*
Offline Offline

Posts: 1480758945

View Profile Personal Message (Offline)

Ignore
1480758945
Reply with quote  #2

1480758945
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480758945
Hero Member
*
Offline Offline

Posts: 1480758945

View Profile Personal Message (Offline)

Ignore
1480758945
Reply with quote  #2

1480758945
Report to moderator
1480758945
Hero Member
*
Offline Offline

Posts: 1480758945

View Profile Personal Message (Offline)

Ignore
1480758945
Reply with quote  #2

1480758945
Report to moderator
1480758945
Hero Member
*
Offline Offline

Posts: 1480758945

View Profile Personal Message (Offline)

Ignore
1480758945
Reply with quote  #2

1480758945
Report to moderator
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 05, 2011, 05: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
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 06, 2011, 09:01:15 PM
 #63

Gentoo ebuild

Kamil Domański has made a gentoo ebuild.

Code:
layman -a bitcoin
emerge libbitcoin
fivebells
Sr. Member
****
Offline Offline

Activity: 462


View Profile
November 14, 2011, 02:12:17 AM
 #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<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 Offline

Activity: 1358



View Profile WWW
November 16, 2011, 02:18:04 AM
 #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

bitclown
Full Member
***
Offline Offline

Activity: 186


View Profile
November 16, 2011, 08: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!
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 16, 2011, 02:03:35 PM
 #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
slush
Legendary
*
Offline Offline

Activity: 1358



View Profile WWW
November 16, 2011, 02:58:38 PM
 #68

genjix, thanks for great work. I have been waiting for python binding and now I have finally something to play with :-).

genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 16, 2011, 04: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
kdomanski
Newbie
*
Offline Offline

Activity: 10


View Profile
November 16, 2011, 08: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.
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 29, 2011, 09: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.
netrin
Sr. Member
****
Offline Offline

Activity: 322


FirstBits: 168Bc


View Profile
November 30, 2011, 12:36:30 AM
 #72

What is 'acting'? I prefer to see personal/private data clearly distinguished from public data by name.

Greenlandic tupilak. Hand carved, traditional cursed bone figures. Sorry, polar bear, walrus and human remains not available for export.
genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
November 30, 2011, 04: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)
jtimon
Legendary
*
Offline Offline

Activity: 1246


View Profile WWW
November 30, 2011, 04:48:33 PM
 #74

I like "blockchain" more than "backend". But I don't know exactly what functions are there so...

2 different forms of free-money: Freicoin (free of basic interest because it's perishable), Mutual credit (no interest because it's abundant)
slush
Legendary
*
Offline Offline

Activity: 1358



View Profile WWW
December 08, 2011, 04: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

genjix
Legendary
*
Offline Offline

Activity: 1232


View Profile
December 11, 2011, 07: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
btc_artist
Full Member
***
Offline Offline

Activity: 154


Bitcoin!


View Profile WWW
December 15, 2011, 02:10:15 PM
 #77

Is this still licensed under the AGPL?

BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf
LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
slush
Legendary
*
Offline Offline

Activity: 1358



View Profile WWW
December 15, 2011, 05: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

slush
Legendary
*
Offline Offline

Activity: 1358



View Profile WWW
December 15, 2011, 05:37:06 PM
 #79

OK, I just made clean git clone. Autoconf failed again, autoconf -i did something, then autoconf passed. I have another error in ./configure now:

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

Activity: 1232


View Profile
December 18, 2011, 01:05:04 PM
 #80

OK, I just made clean git clone. Autoconf failed again, autoconf -i did something, then autoconf passed. I have another error in ./configure now:

Code:
$ ./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:

Quote
$ 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.net

Then for fun, you can run the test cases as:

Quote
$ make -f development-makefile net bdb-test
$ ./bin/tests/nettest
$ mkdir database
$ ./bin/tests/bdb-test

... and so on (look under tests/)
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!