Bitcoin Forum
June 28, 2024, 01:42:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: problems running headless bitcoind  (Read 748 times)
OldSpurty (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 08, 2013, 02:59:12 AM
 #1

Hello, and thanks in advance for any help

I am currently trying to get a headless bitcoin server running on ubuntu server 12.04. Running into a few problems, and wondering a couple things about how the headless client works. I used the method here to get a copy of the block chain faster: https://bitcointalk.org/index.php?topic=117982.0

Since I want to use a disk different from the boot device for storage and to not generate coins, I have been using this command:
     
     user@computer:~$ bitcoind -daemon -datadir=/mnt/storageraid/.bitcoin/ -gen=0 -rescan

which results in -

     user@computer:~$ bitcoin server starting

Is this how I should enter the command, and is this what the program should look like running? how do I know if the client has an up-to-date block chain?

I also have been receiving errors when I try to do things like bitcoind getinfo:

     user@computer:~$ bitcoind getinfo
     error: incorrect rpcuser or rpcpassword (authorization failed)
     user@computer:~$

I have put the following into my .bitcoin/bitcoin.conf file:

     rpcuser=dude
     rpcpassword=guest

am I supposed to include those when I enter the command?

Thanks for any help
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
May 08, 2013, 03:10:03 AM
 #2

I think your problem is the -datadir.  You tell your server to look in one datadir, then the "client" (bitcoind rpc command) uses a different default (as far as I can see from your examples.)  Make sure your desired username/password are in /mnt/storageraid/.bitcoin/bitcoin.conf , and add -datadir=/mnt/storageraid/.bitcoin/ to the "bitcoind getinfo" command.

You can see informational messages in /mnt/storageraid/.bitcoin/debug.log which should help you diagnose how the syncing is going, etc.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
OldSpurty (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 08, 2013, 04:00:36 AM
 #3

That does the trick alright.... I'm not sure why I thought I wouldn't need to specify the altered directory for get info... feel a little dumb.

Thank you very much for your very helpful, and incredibly fast response.
Abdussamad
Legendary
*
Online Online

Activity: 3640
Merit: 1571



View Profile
May 08, 2013, 04:07:33 AM
 #4

Create an alias so you don't have to type the whole thing every time you want to getinfo.
OldSpurty (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 08, 2013, 08:44:01 PM
Last edit: May 08, 2013, 09:03:21 PM by OldSpurty
 #5

The reason I want to move the block chain data is to save the limited space of my SSD boot device, and just keep the block chain data on the bulk storage volume. It seems like it would be best to have the program run out of the home directory, and use an alias to relocate only the block chain data.

If I am going to do this, what file(s) should I move? If possible, I would like to have it set up such that the up-to-date block chain could be copied from only /mnt/storageraid, and not access the home directory at all.

Thanks again for everyone's help, it is very much appreciated
Abdussamad
Legendary
*
Online Online

Activity: 3640
Merit: 1571



View Profile
May 08, 2013, 09:39:43 PM
 #6

The reason I want to move the block chain data is to save the limited space of my SSD boot device, and just keep the block chain data on the bulk storage volume. It seems like it would be best to have the program run out of the home directory, and use an alias to relocate only the block chain data.

If I am going to do this, what file(s) should I move? If possible, I would like to have it set up such that the up-to-date block chain could be copied from only /mnt/storageraid, and not access the home directory at all.

Thanks again for everyone's help, it is very much appreciated

An alias can't relocate anything. By alias I mean bash alias. A short name for a longer command. For example:

alias btcdstart="/home/bitcoin/bitcoind start"

Google bash alias and you'll understand what I mean.
OldSpurty (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 08, 2013, 09:52:23 PM
 #7

I was mistaken about what we were talking about. Let me see if I have it right now:

An alias would let me make whatever command I want equivalent to bitcoind -datadir=/mnt/storageraid/.bitcoin/ getinfo

What I thought you were talking about, and what I meant in my last post is a link, not an alias.

I am hoping to run bitcoind in the home directory (the default), and replace block data like blk00001.dat with a link to /mnt/storageraid/.bitcoinstuff/blk00001.dat

I am not sure if this will work as I am expecting, and I also do not know what all files I would need to relocate and link to achieve this.

Thanks again, and sorry about the confusion
Abdussamad
Legendary
*
Online Online

Activity: 3640
Merit: 1571



View Profile
May 08, 2013, 10:32:47 PM
 #8

The simplest way to do what you are trying to accomplish would be to replace the entire ~/.bitcoin directory with a symlink to a directory in /mnt/whatever:

so first shutdown bitcoind:

bitcoind stop

then move .bitcoin over:

mv ~/.bitcoin /mnt/whatever

Then symlink to the new location

ln -s -d /mnt/whatever ~/.bitcoin
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!