Skip to content

Commit

Permalink
add comdex support
Browse files Browse the repository at this point in the history
  • Loading branch information
husonghua committed Dec 3, 2021
1 parent f7b653a commit bd88e22
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 22 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This repo is to set up the Cosmos-based node. It currently support:

- BitCanna (mainnet)
- Comdex (mainnet)
- Juno (mainnet and testnet)
- Kava (mainnet)
- KiChain (mainnet)
Expand All @@ -16,12 +17,6 @@ You run one playbook and set up a node. For example:

```bash
ansible-playbook -i inventory bitcanna.yml -e "target=bitcanna_mainnet"
ansible-playbook -i inventory juno.yml -e "target=juno_mainnet"
ansible-playbook -i inventory kava.yml -e "target=kava_mainnet"
ansible-playbook -i inventory kichain.yml -e "target=kichain_mainnet"
ansible-playbook -i inventory osmosis.yml -e "target=osmosis_mainnet"
ansible-playbook -i inventory sifchain.yml -e "target=sifchain_betanet"
ansible-playbook -i inventory terra.yml -e "target=terra_mainnet"
```

But before you rush with this easy setup, you probably want to read on so you understand the structure of this Ansible program and all the features it offers.
Expand Down Expand Up @@ -62,6 +57,7 @@ The key Ansible playbook is `<chain>.yml` files. It will set up a fresh node fro

```bash
ansible-playbook -i inventory bitcanna.yml -e "target=bitcanna_mainnet"
ansible-playbook -i inventory bitcanna.yml -e "target=comdex_mainnet"
ansible-playbook -i inventory juno.yml -e "target=juno_mainnet"
ansible-playbook -i inventory kava.yml -e "target=kava_mainnet"
ansible-playbook -i inventory kichain.yml -e "target=kichain_mainnet"
Expand All @@ -78,6 +74,7 @@ Playbooks are:
| -------------- | ----------------------------------------------------------------------------------------- |
| `prepare.yml ` | Prepare the server with node_exporter, promtail, go, cosmovisor, and firewall rules |
| `bitcanna.yml` | Set up Bitcanna node. It includes the general `prepare` task and `bitcanna` specific task |
| `comdex.yml` | Set up Comdex node. It includes the general `prepare` task and `comdex` specific task |
| `juno.yml` | Set up Juno node. It includes the general `prepare` task and `juno` specific task |
| `kava.yml` | Set up Kava node. It includes the general `prepare` task and `kava` specific task |
| `kichain.yml` | Set up KiChain node. It includes the general `prepare` task and `kichain` specific task |
Expand All @@ -103,6 +100,8 @@ Sifchain: Follow instruction [here](https://github.com/Sifchain/sifchain-validat

[BitCanna](docs/bitcanna.md)

[Comdex](docs/comdex.md)

[Juno](docs/juno.md)

[Kava](docs/kava.md)
Expand Down
15 changes: 15 additions & 0 deletions comdex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# - name: Prepare
# hosts: '{{ target }}'
# become: true
# gather_facts: false
# roles:
# - prepare

- name: Install node
hosts: '{{ target }}'
gather_facts: false
roles:
# - standard_node_installation
# - initialize_comdex
- launch_node
1 change: 1 addition & 0 deletions docs/comdex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Comdex
4 changes: 2 additions & 2 deletions docs/kichain.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ kid tx staking delegate kivaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pq8jud7 7000000

```bash
kid tx staking edit-validator \
--commission-rate="0.01" \
--moniker="polkachu.com | 1% fee" \
--commission-rate="0.02" \
--moniker="polkachu.com | 2% fee" \
--chain-id=kichain-2 \
--gas-prices=0.025uxki \
--from=polkachu
Expand Down
35 changes: 35 additions & 0 deletions docs/terra.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## Terra

### Testnet

Create validator

```bash
terrad tx staking create-validator \
--amount=5000000uluna \
--pubkey=$(terrad tendermint show-validator) \
--moniker 'polkachu.com' \
--website "https://polkachu.com" \
--identity "0A6AF02D1557E5B4" \
--details "Polkachu is the trusted staking service provider for blockchain projects. 100% refund for downtime slash. Contact us at hello@polkachu.com" \
--chain-id=bombay-12 \
--from=polkachu \
--commission-max-change-rate "0.01" \
--commission-rate "0.02" \
--commission-max-rate "0.1" \
--min-self-delegation "1" \
--fees=3000uluna \
--from=polkachu
```

Set oracle

```bash
terrad tx oracle set-feeder terra13v9q6pek6cwu4js989d22wl8sdm48j4r9cnrg7 --from=polkachu --chain-id=bombay-12 --fees=3000uluna
```

```bash
npm start vote -- \
--source http://localhost:8532/latest \
--lcd https://lcd.terra.dev \
--chain-id columbus-5 \
--validator terravaloper168epm0dvd6v9kpxjz2x800sad0mq4sm9herwzz \
--password "<password>"
```
10 changes: 10 additions & 0 deletions group_vars/comdex_mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
network: comdex
folder: '.comdex'
daemon: comdex
chain_id: comdex-1
node_version: v0.0.4
repo: https://github.com/comdex-official/comdex.git
genesis: 'https://raw.githubusercontent.com/comdex-official/networks/main/mainnet/comdex-1/genesis.json'
peers: 'f74518ad134630da8d2405570f6a3639954c985f@65.0.173.217:26656,d478882a80674fa10a32da63cc20cae13e3a2a57@43.204.0.243:26656,61d743ea796ad1e1ff838c9e84adb38dfffd1d9d@15.235.9.222:26656,b8468f64788a17dbf34a891d9cd29d54b2b6485d@194.163.178.25:26656,d8b74791ee56f1b345d822f62bd9bc969668d8df@194.163.128.55:36656,81444353d70bab79742b8da447a9564583ed3d6a@164.68.105.248:26656,5b1ceb8110da4e90c38c794d574eb9418a7574d6@43.254.41.56:26656,98b4522a541a69007d87141184f146a8f04be5b9@40.112.90.170:26656,9a59b6dc59903d036dd476de26e8d2b9f1acf466@195.201.195.111:26656'
seeds: 'aef35f45db2d9f5590baa088c27883ac3d5e0b33@3.108.102.92:26656,7ca14a1d156299999eba9c394ca060368022d52f@54.194.178.110:26656,08ab4552a74dd7e211fc79432918d35818a67189@52.69.58.231:26656,449a0f1b7dafc142cf23a1f6166bbbf035edfb10@13.232.85.66:26656,5b27a6d4cf33909c0e5b217789e7455e261941d1@15.222.29.207:26656'
minimum_gas_price: '0.025ucmdx'
32 changes: 32 additions & 0 deletions roles/initialize_comdex/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# - name: Initialize Node
# command: '{{ daemon }} init {{ validator_name }} --chain-id {{ chain_id }} -o'
# environment:
# PATH: '{{ path }}'

# - name: Update minimum gas price on config file
# lineinfile:
# path: '/home/{{ ansible_user }}/{{ folder }}/config/app.toml'
# regexp: 'minimum-gas-prices '
# line: 'minimum-gas-prices = "{{ minimum_gas_price }}"'
# state: present

# - name: Update the config.toml file
# lineinfile:
# path: '/home/{{ ansible_user }}/{{ folder }}/config/config.toml'
# regexp: 'persistent_peers = ""'
# line: 'persistent_peers = "{{ peers }}"'
# state: present

# - name: Download genesis file
# get_url:
# url: '{{ genesis }}'
# dest: '/home/{{ ansible_user }}/{{ folder }}/config/genesis.json'
# mode: '0644'

- name: Update seeds on the config.toml file
lineinfile:
path: '/home/{{ ansible_user }}/{{ folder }}/config/config.toml'
regexp: 'seeds = ""'
line: 'seeds = "{{ seeds }}"'
state: present
7 changes: 0 additions & 7 deletions roles/initialize_osmosis/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
line: 'persistent_peers = "{{ peers }}"'
state: present

- name: Update pruning to everything to save storage
lineinfile:
path: '/home/{{ ansible_user }}/{{ folder }}/config/app.toml'
regexp: 'pruning = "default"'
line: 'pruning = "everything"'
state: present

# launch node
- name: register public ip
uri:
Expand Down
7 changes: 0 additions & 7 deletions roles/initialize_terra/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
line: 'minimum-gas-prices = "{{ minimum_gas_price }}"'
state: present

- name: Update pruning to everything to save storage
lineinfile:
path: '/home/{{ ansible_user }}/{{ folder }}/config/app.toml'
regexp: 'pruning = "default"'
line: 'pruning = "everything"'
state: present

# Launch Node
- name: register public ip
uri:
Expand Down

0 comments on commit bd88e22

Please sign in to comment.