Version 0.2.6 on SVN can now run as a daemon and be controlled by command line or JSON-RPC.

On Linux it needs libgtk2.0-0 installed, but does not need a GUI running. Hopefully gtk can be installed without having a windowing system installed.

The command to start as a daemon is:bitcoin -daemon [switches...]

Or, to run the UI normally and also be able to control it from command line or JSON-RPC, use the "-server" switch.bitcoin -server [switches...]

With either switch, it runs an HTTP JSON-RPC server that accepts local socket connections on 127.0.0.1:8332. The port is bound to loopback and can only be accessed from the local machine, but from any account, not just the user it's running under.

To control it from the command line, the interface is a command name without any switches, followed by parameters if any.bitcoin <command> [params...]

It's a simple JSON-RPC client and prints the JSON result. Look at rpc.cpp for the list of commands.

Web apps or anything automated will normally use JSON-RPC directly, not command line. There are JSON-RPC libraries for all the major languages. In script languages like PHP and Python the syntax is as natural as calling a local function.

Will this requirement be removed sometime? I'd rather not have to deal with GTK.

How much "dealing with" does GTK actually require? Is it just a matter of "sudo apt-get install libgtk2.0-0" and having some extra libraries sitting around? GTK doesn't have to do anything, just be there for bitcoin to link to when it loads up, have the gtk-init-check call fail because no GUI present, then it's done.

It saves us butchering everything with ifdefs and a separate compile and binary to use wxBase just to try to avoid linking GTK.

Will this requirement be removed sometime? I'd rather not have to deal with GTK.

How much "dealing with" does GTK actually require? Is it just a matter of "sudo apt-get install libgtk2.0-0" and having some extra libraries sitting around? GTK doesn't have to do anything, just be there for bitcoin to link to when it loads up, have the gtk-init-check call fail because no GUI present, then it's done.

It saves us butchering everything with ifdefs and a separate compile and binary to use wxBase just to try to avoid linking GTK.

I'm using Linux From Scratch, so installing a dependency-ridden package like GTK would be a bit of a pain. Why should I add a dozen additional packages and hundreds of megabytes to my system when BitCoin doesn't even use them?

This is strange... When I start Bitcoin as a daemon on my 64 bit Linux server, it eats up all the 250MB of remaining RAM, 700MB of swap and eventually crashes. On my 32 bit Ubuntu desktop, it works fine and stays at 15MB of memory usage. The server is running a 64 bit build of Bitcoin. Maybe there's something wrong with the build or something.

OK, I made a build target bitcoind that only links wxBase and does not link GTK. Version 0.2.7 on SVN.

I split out the init and shutdown stuff from ui.cpp into init.cpp, so now ui.cpp is pure UI. ui.h provides inline stubs if wxUSE_GUI=0. We only have four functions that interface from the node to the UI. In the bitcoind build, we don't link ui.o or uibase.o.

Sure feels like it could be something in wxWidgets retrying endlessly because some UI thing failed or something wasn't inited correctly. Our hack to ignore the initialize failure and run anyway means we're in uncharted territory. We're relying on the fact that we hardly use wx in this mode. We do still use a few things like wxGetTranslation and wxMutex.

Another way to debug would be to run in gdb, wait until everything is quiet and all threads should be idle, and break it and see which thread is busily doing something and what it's doing.

I suspect bitcoind will probably work fine, but I hope you can still debug the problem.

This is strange... When I start Bitcoin as a daemon on my 64 bit Linux server, it eats up all the 250MB of remaining RAM, 700MB of swap and eventually crashes. On my 32 bit Ubuntu desktop, it works fine and stays at 15MB of memory usage. The server is running a 64 bit build of Bitcoin. Maybe there's something wrong with the build or something.

Here is code for a simple Python API. Each method connects to the server, sends a request, gets a response, then returns a Python dictionary equivalent of the JSON. It uses standard Python modules. No error checking is done and only three functions from rpc.cpp are implemented. If there's interest I can write more.

To use it, the Python code should be something like...access = BitcoinAPI()access.getInfo()access.getAmountReceived("1JyEmxiMso2RsFVfBcCa616npBvGgxiBX")access.sendToAddress("1JyEmxiMso2RsFVfBcCa616npBvGgxiBX", 100.00) # Send 100 Bitcoins to my Address

This will be the base for automatic transactions on my site. If there are any questions or concerns let me know. If there is something severely wrong, feel free to school me.

Here is code for a simple Python API. Each method connects to the server, sends a request, gets a response, then returns a Python dictionary equivalent of the JSON. It uses standard Python modules. No error checking is done and only three functions from rpc.cpp are implemented. If there's interest I can write more.

This sounds very promising. Is there anyway to carve it out as a stand alone binary? My very rudimentary programming skills might not cut the cheese, but I would like to try to make a Firefox bitcoin wallet plugin. If anybody wants to hack at that and leave me in the dust then I gladly eat dust, otherwise I will plod along and see what I can't do (I refuse to do the impossible, but merely resist the inevitable ). If there were a way to just get the extra files for the JSON and such like (for web only), working with the bitcoin 0.2.0 version and save having to compile, then the target user would not have to install anything other than the plugin itself, that what I'm fishing for really. Is that a tall order?

I would aim to have bitcoin built into Firefox as a standard. Since no third party is being given preference here, can't it be standard browser code, or even built into the HTML or JavaScript, to parse dedicated scripting code and streamline development of online banking and financial utilities? Perhaps even deposits and withdrawals from banks could then finally be done online without their greedy charges. The plugin would demonstrate the idea for now though and save some user hassle as installing is easy, standard and the plugin repository has wide exposure. Then people may want to email and invite their friends to get the new electronic cash standard. The Paypal tactic of being able to email cash to somebody without an account, and have them login to make an account (to get their money), will translate to, having them load Firefox and/or open the plugin window from the email and install. Guaranteed - satisfaction or your money back, (to the sender of course). Go viral bitcoin.

EDIT: "can't it be standard browser code, or even built into the HTML or JavaScript" -- And now with a little research, I realize that is just what the JSON stuff does. Yikes! you can't fall asleep for 5 minutes without finding yourself out of the loop.

It's not a big problem at the moment. I'd still like to see authentication and wallet encryption in bitcoin in the future. Also, if I were root, couldn't I justsudo su - <USERNAME>and evade the owner check in iptables?

You need to recompile your kernel with support for "owner match support" for netfilter. I was always running into this problem (wanting exotic iptables filters), so I have all of the netfilter modules enabled, even though most of them seem useless to me right now.

I agree that proper authentication would be good, but it's not very important right now. Very few people are running BitCoin on actual multi-user machines, I think.

Quote

if I were root, couldn't I just...

Of course. But packets that originate from the "root" account will still be blocked unless you remove the iptables rule.

Is this really true for modern web browsers, or would the web page have to be loaded from localhost as well? Can you make an HTTP call from javascript to the localhost if the page was loaded from an internet host?

It seems that direct remote calling from javascript might not be possible after all. I wonder if calling localhost:8332 is possible from pages stored on your hard disk.

I didn't try that, but I did try two servers on the same machine. One on 127.0.0.1:8332 and the other on 127.0.0.1:8080. Neither browser script could make a request to the opposite server. I was using Firefox 3.6

Seriously? So, everyone knows C++ but me? I don't understand where this list of commands is in this file. *sigh* I have tried to understand C++ for years, things just are not clicking in my head for some reason. Do you mean this stuff?

Seriously? So, everyone knows C++ but me? I don't understand where this list of commands is in this file. *sigh* I have tried to understand C++ for years, things just are not clicking in my head for some reason. Do you mean this stuff?

Well, it didn't fix the wallet the way I wanted it to, it still had the hung transactions on it. I want to Remove those hung transactions, and fix whatever caused them, Or fix whatever is causing it so that they will stop being hung.

This error is not related to your problem. It's just that the wallet contain a new type of data that the bitcointools is not aware of. (namely, the most recent block that this wallet was synchronized with)

Do you have a thread where you describe the scenario that led to hung transactions ?edit: I assume this is the one. My advice would be to wait a bit for the import/export private keys feature to be formally released in an official version. Then you can dump your keys to a text file and import back the relevant ones to a fresh wallet.

This error is not related to your problem. It's just that the wallet contain a new type of data that the bitcointools is not aware of. (namely, the most recent block that this wallet was synchronized with)

Do you have a thread where you describe the scenario that led to hung transactions ?edit: I assume this is the one. My advice would be to wait a bit for the import/export private keys feature to be formally released in an official version. Then you can dump your keys to a text file and import back the relevant ones to a fresh wallet.

Yup, that's the one, and yes, those are the features I need. I found the github branch with a download of stuff that supposedly patches those RPC commands into bitcoin, but, after extracting it nothing was installed or patched, and I don't know what to do. I want to dump my wallet, and only have the stuff I want, not the hung or damaged stuff, and then import the good stuff into a new wallet, a fresh start. Please please please, someone put it into the main branch so it gets included in the next official release!