-
Notifications
You must be signed in to change notification settings - Fork 1
Airbitz Server Configuration
Airbitz runs a number of libbitcoin-server instances, and these are the instructions we use internally when setting up our boxes. We are maintaining them here on the libbitcoin-server wiki so others can take advantage of them.
These instructions assume an Ubuntu 14.04 server OS.
useradd -m -g users -G sudo -s /bin/bash bitcoin
passwd bitcoin
# Type a password...
su bitcoin
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# Paste public keys into ~/.ssh/authorized_keys, one on each line...
exit
exit
ssh bitcoin@<server>
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tmux
tmux
# Set PasswordAuthentication no:
sudo sed -i -e 's/.*PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
# Set PermitRootLogin no:
sudo sed -i -e 's/.*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo restart ssh
On your personal computer, put lines like the following into ~/.ssh/config
:
Host <convenient name>
HostName <ip address>
User bitcoin
Now you can log into the server using ssh <convenient name>
, and SSH will use the right port, IP address, and user.
# Link taken from https://github.com/libbitcoin/libbitcoin-server/wiki/Download-BS
wget https://github.com/libbitcoin/libbitcoin-server/releases/download/v2.1.0/bs-linux-x64-mainnet
chmod +x bs-linux-x64-mainnet
sudo install -D bs-linux-x64-mainnet /usr/local/bin/bs
There are several config files listed below which need to be set up on the box for fully automatic unattended operation.
/home/bitcoin/bs.cfg
/etc/init/bs.conf
/etc/logrotate.d/bs
Optional for encryption, can be done on PC and results copied:
bx cert-new server.private
Next initialize the blockchain:
bs --initchain
The server can then be started for the first time with:
sudo start bs
To prevent incoming connections, do:
sudo iptables -A INPUT -p tcp -i eth0 --dport 9091 -j REJECT
[node]
blockchain_path = blockchain
history_height = 0
hosts_file = hosts
listen_port = 8333
outbound_connections = 8
tx_pool_capacity = 2000
[server]
query_endpoint = tcp://*:9091
heartbeat_endpoint = tcp://*:9092
block_publish_endpoint = tcp://*:9093
tx_publish_endpoint = tcp://*:9094
publisher_enabled = false
[logging]
debug_file = debug.log
error_file = error.log
log_requests = false
[identity]
# Optional for encryption:
cert_file = server.private
# Our Satoshi node:
peer = bitcoin-sol.airbitz.co:8334
#!upstart
description "libbitcoin-server"
start on (local-filesystems and net-device-up and runlevel [2345])
stop on runlevel [016]
chdir /home/bitcoin
respawn
script
su bitcoin -c "bs bs.cfg > console.log"
end script
pre-stop script
killall -SIGINT bs
end script
/home/bitcoin/debug.log /home/bitcoin/error.log {
rotate 7
daily
sharedscripts
postrotate
restart bs
endscript
}
Users | Developers | License | Copyright © 2011-2015 libbitcoin developers