An Ansible project to help deploy TxBits in production.
Shell Vim script Python PLpgSQL JavaScript Nginx DIGITAL Command Language
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
old
playbook
txbits @ d924e9d
.gitmodules
README.md
bootstrap.sh
dbmigrate.sh
dbpopulate.sh
dbwipe.sh
deploy.sh
initial_deploy.sh
rebuild_coins.sh
test.sh
update.sh
valid_env.sh

README.md

TxBitsDeployer

An Ansible config to help you deploy TxBits in production.

Usage

  1. git clone https://github.com/txbits/TxBitsDeployer.git
  2. bootstrap.sh
  3. Continue in one of the two sections below

In development / staging

  1. Set up a virtual machine with 512 MB of ram and 1 core. We recommend VirtualBox for this. *
  2. Install Debian 7.x on it, add your ssh key and clone it into 7 machines
  3. Check the ips of the machines and put them into playbook/group_vars/staging_testnet
  4. On your host set up your hosts file like this:
    192.168.56.107       longcat.staging-testnet-txbits.com
    192.168.56.104     grumpycat.staging-testnet-txbits.com
    192.168.56.106       limecat.staging-testnet-txbits.com
    192.168.56.102   businesscat.staging-testnet-txbits.com
    192.168.56.105        bitcat.staging-testnet-txbits.com
    192.168.56.103       litecat.staging-testnet-txbits.com
    192.168.56.108          mail.staging-testnet-txbits.com
    
    192.168.56.107               staging-testnet-txbits.com
    192.168.56.104       monitor.staging-testnet-txbits.com
    
  5. ./initial_deploy.sh staging_testnet
  • You may be able to do this faster with Vagrant, but we haven't tried doing it yet.

In production

  1. Set up the 7 machines as described above, but this time with a VPS provider. The bitcoin virtual machine might need more storage than the 20GB you get with Digital Ocean for $5/month. Check the current size of the blockchain. Make sure all the machines can talk to each other over a LAN (even though all communication between them is encrypted)
  2. Copy playbook/staging_testnet_hosts to playbook/production_hosts and replace any references to staging_testnet with production
  3. Copy playbook/group_vars/staging_testnet to playbook/group_vars/production if it doesn't already exist
  4. Update the private ips in playbook/group_vars/production
  5. Create a secrets file in playbook/secrets called production.json based on staging_testnet.json
  6. Install the only dependency for gen.py: pip3 install passlib
  7. Run python3 ./gen.py production.json
  8. ./initial_deploy.sh production

Setting up the database

After deploying, you'll need to set up the database in order for the frontend to start up. It should be as simple as:

  1. ./dbmigrate.sh <environment>
  2. ./dbpopulate.sh <environment>

After deploying the database you'll need to restart the frontend and wallet.