Bashern
Dabbler
- Joined
- Sep 1, 2015
- Messages
- 26
I keep a guide up to date here: https://github.com/seth586/guides/tree/master/FreeNAS
After fumbling around the internet, I've discovered that there are a ton of bitcoin node guides for linux, and virtually nothing for FreeBSD. This guide will get Bitcoin Core 0.17.0rc3 compiled from source (or anther release you choose) and running as a public and tor hidden service. This also includes instructions on installing ncurses2, a terminal user interface for your bitcoin node.
This should be a good starting point for your lnd, electrum, or btcpay servers.
I wrote a guide on medium, you can see it here. I'll make an abridged version here.
First of all, create your jail using the FreeNAS GUI. Give it a static lease and forward port 8333. SSH into your FreeNAS box.
Go to https://github.com/bitcoin/bitcoin/releases, find the tar.gz release we want to install. The latest release is 0.16.3 at https://github.com/bitcoin/bitcoin/archive/v0.16.3.tar.gz
This process may take a while. Once its done and installed, we need to add a service script and then call it on boot. FreeBSD ports maintains a service script we can use at https://github.com/freebsd/freebsd-ports/blob/master/net-p2p/bitcoin/files/bitcoind.in (click on the RAW link to get a direct link to the file)
Lets edit the startup script for our local environment:
The %%PREVIX%% variables need to be changed to local paths, and the users needs to be changed to _tor:
Lets make bitcoin's folders and configuration file:
Add the collowing lines to bitcoin.conf:
Configure Tor:
Add the following lines to tor’s configuration file:
Restart your jail, and SSH back in. Check running processes. You should see bitcoind and tor running as uid "_tor":
Bitcoin-cli will reveal your tor address:
And install ncurses2:
Use CTRL+Z to suspend.
Enjoy! Please leave feedback and questions below! I'm a FreeBSD hobbyist, so I have no formal education, if something should be done better let me know!
Edit: 9/18/2018: version 0.17.0rc3 superseded by 0.16.3
After fumbling around the internet, I've discovered that there are a ton of bitcoin node guides for linux, and virtually nothing for FreeBSD. This guide will get Bitcoin Core 0.17.0rc3 compiled from source (or anther release you choose) and running as a public and tor hidden service. This also includes instructions on installing ncurses2, a terminal user interface for your bitcoin node.
This should be a good starting point for your lnd, electrum, or btcpay servers.
I wrote a guide on medium, you can see it here. I'll make an abridged version here.
First of all, create your jail using the FreeNAS GUI. Give it a static lease and forward port 8333. SSH into your FreeNAS box.
iocage list
iocage console bitcoin_node
pkg install autoconf automake boost-libs git gmake libevent libtool openssl pkgconf wget nano tor
Go to https://github.com/bitcoin/bitcoin/releases, find the tar.gz release we want to install. The latest release is 0.16.3 at https://github.com/bitcoin/bitcoin/archive/v0.16.3.tar.gz
wget https://github.com/bitcoin/bitcoin/archive/v0.16.3.tar.gz
tar xzvf v0.16.3.tar.gz
cd bitcoin-0.16.3
./autogen.sh
./configure --disable-wallet --without-gui --without-miniupnpc --disable-dependency-tracking
gmake
gmake install
This process may take a while. Once its done and installed, we need to add a service script and then call it on boot. FreeBSD ports maintains a service script we can use at https://github.com/freebsd/freebsd-ports/blob/master/net-p2p/bitcoin/files/bitcoind.in (click on the RAW link to get a direct link to the file)
cd /etc/rc.d/
wget https://raw.githubusercontent.com/freebsd/freebsd-ports/master/net-p2p/bitcoin/files/bitcoind.in
mv bitcoind.in bitcoind
chmod +x bitcoind
sysrc 'bitcoind_enable=yes'
Lets edit the startup script for our local environment:
nano bitcoind
The %%PREVIX%% variables need to be changed to local paths, and the users needs to be changed to _tor:
command="/usr/local/bin/bitcoind"
: ${bitcoind_user:="_tor"}
: ${bitcoind_group:="_tor"}
: ${bitcoind_config_file:="/root/.bitcoin/bitcoin.conf"}
Lets make bitcoin's folders and configuration file:
mkdir /var/db/bitcoin
mkdir /root/.bitcoin
nano /root/.bitcoin/bitcoin.conf
Add the collowing lines to bitcoin.conf:
datadir=/var/db/bitcoin
server=1
txindex=1
Configure Tor:
sysrc 'tor_enable=yes'
nano /usr/local/etc/tor/torrc
Add the following lines to tor’s configuration file:
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
Restart your jail, and SSH back in. Check running processes. You should see bitcoind and tor running as uid "_tor":
ps auxww
Bitcoin-cli will reveal your tor address:
bitcoin-cli getnetworkinfo
And install ncurses2:
cd /root
pkg install py36-pip python3
git clone https://github.com/esotericnonsense/bitcoind-ncurses2
pip-3.6 install -r bitcoind-ncurses2/requirements.txt
python3 /root/bitcoind-ncurses2/main.py --datadir /var/db/bitcoin
Use CTRL+Z to suspend.
Enjoy! Please leave feedback and questions below! I'm a FreeBSD hobbyist, so I have no formal education, if something should be done better let me know!
Edit: 9/18/2018: version 0.17.0rc3 superseded by 0.16.3
Last edited: