Re: [Bitcoin-development] Adding callback hooks to the satoshi client
On Thursday, March 22, 2012 1:13:13 AM Eric Lombrozo wrote: I would like to propose adding these callback hooks to the main branch. I am willing to help locate these key points, reorganize the code to place these methods in separate source files, define a callback mechanism, and contribute source code. I'm not sure it's a good idea to let other code into the main wallet-handling process/memory space. I'd suggest looking into designing a workable Wallet Protocol for general use between the wallet and GUIs/applications. https://en.bitcoin.it/wiki/Wallet_protocol has a draft I made a long time ago, but really seems a bit overcomplicated. -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Bitcoin-development mailing list Bitcoin-development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Re: [Bitcoin-development] Adding callback hooks to the satoshi client
The callback architecture could be such that other code would never need to enter into the wallet-handling process/memory space. For instance, client applications could subscribe a particular URL to get sent an HTTP POST. For the apps I've been working on, there really isn't any need to access the wallet space. I was talking more about events like A new transaction was just seen or A new block was just seen, like what libcoin seems to support (sorry, Michael, I haven't really had a chance to look at it in depth but I will). Then there are other types of events for other bitcoin messages could also be useful: new addr, new node connected, node disconnected, bitcoin alert, etc... Then there are events for dealing with potential attacks: DoS attempt, double-spend attempts (two transactions seen with valid signatures claiming the same output), node sending malformed messages, etc... And then there are alerts pertaining to the status of the bitcoind process itself: bitcoind started, bitcoind ready to accept connections, bitcoind stopping, etc... None of these events require the callback subscriber to have any access to the bitcoind process/memory space and all the I/O could be done via IPC or over network sockets. -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Bitcoin-development mailing list Bitcoin-development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Re: [Bitcoin-development] Announcement: libcoin
Michael, Since libcoin is chain agnostic, I was wondering if the project can be used like this: When I install it with make install, I would like to have something like this: Regular file: /usr/local/bin/libcoincore # or whatever you like Symlink - Regular file /usr/local/bit/bitcoind - /usr/local/bin/libcoincore # bitcoind is a symlink to libcoincore /usr/local/bit/litecoind - /usr/local/bin/libcoincore # litecoind is a symlink to libcoincore /usr/local/bit/devcoind - /usr/local/bin/libcoincore # devcoind is a symlink to libcoincore /usr/local/bit/namecoind - /usr/local/bin/libcoincore # devcoind is a symlink to libcoincore ...and so on... So, libcoincore will interpret the ARGV[0] and, for each string, it will initiate the appropriate internal functions... I don't know if Libcoin already does something like that... I'm not a developer/code reader... Just a small nerd with big ideas... ^_^ Thanks! Thiago 2012/2/28 Michael Grønager grona...@ceptacle.com Hi again - and thanks for testing and finding this! I have fixed the bug you reported: The culprit was an implicit string constructor for the ChainAddress that caused creation of a not fully initialized ChainAddress. The right way to do it is using chain::getAddress(string) as the ChainAddress is chain specific. A git pull will fix it ;) Cheers, Michael On 27/02/2012, at 20:03, Martinx - ジェームズ wrote: AWESOME!! Thank you!! Anyway, I found a new problem... lol /usr/local/bin/bitcoind getinfo #okay { version : 40001, blocks : 168753, connections : 8, difficulty : 1376302.26788638, testnet : false } /usr/local/bin/bitcoind getaccountaddress # okay... 1J4vNcvEdeCuLH4yvyoC2gxFEF4zquoJ87 /usr/local/bin/bitcoind listaccounts # NOT okay... { } /usr/local/bin/bitcoind getaccountaddress teste # okay 1E6pGh6AAtuJdFXheZMp1zdYmvdqAQn9QT /usr/local/bin/bitcoind listaccounts # NOT okay... { teste : 0. } Where is my default account listed at listaccounts output?! Best, Thiago 2012/2/26 Michael Grønager grona...@ceptacle.com And if you do an update now help is there too ;) /M On 25/02/2012, at 03:11, Martinx - ジェームズ wrote: Thank you!!! It is all working now! Except help... Nice work Michael!! Best, Thiago 2012/2/24 Michael Grønager grona...@ceptacle.com OK - didn't took the weekend: support for port is on github now :) Only took two lines: (port, valueunsigned short(port)-default_value(8333), Listen on specified port for the p2p protocol) and using the port option in the Node constructor (was there already): Node node(chain, data_dir, args.count(nolisten) ? : 0.0.0.0, lexical_caststring(port)); // it is also here we specify the use of a proxy! /M On 24/02/2012, at 19:49, Martinx - ジェームズ wrote: Hi Michael, Thank you for your attention! Now, I'm trying to start libcoin's bitcoind using high ports but, it always try to listen at 8332, no matter what I say... Look: $ cat .bitcoin/bitcoin.conf server=1 daemon=1 rpcuser=libcoin rpcpassword=LibCoin13 rpcport=10332 port=10333 But: /usr/local/bin/bitcoind Error: Address already in use terminate called after throwing an instance of 'DbException' what(): DbEnv::close: Invalid argument Aborted When I strace it, I can see: ... bind(12, {sa_family=AF_INET, sin_port=htons(8333), sin_addr=inet_addr(0.0.0.0)}, 16) = -1 EADDRINUSE (Address already in use) ... I already tried: /usr/local/bin/bitcoind --rpcport 10332 /usr/local/bin/bitcoind --rpcport=10332 Without success... Thanks again! Thiago 2012/2/24 Michael Grønager grona...@ceptacle.com Hi Thiago, Forgot to comment on the two latter: $ bitcoind getaccountaddress HTTP error code: 401 Error: couldn't parse reply from server $ bitcoind listaccounts HTTP error code: 401 Error: couldn't parse reply from server 401 = permission denied - you need to setup username / password either on the commandline or in the bicoin.conf file to access those commands... See in the bitcoind.cpp file for commands that you can use with and without auth... Those that contains an auth requires auth: server.registerMethod(method_ptr(new GetBalance(wallet)), auth); As opposed to: server.registerMethod(method_ptr(new GetInfo(node))); auth is defined by: Auth auth(rpc_user, rpc_pass); // if rpc_user and rpc_pass are not set, all authenticated methods becomes disallowed. so you just experience the case explained in the comment ;) I admit that the output could be more readable, though! /M Any tips?! lol Thanks! Thiago 2012/2/23 Martinx - ジェームズ thiagocmarti...@gmail.com AWESOME!!! I can compile libcoin at my Ubuntu 11.10... I just need to install: sudo aptitude install libboost1.46-all-dev
Re: [Bitcoin-development] Announcement: libcoin
Hi Michael, NOTE: Re-add bitcoin-dev to this thread on Cc... I'll test this ASAP! I REALLY need this feature (blockchain server - wallet client). I just want ask you some things... 1- How close is Libcoin with original Bitcoin? I mean, the output is a little different, the bitcoind help output was disabled and, I'm afraid that Libcoin can possibly being distant from Bitcoin in the future... That can happen?! 2- Do you have plans to update Libcoin on every new upstream Bitcoin release? How fast will be this updates? Do you need more resources/people working on it? Another questions not involved directly with Libcoin/Bitcoin but, I'll need it for my future Bitcoin projects, and Libcoin is on my radar: 1- Do you know about Diaspora* Project? 2- Do you have skills in Ruby on Rails development? Thank you! Thiago 2012/3/3 Michael Grønager grona...@ceptacle.com Hi Martin, There are a couple of options of doing similarly... In the libcoin repository you will find some code for btc and btcd, it is some code I wrote a while ago and it needs to be updated. It functions as a bitcoind master and slave. The btcd keeps the blockchain, but no wallet. btc keeps the wallet and contact the btcd to get transaction info (like send an address and get its transactions or send a transaction id and get its details). It works (or worked when I wrote them) with the wallet.dat, but needs a little update. You could e.g. run one btcd on the machine and several btc instances to get the functionality you asked for. Further, btcd also enables a web wallet, where the private keys are stored in your browsers local-store. I will get the application updated, but most likely in a bit other setup as it is something I intend to marketize in the near future. Hope this answers your question. Cheers, Michael On 03/03/2012, at 02:04, Martinx - ジェームズ wrote: Michael, libcoin is AWESOME! Thanks!!! Can I do the following scenario with libcoin ? : 1- Create a regular Linux user called blockchain, with home dir pointed to /var/lib/libcoin/ (more or like Ubuntu/Debian mysql does); 2- Start bitcoind under user blockchain (the Bitcoin blockchain) will be downloaded to /var/lib/libcoin/bitcoin/ directory); 3- As another regular user, called michael, I would like to run bitcoind too but, I do not want to re-download the blockchain to its own subdir, I want instead, to consult it (blockchain) through libcoin itself (not by socket of JSON)... So, the /home/michael/.bitcoin/ directory will have only wallet.dat and related files, not the blockchain. This is more or less what we can do with Bitcoin Electrum alternate client but, with Electrum, it copy the whole blockchain to mysql... This is terrible from my point of view, I think that there is no need to duplicate the blockchain within MySQL in anyway. I just imagine a bitcoin splited in two, blockchain in one side and wallet in the other side. This is possible with libcoin?! Thank you again! Best, Thiago 2012/2/28 Michael Grønager grona...@ceptacle.com Hi again - and thanks for testing and finding this! I have fixed the bug you reported: The culprit was an implicit string constructor for the ChainAddress that caused creation of a not fully initialized ChainAddress. The right way to do it is using chain::getAddress(string) as the ChainAddress is chain specific. A git pull will fix it ;) Cheers, Michael On 27/02/2012, at 20:03, Martinx - ジェームズ wrote: AWESOME!! Thank you!! Anyway, I found a new problem... lol /usr/local/bin/bitcoind getinfo #okay { version : 40001, blocks : 168753, connections : 8, difficulty : 1376302.26788638, testnet : false } /usr/local/bin/bitcoind getaccountaddress # okay... 1J4vNcvEdeCuLH4yvyoC2gxFEF4zquoJ87 /usr/local/bin/bitcoind listaccounts # NOT okay... { } /usr/local/bin/bitcoind getaccountaddress teste # okay 1E6pGh6AAtuJdFXheZMp1zdYmvdqAQn9QT /usr/local/bin/bitcoind listaccounts # NOT okay... { teste : 0. } Where is my default account listed at listaccounts output?! Best, Thiago 2012/2/26 Michael Grønager grona...@ceptacle.com And if you do an update now help is there too ;) /M On 25/02/2012, at 03:11, Martinx - ジェームズ wrote: Thank you!!! It is all working now! Except help... Nice work Michael!! Best, Thiago 2012/2/24 Michael Grønager grona...@ceptacle.com OK - didn't took the weekend: support for port is on github now :) Only took two lines: (port, valueunsigned short(port)-default_value(8333), Listen on specified port for the p2p protocol) and using the port option in the Node constructor (was there already): Node node(chain, data_dir, args.count(nolisten) ? : 0.0.0.0, lexical_caststring(port)); // it is also here we specify the use of a proxy! /M On 24/02/2012, at 19:49,