An Ansible config to help you deploy TxBits in production.
- git clone https://github.com/moomanow/TxBitsDeployer.git
- sudo apt-add-repository ppa:ansible/ansible
- sudo apt-get update
- sudo apt-get install ansible
- export LC_ALL="en_US.UTF-8"
- export LC_CTYPE="en_US.UTF-8"
- 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
bootstrap.sh
- Continue in one of the two sections below
- Set up a virtual machine with 512 MB of ram and 1 core. We recommend VirtualBox for this. *
- Install Debian 7.x on it, add your ssh key and clone it into 7 machines
- Check the ips of the machines and put them into
playbook/group_vars/staging_testnet
- 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
./initial_deploy.sh staging_testnet
- You may be able to do this faster with Vagrant, but we haven't tried doing it yet.
- 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)
- Copy
playbook/staging_testnet_hosts
toplaybook/production_hosts
and replace any references tostaging_testnet
withproduction
- Copy
playbook/group_vars/staging_testnet
toplaybook/group_vars/production
if it doesn't already exist - Update the private ips in
playbook/group_vars/production
192.168.56.0/24192.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
- Create a secrets file in
playbook/secrets
calledproduction.json
based onstaging_testnet.json
- Install the only dependency for gen.py:
pip3 install passlib && sudo apt-get install opendkim opendkim-tools
- Run
python3 ./gen.py production.json
./initial_deploy.sh production
After deploying, you'll need to set up the database in order for the frontend to start up. It should be as simple as:
./dbmigrate.sh <environment>
./dbpopulate.sh <environment>
After deploying the database you'll need to restart the frontend
and wallet
.