@ -1,6 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- { role: config, testnet_name: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" } | |||
@ -0,0 +1,16 @@ | |||
# This is a TOML config file. | |||
# For more information, see https://github.com/toml-lang/toml | |||
proxy_app = "tcp://127.0.0.1:46658" | |||
moniker = "146.185.178.252" | |||
fast_sync = true | |||
db_backend = "leveldb" | |||
log_level = "debug" | |||
[rpc] | |||
laddr = "tcp://0.0.0.0:46657" | |||
[p2p] | |||
laddr = "tcp://0.0.0.0:46656" | |||
seeds = "138.197.154.40:46656,138.68.244.161:46656,128.199.192.199:46656,46.101.41.147:46656,162.243.247.32:46656,207.154.231.86:46656" | |||
@ -0,0 +1,153 @@ | |||
{ | |||
"genesis_time":"2017-06-10T03:24:06Z", | |||
"chain_id":"ball-n-chain", | |||
"validators": | |||
[ | |||
{ | |||
"pub_key":{"type":"ed25519","data":"3D73A11D01B03F8A54694A2291B878123F25C7BFAD6B187ECF0CA059CB6F73C2"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node0" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"5DD43295A0E05872A0CA80CA37D785FED64AF1F2140EB68C111BD114751B4EDB"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node6" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"BDFEE13230E60EB2E3026C8DC158CC0AE29C857507C2B95EC2486B946ECDE6BF"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node4" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"01763737DA0B4C09166DE5496F380665EEF85CDB747F143840BF7E0D1939489F"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node5" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"F40236D218C48DA6EF02BA42D4978F4F7FBE62D068E733CCDE9446B42004A866"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node2" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"93E0A170ADF8D0E6F94AA3C55A076A1574086EADFD7A19EA59911B043F1CE614"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node3" | |||
} | |||
, | |||
{ | |||
"pub_key":{"type":"ed25519","data":"3DE45E9B5BAF01F172E9C72C9876CFAB49AD6823320D0769868C12045E572C6B"}, | |||
"amount":10, | |||
"name":"ball-n-chain-node1" | |||
} | |||
], | |||
"app_hash":"", | |||
"app_options": { | |||
"accounts": [ | |||
{ | |||
"name": "anton", | |||
"address": "40CC622438D3E42148A1FFD3A27C07C100F8FA3D", | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "97BD389257763747488803DC686A8819C685936A3CD275D54EABEE51E0117EE6" | |||
}, | |||
"coins": [ | |||
{ | |||
"denom": "anton", | |||
"amount": 9007199254740992 | |||
}, | |||
{ | |||
"denom": "tank", | |||
"amount": 99 | |||
} | |||
] | |||
}, | |||
{ | |||
"name": "adrian", | |||
"address": "98F28277FA8C512968BBDE443F5DB27AC743F814", | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "2E7EAB9E4C93D3657A63E063D6ABB851596BA97ED9F4EB9A2FC714043DC9685D" | |||
}, | |||
"coins": [ | |||
{ | |||
"denom": "axi", | |||
"amount": 1928936473812 | |||
}, | |||
{ | |||
"denom": "bear", | |||
"amount": 42 | |||
} | |||
] | |||
}, | |||
{ | |||
"name": "bucky", | |||
"address": "2B24DEE2364762300168DF19B6C18BCE2D399EA2", | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "37BF9D6F8D66DC3FAECD330291CF08DF52E2F646B01F7E43BC0A746AED927A62" | |||
}, | |||
"coins": [ | |||
{ | |||
"denom": "buckyball", | |||
"amount": 20000000000 | |||
}, | |||
{ | |||
"denom": "bumblebee", | |||
"amount": 100 | |||
}, | |||
{ | |||
"denom": "french", | |||
"amount": 10 | |||
}, | |||
{ | |||
"denom": "frey", | |||
"amount": 4838271727204 | |||
} | |||
] | |||
}, | |||
{ | |||
"name": "phomer", | |||
"address": "BAA67E0346AF48A05330149A3A72D9B974E9EBD2", | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "F5DF27FD625800D971A9E9B2607F0052480E49A12BE85E17336F773FE6FB9BC9" | |||
}, | |||
"coins": [ | |||
{ | |||
"denom": "antipho", | |||
"amount": 33 | |||
}, | |||
{ | |||
"denom": "pho", | |||
"amount": 8367251830291 | |||
} | |||
] | |||
}, | |||
{ | |||
"name": "shadow", | |||
"address": "B140EFAAE6D5CA1C8E98814C557AF7112E3B9EAE", | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "F492282705DF29ACC3BB803D543B7BF98C8080FA28AE85B62B45827EA9DA8167" | |||
}, | |||
"coins": [ | |||
{ | |||
"denom": "shadow", | |||
"amount": 53712836452781 | |||
}, | |||
{ | |||
"denom": "unit", | |||
"amount": 1 | |||
} | |||
] | |||
} | |||
] | |||
} | |||
} | |||
@ -1,11 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- install-tendermint | |||
- install-basecoin | |||
- cleanupdata | |||
- { role: config, testnet_name: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" } | |||
- { role: start, service: basecoin } | |||
- { role: start, service: tendermint } | |||
@ -1,11 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- install-tendermint | |||
- install-ethermint | |||
- cleanupdata | |||
- { role: config, testnet_name: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" } | |||
- { role: start, service: ethermint } | |||
- { role: start, service: tendermint } | |||
@ -1,9 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- install-tendermint | |||
- cleanupdata | |||
- { role: config, testnet_name: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" } | |||
- { role: start, service: tendermint } | |||
@ -0,0 +1,10 @@ | |||
--- | |||
#variable "service" is required | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- install | |||
- {role: config, testnet_name: "{{lookup('env','TF_VAR_TESTNET_NAME')}}"} | |||
- start | |||
@ -1,3 +0,0 @@ | |||
--- | |||
tendermint_home: /etc/tendermint | |||
@ -1,7 +0,0 @@ | |||
--- | |||
- name: clear tendermint database | |||
file: "path={{tendermint_home}}/{{item}} state=absent" | |||
with_items: | |||
- data | |||
@ -1,9 +1,8 @@ | |||
--- | |||
tendermint_user: tendermint | |||
tendermint_group: tendermint | |||
tendermint_home: /etc/tendermint | |||
#tendermint_genesis_file="<undefined>" | |||
#app_options_file="<undefined>" | |||
#tendermint_genesis_file: "<undefined>" | |||
#service_genesis_file: "<undefined>" | |||
app_options_file: "app_options_files/dev_money" | |||
seeds: "" | |||
testnet_name: testnet1 | |||
validators: true | |||
@ -1,41 +1,44 @@ | |||
--- | |||
- name: generate tendermint keys | |||
shell: "tendermint gen_validator > {{tendermint_home}}/priv_validator.json" | |||
args: | |||
warn: no | |||
creates: "{{tendermint_home}}/priv_validator.json" | |||
- name: secure priv_validator.json | |||
file: "path={{tendermint_home}}/priv_validator.json mode=0400 owner={{tendermint_user}} group={{tendermint_group}}" | |||
- name: gather tendermint public keys | |||
when: tendermint_genesis_file is not defined | |||
command: "jq '.pub_key | .data' {{tendermint_home}}/priv_validator.json" | |||
when: validators == true and tendermint_genesis_file is not defined | |||
command: "jq '.pub_key | .data' /etc/{{service}}/tendermint/priv_validator.json" | |||
register: pubkeys | |||
changed_when: false | |||
- name: register tendermint public keys as host facts | |||
when: tendermint_genesis_file is not defined | |||
when: validators == true and tendermint_genesis_file is not defined | |||
set_fact: "pubkey={{pubkeys.stdout_lines[0]}}" | |||
connection: local | |||
- name: copy generated tendermint genesis.json - genesis_time will be updated | |||
when: tendermint_genesis_file is not defined | |||
template: | |||
src: genesis.json.j2 | |||
dest: "{{tendermint_home}}/genesis.json" | |||
owner: "{{tendermint_user}}" | |||
group: "{{tendermint_group}}" | |||
src: genesis-server.json.j2 | |||
dest: "/etc/{{service}}/tendermint/genesis.json" | |||
owner: "{{service}}" | |||
group: "{{service}}" | |||
- name: copy pre-created genesis.json | |||
- name: copy generated service genesis.json - genesis_time will be updated | |||
when: service_genesis_file is not defined | |||
template: | |||
src: genesis-service.json.j2 | |||
dest: "/etc/{{service}}/genesis.json" | |||
owner: "{{service}}" | |||
group: "{{service}}" | |||
- name: copy pre-created tendermint genesis.json | |||
when: tendermint_genesis_file is defined | |||
copy: "src={{tendermint_genesis_file}} dest={{tendermint_home}}/genesis.json owner={{tendermint_user}} group={{tendermint_group}}" | |||
copy: "src={{tendermint_genesis_file}} dest=/etc/{{service}}/tendermint/genesis.json owner={{service}} group={{service}}" | |||
- name: copy pre-created service genesis.json | |||
when: service_genesis_file is defined | |||
copy: "src={{service_genesis_file}} dest=/etc/{{service}}/genesis.json owner={{service}} group={{service}}" | |||
- name: copy tendermint config.toml | |||
template: | |||
src: config.toml.j2 | |||
dest: "{{tendermint_home}}/config.toml" | |||
owner: "{{tendermint_user}}" | |||
group: "{{tendermint_group}}" | |||
dest: "/etc/{{service}}/tendermint/config.toml" | |||
owner: "{{service}}" | |||
group: "{{service}}" | |||
@ -1,16 +1,19 @@ | |||
# This is a TOML config file. | |||
# For more information, see https://github.com/toml-lang/toml | |||
proxy_app = "tcp://127.0.0.1:46658" | |||
proxy_app = "tcp://127.0.0.1:{{(service == 'basecoin') | ternary('36658','46658')}}" | |||
moniker = "{{inventory_hostname}}" | |||
fast_sync = true | |||
db_backend = "leveldb" | |||
log_level = "debug" | |||
[rpc] | |||
laddr = "tcp://0.0.0.0:46657" | |||
laddr = "tcp://0.0.0.0:{{(service == 'basecoin') | ternary('36657','46657')}}" | |||
[p2p] | |||
laddr = "tcp://0.0.0.0:46656" | |||
{% set comma = joiner(",") %}seeds = "{% for host in groups[testnet_name]|difference(inventory_hostname) %}{{ comma() }}{{hostvars[host]["inventory_hostname"]}}:46656{% endfor %}" | |||
laddr = "tcp://0.0.0.0:{{(service == 'basecoin') | ternary('36656','46656')}}" | |||
{% if validators == true %} | |||
{% set comma = joiner(",") %}seeds = "{% for host in groups[testnet_name]|difference(inventory_hostname) %}{{ comma() }}{{hostvars[host]["inventory_hostname"]}}:{{(service == 'basecoin') | ternary('36656','46656')}}{% endfor %}" | |||
{% else %} | |||
seeds = "{{ seeds | default() }}" | |||
{% endif %} |
@ -0,0 +1,12 @@ | |||
{ | |||
"genesis_time":"{{ansible_date_time.iso8601}}", | |||
"chain_id":"{{testnet_name}}", | |||
"validators": [], | |||
"app_hash":"", | |||
"app_options": { | |||
{% if app_options_file is defined %} | |||
{% include app_options_file %} | |||
{% endif %} | |||
} | |||
} | |||
@ -1,2 +0,0 @@ | |||
[defaults] | |||
roles_path = ../ |
@ -1,12 +0,0 @@ | |||
--- | |||
basecoin_release_install: true | |||
basecoin_download: "https://s3-us-west-2.amazonaws.com/tendermint/binaries/basecoin/v0.5.2/basecoin_0.5.2_linux_amd64.zip" | |||
basecoin_binary: "{{ lookup('env','GOPATH') | default('') }}/bin/basecoin" | |||
basecoin_user: tendermint | |||
basecoin_group: tendermint | |||
basecoin_home: /etc/tendermint | |||
basecoin_log_file: /var/log/basecoin.log | |||
@ -1,11 +0,0 @@ | |||
{ | |||
"address": "1B1BE55F969F54064628A63B9559E7C21C925165", | |||
"priv_key": { | |||
"type": "ed25519", | |||
"data": "C70D6934B4F55F1B7BC33B56B9CA8A2061384AFC19E91E44B40C4BBA182953D1619D3678599971ED29C7529DDD4DA537B97129893598A17C82E3AC9A8BA95279" | |||
}, | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "619D3678599971ED29C7529DDD4DA537B97129893598A17C82E3AC9A8BA95279" | |||
} | |||
} |
@ -1,11 +0,0 @@ | |||
{ | |||
"address": "1DA7C74F9C219229FD54CC9F7386D5A3839F0090", | |||
"priv_key": { | |||
"type": "ed25519", | |||
"data": "34BAE9E65CE8245FAD035A0E3EED9401BDE8785FFB3199ACCF8F5B5DDF7486A8352195DA90CB0B90C24295B90AEBA25A5A71BC61BAB2FE2387241D439698B7B8" | |||
}, | |||
"pub_key": { | |||
"type": "ed25519", | |||
"data": "352195DA90CB0B90C24295B90AEBA25A5A71BC61BAB2FE2387241D439698B7B8" | |||
} | |||
} |
@ -1,5 +0,0 @@ | |||
--- | |||
- name: reload systemd | |||
command: systemctl daemon-reload | |||
@ -1,114 +0,0 @@ | |||
--- | |||
- name: update apt | |||
apt: > | |||
update_cache=yes | |||
cache_valid_time=3600 | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (Ubuntu) | |||
apt: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (RHEL) | |||
yum: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "RedHat" | |||
- name: create group | |||
group: > | |||
name={{basecoin_group}} | |||
state=present | |||
system=yes | |||
register: basecoin_group_created | |||
- name: create user | |||
user: > | |||
home={{basecoin_home}} | |||
name={{basecoin_user}} | |||
group={{basecoin_group}} | |||
system=yes | |||
when: basecoin_group_created|changed | |||
- name: create directory | |||
file: > | |||
path={{basecoin_home}} | |||
state=directory | |||
owner={{basecoin_user}} | |||
group={{basecoin_group}} | |||
mode=0755 | |||
# Check before creating log dir to prevent aggressively overwriting permissions | |||
- name: check for log directory | |||
stat: > | |||
path={{ basecoin_log_file|dirname }} | |||
register: logdir | |||
- name: create log directory if it does not exist | |||
file: > | |||
state=directory | |||
path={{ basecoin_log_file|dirname }} | |||
owner={{ basecoin_user }} | |||
group={{ basecoin_group }} | |||
when: not logdir.stat.exists | |||
- name: touch the log file | |||
file: > | |||
state=touch | |||
path={{ basecoin_log_file }} | |||
owner={{ basecoin_user }} | |||
group={{ basecoin_group }} | |||
changed_when: false | |||
- name: copy and unpack release binary | |||
when: basecoin_release_install|bool | |||
unarchive: > | |||
src={{basecoin_download}} | |||
dest=/usr/local/bin | |||
remote_src=true | |||
mode=0755 | |||
- name: copy compiled binary | |||
when: not basecoin_release_install|bool | |||
copy: > | |||
src={{basecoin_binary}} | |||
dest=/usr/local/bin | |||
mode=0755 | |||
- name: copy upstart script | |||
template: > | |||
src=basecoin.conf.j2 | |||
dest=/etc/init/basecoin.conf | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'upstart'" | |||
- name: copy systemd script | |||
template: > | |||
src=basecoin.systemd.j2 | |||
dest=/etc/systemd/system/basecoin.service | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'systemd'" | |||
notify: | |||
- reload systemd | |||
- name: Create example folder | |||
file: path=/usr/share/basecoin/dev-keys state=directory | |||
- name: Copy example keys | |||
copy: "src={{item}} dest=/usr/share/basecoin/dev-keys/{{item}}" | |||
with_items: | |||
- key.json | |||
- key2.json | |||
@ -1,8 +0,0 @@ | |||
--- | |||
- name: gather OS specific variables | |||
include_vars: "{{ item }}" | |||
with_first_found: | |||
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version}}.yml" | |||
- "{{ ansible_os_family }}.yml" | |||
- include: install.yml | |||
@ -1,15 +0,0 @@ | |||
# Basecoin (Upstart unit) | |||
description "Basecoin" | |||
start on runlevel [2345] | |||
stop on runlevel [!2345] | |||
script | |||
# Use su to become tendermint user non-interactively on old Upstart versions (see http://superuser.com/a/234541/76168) | |||
exec su -s /bin/sh -c 'BCHOME={{basecoin_home}} exec "$0" "$@" >> {{ basecoin_log_file }} 2>&1' {{basecoin_user}} -- /usr/local/bin/basecoin start --without-tendermint | |||
end script | |||
respawn | |||
respawn limit 10 10 | |||
kill timeout 10 |
@ -1,17 +0,0 @@ | |||
[Unit] | |||
Description=Basecoin | |||
Requires=network-online.target | |||
After=network-online.target | |||
[Service] | |||
Environment="BCHOME={{basecoin_home}}" | |||
Restart=on-failure | |||
User={{ basecoin_user }} | |||
Group={{ basecoin_group }} | |||
PermissionsStartOnly=true | |||
ExecStart=/usr/local/bin/basecoin start --without-tendermint | |||
ExecReload=/bin/kill -HUP $MAINPID | |||
KillSignal=SIGINT | |||
[Install] | |||
WantedBy=multi-user.target |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -1,11 +0,0 @@ | |||
--- | |||
ethermint_release_install: true | |||
ethermint_download: "https://s3.eu-central-1.amazonaws.com/ethermint/0.2.0/ethermint_0.2.0_ethermint-linux-amd64.zip" | |||
ethermint_binary: "{{ lookup('env','GOPATH') | default('') }}/bin/ethermint" | |||
ethermint_user: tendermint | |||
ethermint_group: tendermint | |||
ethermint_home: /etc/tendermint | |||
ethermint_log_file: /var/log/ethermint.log | |||
@ -1,5 +0,0 @@ | |||
--- | |||
- name: reload systemd | |||
command: systemctl daemon-reload | |||
@ -1,104 +0,0 @@ | |||
--- | |||
- name: update apt | |||
apt: > | |||
update_cache=yes | |||
cache_valid_time=3600 | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (Ubuntu) | |||
apt: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (RHEL) | |||
yum: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "RedHat" | |||
- name: create group | |||
group: > | |||
name={{ethermint_group}} | |||
state=present | |||
system=yes | |||
register: ethermint_group_created | |||
- name: create user | |||
user: > | |||
home={{ethermint_home}} | |||
name={{ethermint_user}} | |||
group={{ethermint_group}} | |||
system=yes | |||
when: ethermint_group_created|changed | |||
- name: create directory | |||
file: > | |||
path={{ethermint_home}} | |||
state=directory | |||
owner={{ethermint_user}} | |||
group={{ethermint_group}} | |||
mode=0755 | |||
# Check before creating log dir to prevent aggressively overwriting permissions | |||
- name: check for log directory | |||
stat: > | |||
path={{ ethermint_log_file|dirname }} | |||
register: logdir | |||
- name: create log directory if it does not exist | |||
file: > | |||
state=directory | |||
path={{ ethermint_log_file|dirname }} | |||
owner={{ ethermint_user }} | |||
group={{ ethermint_group }} | |||
when: not logdir.stat.exists | |||
- name: touch the log file | |||
file: > | |||
state=touch | |||
path={{ ethermint_log_file }} | |||
owner={{ ethermint_user }} | |||
group={{ ethermint_group }} | |||
changed_when: false | |||
- name: copy and unpack release binary | |||
when: ethermint_release_install|bool | |||
unarchive: > | |||
src={{ethermint_download}} | |||
dest=/usr/local/bin | |||
remote_src=true | |||
mode=0755 | |||
- name: copy compiled binary | |||
when: not ethermint_release_install|bool | |||
copy: > | |||
src={{ethermint_binary}} | |||
dest=/usr/local/bin | |||
mode=0755 | |||
- name: copy upstart script | |||
template: > | |||
src=ethermint.conf.j2 | |||
dest=/etc/init/ethermint.conf | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'upstart'" | |||
- name: copy systemd script | |||
template: > | |||
src=ethermint.systemd.j2 | |||
dest=/etc/systemd/system/ethermint.service | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'systemd'" | |||
notify: | |||
- reload systemd |
@ -1,8 +0,0 @@ | |||
--- | |||
- name: gather OS specific variables | |||
include_vars: "{{ item }}" | |||
with_first_found: | |||
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version}}.yml" | |||
- "{{ ansible_os_family }}.yml" | |||
- include: install.yml | |||
@ -1,15 +0,0 @@ | |||
# Ethermint (Upstart unit) | |||
description "Ethermint" | |||
start on runlevel [2345] | |||
stop on runlevel [!2345] | |||
script | |||
# Use su to become ethermint user non-interactively on old Upstart versions (see http://superuser.com/a/234541/76168) | |||
exec su -s /bin/sh -c 'EMHOME={{ethermint_home}} exec "$0" "$@" >> {{ ethermint_log_file }} 2>&1' {{ ethermint_user }} -- /usr/local/bin/ethermint start | |||
end script | |||
respawn | |||
respawn limit 10 10 | |||
kill timeout 10 |
@ -1,17 +0,0 @@ | |||
[Unit] | |||
Description=Ethermint | |||
Requires=network-online.target | |||
After=network-online.target | |||
[Service] | |||
Environment="EMHOME={{ethermint_home}}" | |||
Restart=on-failure | |||
User={{ ethermint_user }} | |||
Group={{ ethermint_group }} | |||
PermissionsStartOnly=true | |||
ExecStart=/usr/local/bin/ethermint start | |||
ExecReload=/bin/kill -HUP $MAINPID | |||
KillSignal=SIGINT | |||
[Install] | |||
WantedBy=multi-user.target |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -1,12 +0,0 @@ | |||
--- | |||
tendermint_release_install: true | |||
tendermint_download: "https://s3-us-west-2.amazonaws.com/tendermint/binaries/tendermint/v0.10.0/tendermint_0.10.0_linux_amd64.zip" | |||
tendermint_binary: "{{ lookup('env','GOPATH') | default('') }}/bin/tendermint" | |||
tendermint_user: tendermint | |||
tendermint_group: tendermint | |||
tendermint_home: /etc/tendermint | |||
tendermint_log_file: /var/log/tendermint.log | |||
@ -1,5 +0,0 @@ | |||
--- | |||
- name: reload systemd | |||
command: systemctl daemon-reload | |||
@ -1,104 +0,0 @@ | |||
--- | |||
- name: update apt | |||
apt: > | |||
update_cache=yes | |||
cache_valid_time=3600 | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (Ubuntu) | |||
apt: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "Debian" | |||
- name: install deps (RHEL) | |||
yum: > | |||
pkg={{item}} | |||
state=installed | |||
with_items: | |||
- unzip | |||
- jq | |||
when: ansible_os_family == "RedHat" | |||
- name: create group | |||
group: > | |||
name={{tendermint_group}} | |||
state=present | |||
system=yes | |||
register: tendermint_group_created | |||
- name: create user | |||
user: > | |||
home={{tendermint_home}} | |||
name={{tendermint_user}} | |||
group={{tendermint_group}} | |||
system=yes | |||
when: tendermint_group_created|changed | |||
- name: create directory | |||
file: > | |||
path={{tendermint_home}} | |||
state=directory | |||
owner={{tendermint_user}} | |||
group={{tendermint_group}} | |||
mode=0755 | |||
# Check before creating log dir to prevent aggressively overwriting permissions | |||
- name: check for log directory | |||
stat: > | |||
path={{ tendermint_log_file|dirname }} | |||
register: logdir | |||
- name: create log directory if it does not exist | |||
file: > | |||
state=directory | |||
path={{ tendermint_log_file|dirname }} | |||
owner={{ tendermint_user }} | |||
group={{ tendermint_group }} | |||
when: not logdir.stat.exists | |||
- name: touch the log file | |||
file: > | |||
state=touch | |||
path={{ tendermint_log_file }} | |||
owner={{ tendermint_user }} | |||
group={{ tendermint_group }} | |||
changed_when: false | |||
- name: copy and unpack release binary | |||
when: tendermint_release_install|bool | |||
unarchive: > | |||
src={{tendermint_download}} | |||
dest=/usr/local/bin | |||
remote_src=true | |||
mode=0755 | |||
- name: copy compiled binary | |||
when: not tendermint_release_install|bool | |||
copy: > | |||
src={{tendermint_binary}} | |||
dest=/usr/local/bin | |||
mode=0755 | |||
- name: copy upstart script | |||
template: > | |||
src=tendermint.conf.j2 | |||
dest=/etc/init/tendermint.conf | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'upstart'" | |||
- name: copy systemd script | |||
template: > | |||
src=tendermint.systemd.j2 | |||
dest=/etc/systemd/system/tendermint.service | |||
owner=root | |||
group=root | |||
mode=0644 | |||
when: "ansible_service_mgr == 'systemd'" | |||
notify: | |||
- reload systemd |
@ -1,8 +0,0 @@ | |||
--- | |||
- name: gather OS specific variables | |||
include_vars: "{{ item }}" | |||
with_first_found: | |||
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version}}.yml" | |||
- "{{ ansible_os_family }}.yml" | |||
- include: install.yml | |||
@ -1,15 +0,0 @@ | |||
# Tendermint (Upstart unit) | |||
description "Tendermint" | |||
start on (runlevel [2345] and started basecoin) | |||
stop on (runlevel [!2345] and stopping basecoin) | |||
script | |||
# Use su to become tendermint user non-interactively on old Upstart versions (see http://superuser.com/a/234541/76168) | |||
exec su -s /bin/sh -c 'TMHOME={{tendermint_home}} exec "$0" "$@" >> {{ tendermint_log_file }} 2>&1' {{ tendermint_user }} -- /usr/local/bin/tendermint node | |||
end script | |||
respawn | |||
respawn limit 10 10 | |||
kill timeout 10 |
@ -1,17 +0,0 @@ | |||
[Unit] | |||
Description=Tendermint | |||
Requires=network-online.target basecoin.target | |||
After=network-online.target | |||
[Service] | |||
Environment="TMHOME={{tendermint_home}}" | |||
Restart=on-failure | |||
User={{ tendermint_user }} | |||
Group={{ tendermint_group }} | |||
PermissionsStartOnly=true | |||
ExecStart=/usr/local/bin/tendermint node | |||
ExecReload=/bin/kill -HUP $MAINPID | |||
KillSignal=SIGINT | |||
[Install] | |||
WantedBy=multi-user.target |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -1,2 +0,0 @@ | |||
--- | |||
#Placeholder |
@ -0,0 +1,4 @@ | |||
--- | |||
release_install: true | |||
binary: "{{ lookup('env','GOPATH') | default('') }}/bin/{{service}}" | |||
@ -0,0 +1,20 @@ | |||
--- | |||
- name: Add tendermint repository and key on CentOS/RedHat | |||
when: ansible_os_family == "RedHat" | |||
yum_repository: | |||
name: tendermint | |||
baseurl: repo.testnets.interblock.io/centos | |||
ui_repoid_vars: 7 os x86_64 | |||
description: "Tendermint repo" | |||
gpgcheck: yes | |||
gpgkey: repo.testnets.interblock.io/centos/RPM-GPG-KEY-Tendermint | |||
repo_gpgcheck: yes | |||
- name: Install package on CentOS/RedHat | |||
when: ansible_os_family == "RedHat" | |||
yum: pkg={{item}} | |||
with_items: | |||
- unzip | |||
- jq | |||
- {{service}} | |||
@ -0,0 +1,20 @@ | |||
--- | |||
- name: Add repository key on Debian/Ubuntu | |||
when: ansible_os_family == "Debian" | |||
apt_key: | |||
url: http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64/RPM-GPG-KEY-Tendermint | |||
id: 2122CBE9 | |||
- name: Install tendermint repository on Debian/Ubuntu | |||
when: ansible_os_family == "Debian" | |||
apt_repository: | |||
repo: deb http://tendermint-packages.s3-website-us-west-1.amazonaws.com/debian stable main | |||
- name: Install package on Debian/Ubuntu | |||
when: ansible_os_family == "Debian" | |||
apt: pkg={{item}} | |||
with_items: | |||
- unzip | |||
- jq | |||
- {{service}} | |||
@ -0,0 +1,14 @@ | |||
--- | |||
- include: debian.yml | |||
when: ansible_os_family == "Debian" | |||
- include: centos.yml | |||
when: ansible_os_family == "RedHat" | |||
- name: copy compiled binary | |||
when: not release_install|bool | |||
copy: | |||
src: "{{binary}}" | |||
dest: /usr/local/bin | |||
mode: 0755 | |||
@ -0,0 +1,7 @@ | |||
--- | |||
- name: clear tendermint database | |||
file: "path=/etc/{{service}}/tendermint/{{item}} state=absent" | |||
with_items: | |||
- data | |||
@ -1,7 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- { role: start, service: "basecoin" } | |||
- { role: start, service: "tendermint" } | |||
@ -1,7 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- { role: start, service: "ethermint" } | |||
- { role: start, service: "tendermint" } | |||
@ -1,7 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- { role: stop, service: "tendermint"} | |||
- { role: stop, service: "basecoin"} | |||
@ -1,7 +0,0 @@ | |||
--- | |||
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}" | |||
roles: | |||
- { role: stop, service: "tendermint"} | |||
- { role: stop, service: "ethermint"} | |||