Last active
November 16, 2016 12:39
-
-
Save drwasho/5bc77d975f8385c719b1d5f6103dc8a2 to your computer and use it in GitHub Desktop.
Config to install an OpenBazaar node via Deploy (deprecated)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
apt_update: true | |
runcmd: | |
# Install dependencies | |
- apt-get install -y htop tree git python2.7 build-essential python-dev libffi-dev libssl-dev python-pip python-setuptools | |
# Create openbazaar user and group | |
- groupadd -f openbazaar | |
- useradd --shell /bin/bash --create-home --home /home/openbazaar -g openbazaar --password $(openssl passwd -salt a -1 "password") openbazaar | |
# Get server repo | |
- git clone https://github.com/OpenBazaar/OpenBazaar-Server.git /home/openbazaar/src | |
# Install virtualenv, create a virtualenv for OB, and install dependencies to it | |
- easy_install pip | |
- pip install virtualenv | |
- virtualenv --python=python2.7 /home/openbazaar/venv | |
- /home/openbazaar/venv/bin/pip install -r /home/openbazaar/src/requirements.txt | |
# Setup firewall. Only let ssh and OB traffic in | |
- ufw disable && ufw enable | |
- ufw default deny incoming | |
- ufw allow 22/tcp | |
- ufw allow 18466/tcp | |
- ufw allow 18469/tcp | |
- ufw allow 18470/tcp | |
- ufw allow 18467/udp | |
# Setup data folder and openbazaar permissions | |
- mkdir -p /home/openbazaar/obdata | |
- chown -R openbazaar:openbazaar /home/openbazaar | |
- chmod -R 760 /home/openbazaar | |
- chmod -R 760 /home/openbazaar/obdata | |
- chmod 640 /home/openbazaar/ob.cfg | |
# Start the service | |
- service openbazaard start | |
write_files: | |
# Config file for OB | |
- path: /home/openbazaar/ob.cfg | |
permissions: 0644 | |
content: | | |
[CONSTANTS] | |
DATA_FOLDER = /home/openbazaar/obdata | |
TRANSACTION_FEE = 20400 | |
RESOLVER = https://resolver.onename.com/ | |
[LIBBITCOIN_SERVERS] | |
mainnet_server1 = tcp://libbitcoin1.openbazaar.org:9091 | |
mainnet_server3 = tcp://libbitcoin3.openbazaar.org:9091 | |
mainnet_server5 = tcp://obelisk.airbitz.co:9091 | |
[LIBBITCOIN_SERVERS_TESTNET] | |
testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091,baihZB[vT(dcVCwkhYLAzah<t2gJ>{3@k?+>T&^3 | |
testnet_server4 = tcp://libbitcoin4.openbazaar.org:9091,<Z&{.=LJSPySefIKgCu99w.L%b^6VvuVp0+pbnOM | |
[AUTHENTICATION] | |
USERNAME = admin | |
PASSWORD = password1 | |
[MAINNET_SEEDS] | |
mainnet_seed2 = seed2.openbazaar.org:8080,8b17082a57d648894a5181cb6e1b8a6f5b3b7e1c347c0671abfcd7deb6f105fe | |
mainnet_seed3 = seed.obcentral.org:8080,f0ff751b27ddaa86a075aa09785c438cd2cebadb8f0f5a7e16f383911322d4ee | |
[TESTNET_SEEDS] | |
testnet_seed1 = seed.openbazaar.org:8080,5b44be5c18ced1bc9400fe5e79c8ab90204f06bebacc04dd9c70a95eaca6e117 | |
# Upstart serivce file to keep OB running all all times | |
- path: /etc/init/openbazaard.conf | |
content: | | |
setuid openbazaar | |
setgid openbazaar | |
chdir /home/openbazaar | |
respawn | |
start on runlevel [2345] | |
stop on runlevel [06] | |
exec /home/openbazaar/venv/bin/python /home/openbazaar/src/openbazaard.py start -a 0.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment