Renamed remotenet to sentrynet to match the purpose better.

This commit is contained in:
Greg Szabo 2018-04-24 14:22:19 -04:00
parent 089ce6744c
commit 6ce6b20993
5 changed files with 13 additions and 12 deletions

View File

@ -206,24 +206,24 @@ localnet-stop:
### Remote full-nodes (sentry) using terraform and ansible ### Remote full-nodes (sentry) using terraform and ansible
# Server management # Server management
remotenet-start: sentry-start:
@if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi @if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi
@if ! [ -f $(HOME)/.ssh/id_rsa.pub ]; then ssh-keygen ; fi @if ! [ -f $(HOME)/.ssh/id_rsa.pub ]; then ssh-keygen ; fi
cd networks/remote/terraform && terraform init && terraform apply -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub" cd networks/remote/terraform && terraform init && terraform apply -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub"
@if ! [ -f $(CURDIR)/build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 0 --n 4 --o . ; fi @if ! [ -f $(CURDIR)/build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 0 --n 4 --o . ; fi
cd networks/remote/ansible && ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/digital_ocean.py -l remotenet install.yml cd networks/remote/ansible && ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i inventory/digital_ocean.py -l sentrynet install.yml
@echo "Next step: Add your validator setup in the genesis.json and config.tml files and run \"make server-config\". (Public key of validator, chain ID, peer IP and node ID.)" @echo "Next step: Add your validator setup in the genesis.json and config.tml files and run \"make server-config\". (Public key of validator, chain ID, peer IP and node ID.)"
# Configuration management # Configuration management
remotenet-config: sentry-config:
cd networks/remote/ansible && ansible-playbook -i inventory/digital_ocean.py -l remotenet config.yml -e BINARY=$(CURDIR)/build/tendermint -e CONFIGDIR=$(CURDIR)/build cd networks/remote/ansible && ansible-playbook -i inventory/digital_ocean.py -l sentrynet config.yml -e BINARY=$(CURDIR)/build/tendermint -e CONFIGDIR=$(CURDIR)/build
remotenet-stop: sentry-stop:
@if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi @if [ -z "$(DO_API_TOKEN)" ]; then echo "DO_API_TOKEN environment variable not set." ; false ; fi
cd networks/remote/terraform && terraform destroy -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub" cd networks/remote/terraform && terraform destroy -var DO_API_TOKEN="$(DO_API_TOKEN)" -var SSH_KEY_FILE="$(HOME)/.ssh/id_rsa.pub"
# To avoid unintended conflicts with file names, always add to .PHONY # To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to. # unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: check build build_race dist install check_tools get_tools update_tools get_vendor_deps draw_deps test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt build-linux localnet-start localnet-stop build-docker remotenet-start remotenet-config remotenet-stop .PHONY: check build build_race dist install check_tools get_tools update_tools get_vendor_deps draw_deps test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt build-linux localnet-start localnet-stop build-docker sentry-start sentry-config sentry-stop

View File

@ -26,7 +26,7 @@ Build
export SSH_KEY_FILE="$HOME/.ssh/id_rsa.pub" export SSH_KEY_FILE="$HOME/.ssh/id_rsa.pub"
ansible-playbook -i inventory/digital_ocean.py -l remotenet install.yml ansible-playbook -i inventory/digital_ocean.py -l sentrynet install.yml
# The scripts assume that you have your validator set up already. # The scripts assume that you have your validator set up already.
# You can create the folder structure for the sentry nodes using `tendermint testnet`. # You can create the folder structure for the sentry nodes using `tendermint testnet`.
@ -34,7 +34,7 @@ Build
# Then copy your genesis.json and modify the config.toml as you see fit. # Then copy your genesis.json and modify the config.toml as you see fit.
# Reconfig the sentry nodes with a new BINARY and the configuration files from the build folder: # Reconfig the sentry nodes with a new BINARY and the configuration files from the build folder:
ansible-playbook -i inventory/digital_ocean.py -l remotenet config.yml -e BINARY=`pwd`/build/tendermint -e CONFIGDIR=`pwd`/build ansible-playbook -i inventory/digital_ocean.py -l sentrynet config.yml -e BINARY=`pwd`/build/tendermint -e CONFIGDIR=`pwd`/build
Shipping logs to logz.io Shipping logs to logz.io
------------------------ ------------------------
@ -47,6 +47,6 @@ Logz.io is an Elastic stack (Elastic search, Logstash and Kibana) service provid
apt-get install libsystemd-dev || echo "This will only work on Debian-based systems." apt-get install libsystemd-dev || echo "This will only work on Debian-based systems."
go get github.com/mheese/journalbeat go get github.com/mheese/journalbeat
ansible-playbook -i inventory/digital_ocean.py -l remotenet logzio.yml -e LOGZIO_TOKEN=ABCDEFGHIJKLMNOPQRSTUVWXYZ012345 ansible-playbook -i inventory/digital_ocean.py -l sentrynet logzio.yml -e LOGZIO_TOKEN=ABCDEFGHIJKLMNOPQRSTUVWXYZ012345

View File

@ -1,5 +1,7 @@
--- ---
#Note: You need to add LOGZIO_TOKEN variable with your API key. Like tihs: ansible-playbook -e LOGZIO_TOKEN=ABCXYZ123456
- hosts: all - hosts: all
user: root user: root
any_errors_fatal: true any_errors_fatal: true
@ -7,7 +9,6 @@
vars: vars:
- service: tendermint - service: tendermint
- JOURNALBEAT_BINARY: "{{lookup('env', 'GOPATH')}}/bin/journalbeat" - JOURNALBEAT_BINARY: "{{lookup('env', 'GOPATH')}}/bin/journalbeat"
# - LOGZIO_TOKEN: ABCDEFGHIJKLMNOPQRSTUVWXYZ012345
roles: roles:
- logzio - logzio

View File

@ -7,7 +7,7 @@
mode: 0755 mode: 0755
- name: Copy config - name: Copy config
when: item <= N and ansible_hostname == 'remotenet-node' ~ item when: item <= N and ansible_hostname == 'sentrynet-node' ~ item
copy: copy:
src: "{{CONFIGDIR}}/node{{item}}/" src: "{{CONFIGDIR}}/node{{item}}/"
dest: "/home/{{service}}/.{{service}}/" dest: "/home/{{service}}/.{{service}}/"

View File

@ -6,7 +6,7 @@ variable "DO_API_TOKEN" {
variable "TESTNET_NAME" { variable "TESTNET_NAME" {
description = "Name of the testnet" description = "Name of the testnet"
default = "remotenet" default = "sentrynet"
} }
variable "SSH_KEY_FILE" { variable "SSH_KEY_FILE" {