Skip to content

moomanow/TxBitsDeployer

 
 

Repository files navigation

TxBitsDeployer

An Ansible config to help you deploy TxBits in production.

Usage

  1. git clone https://github.com/moomanow/TxBitsDeployer.git
  2. sudo apt-add-repository ppa:ansible/ansible
  3. sudo apt-get update
  4. sudo apt-get install ansible
  5. export LC_ALL="en_US.UTF-8"
  6. export LC_CTYPE="en_US.UTF-8"
  7. sudo dpkg-reconfigure locales cd TxBitsDeployer.git sudo sed -i 's|staging-testnet|production|' playbook/group_vars/production sudo sed -i 's|staging_testnet|production|' playbook/group_vars/production
  8. bootstrap.sh
  9. 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.102   businesscat.staging-testnet-txbits.com
    192.168.56.103       litecat.staging-testnet-txbits.com
    192.168.56.104     grumpycat.staging-testnet-txbits.com
    192.168.56.105        bitcat.staging-testnet-txbits.com
    192.168.56.106       limecat.staging-testnet-txbits.com
    192.168.56.107       longcat.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 192.168.56.0/24
    192.168.56.102   businesscat.staging-testnet-txbits.com
    192.168.56.103       litecat.staging-testnet-txbits.com
    192.168.56.104     grumpycat.staging-testnet-txbits.com
    192.168.56.105        bitcat.staging-testnet-txbits.com
    192.168.56.106       limecat.staging-testnet-txbits.com
    192.168.56.107       longcat.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. 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 && sudo apt-get install opendkim opendkim-tools
  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.

About

An Ansible project to help deploy TxBits in production.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 30.4%
  • Vim Script 27.0%
  • Python 21.7%
  • PLpgSQL 11.3%
  • JavaScript 5.4%
  • DIGITAL Command Language 4.2%