Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Nemo1024 on June 29, 2013, 12:42:38 PM



Title: How to setup a full node on a headless *nix machine
Post by: Nemo1024 on June 29, 2013, 12:42:38 PM
As the subject says.
I have a high-speed Internet connection and a machine running FreeBSD 24/7 in headless mode (no X-Window), which nevertheless has CPU power, memory and disk space to spare.
How do I set up a full node on such machine? Which ports do I need to open in my Internet router? Are there any security concerns that I need to be aware of?
Sorry, if the answer exists from before, but searching the board for "full node setup" gave a huge amount of unrelated answers...


Title: Re: How to setup a full node on a headless *nix machine
Post by: grue on June 29, 2013, 09:04:59 PM
1. forward your ports (if you can't find them, you suck)
2. execute "./bitcoind &" in terminal

THAT'S IT


Title: Re: How to setup a full node on a headless *nix machine
Post by: kjj on June 29, 2013, 09:16:14 PM
Rather than forking it into the background of your current session, you'd be better off setting up a config file and an init script.

I use slackware, so I wrote my own.  You can probably find scripts for more popular distributions if you look.  Here is an excerpt from my rc.bitcoind:

Code:
bitcoind_start() {
  if [ -x $BINFILE ]; then
    echo "Waiting for NTP before starting bitcoin..."
    /usr/sbin/ntp-wait
    echo "Starting bitcoind:  $BINFILE"
    sudo -u bitcoind $BINFILE -conf=$CONFFILE -pid=$PIDFILE -daemon -datadir=$DATADIR
  fi
}

If you don't care about incoming connections, you don't need to forward any ports.  If you do want incoming connections, open TCP port 8333 (or forward it).


Title: Re: How to setup a full node on a headless *nix machine
Post by: Nemo1024 on June 29, 2013, 09:43:01 PM
Using a script is a good idea. And thanks for the port number info.
The source seems to be already in the ports tree under net-p2p/bitcoin
Any configuration consideration I should be concerned about?
Will try to build and see how it goes from there.

@grue: Though the answer is not very informative, you get points for the avatar and the subtext. My move: I am looking for tinderbox and a torch in my sack.  ;D


Title: Re: How to setup a full node on a headless *nix machine
Post by: Nemo1024 on June 29, 2013, 10:43:02 PM
Hmm... FeeBSD port (even after portupgrade) contains bitcoin-0.7.1
Will try to build from Linux source for 0.8.3 tomorrow, though I don't have high hopes for success.