Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: arsenische on November 06, 2012, 02:21:09 PM



Title: How to run bitcoind in offline mode?
Post by: arsenische on November 06, 2012, 02:21:09 PM
I want to run an offline instance of bitcoind on ubuntu.

I plan to use it to generate addresses and to sign transactions, but I don't want it to attempt to download the block chain.

I know I can filter it on firewall or do something of the kind.. But is there a nicer way to make it work in offline mode?


Title: Re: How to run bitcoind in offline mode?
Post by: arsenische on November 06, 2012, 03:27:37 PM
You should look into Armory, it does this very nicely

Thanks, I've read about Armory. It seems to be a very nice and advanced piece of software. It can generate deterministic public addresses without private keys, that's really great!

But I didn't find much documentation on it. I can only see that it has many dependencies and is quite a big project. I have no idea how to use it without GUI (I don't plan to use GUI as most jobs are to be automated and I don't want to be constrained by my desktop OS). Also not sure about how scalable and speedy it is.

What I like about bitcoind is its straight-forward command-line (and RPC) interface and reliability. So I kind of understand what I can do with it. And just 3 pages describe almost everything I need:
  • https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
  • https://en.bitcoin.it/wiki/Raw_Transactions
  • https://people.xiph.org/~greg/signdemo.txt

But maybe you are right and Armory is the best choice. Where can I find any manual and examples? (Or how should I start?)


Title: Re: How to run bitcoind in offline mode?
Post by: CIYAM on November 06, 2012, 03:40:44 PM
Another approach (if you are just wanting to generate addresses) is to use "vanitygen" or download a webpage such as "brainwallet.org" for offline usage.

Also I posted a script for combining vanitygen with GPG on the forum (try searching for those two terms) if that might be of any interest.


Title: Re: How to run bitcoind in offline mode?
Post by: CIYAM on November 06, 2012, 03:49:21 PM
He also wanted to sign transactions offline

I think you can do that with "brainwallet.org" although I haven't actually verified it yet (but will be doing so soon).


Title: Re: How to run bitcoind in offline mode?
Post by: arsenische on November 06, 2012, 03:59:34 PM
https://bitcointalk.org/index.php?topic=92496.0

this will be what your looking for, by why you need it scalable? are you going to be doing 10,000's transactions cause bitcoind can't even handle that many well to be honest.

Regarding scalability: not sure about amount of transactions, but I experienced problems with bitcoind when wallet.dat became larger than 300 mb (it just took too long to start, reparse or repair it). Probably that's due to many thousands of change addresses.  I expect that if I use raw transactions and store the private keys in my database instead of wallet.dat, I'll be able to scale it.

So I thought about using 2 bitcoind services that interact via mysql database:

1) "offline" bitcoind: 1 listening port for ssh, 1 outgoing port to mysql; database permissions to write bitcoin addresses, private keys, signed transactions; database permissions to read unsigned transactions.

2) online bitcoind: no need in firewall; database permission to read bitcoin addresses, database permission to write unsigned transactions

But maybe armory daemon is a more convenient and secure solution. I'll look at it closer, thanks!


Title: Re: How to run bitcoind in offline mode?
Post by: arsenische on November 06, 2012, 07:12:27 PM
Another approach (if you are just wanting to generate addresses) is to use "vanitygen" or download a webpage such as "brainwallet.org" for offline usage.

Also I posted a script for combining vanitygen with GPG on the forum (try searching for those two terms) if that might be of any interest.


I think I found that thread (https://bitcointalk.org/index.php?topic=118182.0), thanks.

Even though I don't really need vanity addresses, vanitygen allows to generate bitcoin addresses without inflating my wallet.dat :)


Title: Re: How to run bitcoind in offline mode?
Post by: deepceleron on November 07, 2012, 03:23:59 AM
Bitcoin has a command-line or bitcoin.conf option - "connect", which will allow it to connect to only specific peers; tell it to only connect to the local interface, and it won't communicate with any other Bitcoin nodes:

add this line to bitcoin.conf:
# use as many connect= settings as you like to connect ONLY to specific peers:
connect=127.0.0.1:8333


or start it with:
bitcoind -connect=127.0.0.1:8333



Title: Re: How to run bitcoind in offline mode?
Post by: arsenische on November 07, 2012, 10:00:55 AM
Bitcoin has a command-line or bitcoin.conf option - "connect", which will allow it to connect to only specific peers; tell it to only connect to the local interface, and it won't communicate with any other Bitcoin nodes:

add this line to bitcoin.conf:
# use as many connect= settings as you like to connect ONLY to specific peers:
connect=127.0.0.1:8333


or start it with:
bitcoind -connect=127.0.0.1:8333



That's what I was asking about. I thought of this option, but it is not that a nice since I can see in logs that bitcoind still tries to connect to itself every ~5 seconds, but it works, thanks!