cosmos-sdk/networks/remote/terraform-do
Greg Szabo 0e3883f8bf Ansible and Terraform script updates 2018-08-23 14:55:22 -04:00
..
cluster Ansible and Terraform script updates 2018-08-23 14:55:22 -04:00
files Ansible and Terraform script updates 2018-08-23 14:55:22 -04:00
.gitignore Merge PR #1234: Cloud network setup scripts 2018-07-24 06:27:39 +02:00
Makefile networks: clean up & some fixes to prepare for docs (#1986) 2018-08-11 17:10:54 -04:00
README.md networks: clean up & some fixes to prepare for docs (#1986) 2018-08-11 17:10:54 -04:00
main.tf Merge PR #1234: Cloud network setup scripts 2018-07-24 06:27:39 +02:00

README.md

Terraform & Ansible

WARNING: The Digital Ocean scripts are obsolete. They are here because they might still be useful for developers.

Automated deployments are done using Terraform to create servers on Digital Ocean then Ansible to create and manage testnets on those servers.

Prerequisites

  • Install Terraform and Ansible on a Linux machine.
  • Create a DigitalOcean API token with read and write capability.
  • Install the python dopy package (pip install dopy) (This is necessary for the digitalocean.py script for ansible.)
  • Create SSH keys
export DO_API_TOKEN="abcdef01234567890abcdef01234567890"
export TESTNET_NAME="remotenet"
export SSH_PRIVATE_FILE="$HOME/.ssh/id_rsa"
export SSH_PUBLIC_FILE="$HOME/.ssh/id_rsa.pub"

These will be used by both terraform and ansible.

Create a remote network

make remotenet-start

Optionally, you can set the number of servers you want to launch and the name of the testnet (which defaults to remotenet):

TESTNET_NAME="mytestnet" SERVERS=7 make remotenet-start

Quickly see the /status endpoint

make remotenet-status

Delete servers

make remotenet-stop

Logging

You can ship logs to Logz.io, an Elastic stack (Elastic search, Logstash and Kibana) service provider. You can set up your nodes to log there automatically. Create an account and get your API key from the notes on this page, then:

yum install systemd-devel || echo "This will only work on RHEL-based systems."
apt-get install libsystemd-dev || echo "This will only work on Debian-based systems."

go get github.com/mheese/journalbeat
ansible-playbook -i inventory/digital_ocean.py -l remotenet logzio.yml -e LOGZIO_TOKEN=ABCDEFGHIJKLMNOPQRSTUVWXYZ012345