forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
networks: clean up & some fixes to prepare for docs (cosmos#1986)
* networks: update ports * networks: organize some files, convert rst to md * networks: rm old readme * networks: more little fixes
- Loading branch information
1 parent
1479a35
commit 69dd371
Showing
8 changed files
with
126 additions
and
204 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Terraform & Ansible | ||
|
||
Automated deployments are done using [Terraform](https://www.terraform.io/) to create servers on AWS then | ||
[Ansible](http://www.ansible.com/) to create and manage testnets on those servers. | ||
|
||
## Prerequisites | ||
|
||
- Install [Terraform](https://www.terraform.io/downloads.html) and [Ansible](http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) on a Linux machine. | ||
- Create an [AWS API token](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) with EC2 create capability. | ||
- Create SSH keys | ||
|
||
``` | ||
export AWS_ACCESS_KEY_ID="2345234jk2lh4234" | ||
export AWS_SECRET_ACCESS_KEY="234jhkg234h52kh4g5khg34" | ||
export TESTNET_NAME="remotenet" | ||
export CLUSTER_NAME= "remotenetvalidators" | ||
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 | ||
|
||
``` | ||
SERVERS=1 REGION_LIMIT=1 make validators-start | ||
``` | ||
|
||
The testnet name is what's going to be used in --chain-id, while the cluster name is the administrative tag in AWS for the servers. The code will create SERVERS amount of servers in each availability zone up to the number of REGION_LIMITs, starting at us-east-2. (us-east-1 is excluded.) The below BaSH script does the same, but sometimes it's more comfortable for input. | ||
|
||
``` | ||
./new-testnet.sh "$TESTNET_NAME" "$CLUSTER_NAME" 1 1 | ||
``` | ||
|
||
## Quickly see the /status endpoint | ||
|
||
``` | ||
make validators-status | ||
``` | ||
|
||
## Delete servers | ||
|
||
``` | ||
make validators-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](https://app.logz.io/#/dashboard/data-sources/Filebeat), 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 | ||
``` | ||
|
||
## Monitoring | ||
|
||
You can install the DataDog agent with: | ||
|
||
``` | ||
make datadog-install | ||
``` |
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 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](https://www.terraform.io/) to create servers on Digital Ocean then | ||
[Ansible](http://www.ansible.com/) to create and manage testnets on those servers. | ||
|
||
## Prerequisites | ||
|
||
- Install [Terraform](https://www.terraform.io/downloads.html) and [Ansible](http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) on a Linux machine. | ||
- Create a [DigitalOcean API token](https://cloud.digitalocean.com/settings/api/tokens) 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](https://app.logz.io/#/dashboard/data-sources/Filebeat), 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 | ||
``` |
This file was deleted.
Oops, something went wrong.