Skip to content

Commit

Permalink
Add support for kichain
Browse files Browse the repository at this point in the history
  • Loading branch information
husonghua committed Nov 23, 2021
1 parent c867559 commit d6c6d82
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repo is to set up the Cosmos-based node. It currently support:
- Sifchain (betanet and testnet)
- Kava (mainnet)
- BitCanna (mainnet)
- KiChain (mainnet)
- Evmos (testnet)

## Summary
Expand All @@ -17,6 +18,7 @@ ansible-playbook -i inventory juno.yml -e "target=juno_mainnet"
ansible-playbook -i inventory sifchain.yml -e "target=sifchain_betanet"
ansible-playbook -i inventory kava.yml -e "target=kava_mainnet"
ansible-playbook -i inventory bitcanna.yml -e "target=bitcanna_mainnet"
ansible-playbook -i inventory kichain.yml -e "target=kichain_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 @@ -60,6 +62,7 @@ ansible-playbook -i inventory juno.yml -e "target=juno_mainnet"
ansible-playbook -i inventory sifchain.yml -e "target=sifchain_betanet"
ansible-playbook -i inventory kava.yml -e "target=kava_mainnet"
ansible-playbook -i inventory bitcanna.yml -e "target=bitcanna_mainnet"
ansible-playbook -i inventory kichain.yml -e "target=kichain_mainnet"
```

If you prefer to install the node manually, you can run a 'prepare' playbook to set up a server for a cosmo-based chain without installing the node itself.
Expand All @@ -73,13 +76,17 @@ Playbooks are:
| `sifchain.yml` | Set up Sifchain node. It includes the general `prepare` task and `sifchain` specific task |
| `kava.yml` | Set up Kava node. It includes the general `prepare` task and `kava` specific task |
| `bitcanna.yml` | Set up Bitcanna node. It includes the general `prepare` task and `bitcanna` specific task |
| `kichain.yml` | Set up KiChain node. It includes the general `prepare` task and `kichain` specific task |

## Additional Info

When you install a node that has upgrades in the past, you can either sync from Block 1, or use a snapshot to time-travel to the present quickly. We strongly recommend using snapshots. It will save you time of syncing and debugging. Here are a list of trusted snapshot providers. Do your own research and make sure that you can trust the snapshot providers:

- Various chains: https://www.chainlayer.io/quicksync/
- Sifchain: see https://github.com/Sifchain/sifchain-validators/blob/master/docs/setup/standalone/manual.md
Kava: Snapshot is [here](https://www.chainlayer.io/quicksync/)

Sifchain: Follow instruction [here](https://github.com/Sifchain/sifchain-validators/blob/master/docs/setup/standalone/manual.md)

KiChain: Follow instruction [here](https://mzonder.notion.site/KiChain-2-Mainnet-Clean-Install-b20ce6400131499f854abc7567ce3b3f). In fact, we cannot make it work with the peers listed when we tried to sync from Block 1. The only way we made it work is by syncing with the snapshot from the included link.

## Some Useful Commands

Expand All @@ -93,6 +100,8 @@ When you install a node that has upgrades in the past, you can either sync from

[Sifchain](docs/sifchain.md)

[KiChain](docs/kichain.md)

## Please stake with our validators

| Network | Validator |
Expand All @@ -101,3 +110,4 @@ When you install a node that has upgrades in the past, you can either sync from
| Juno | `junovaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pvzc6k3` |
| Kava | `kavavaloper125s8t5c6ypwee7ytun90lnhgpls2zl3vta43aj` |
| Sifchain | `sifvaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pfj2j90` |
| KiChain | `kivaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pq8jud7` |
27 changes: 27 additions & 0 deletions docs/kichain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Kichain

create validator

```bash
kid tx staking create-validator \
--amount=5000000uxki \
--commission-max-change-rate=0.01 \
--commission-max-rate=0.1 \
--commission-rate=0 \
--min-self-delegation=1 \
--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 [email protected]" \
--pubkey `kid tendermint show-validator` \
--moniker="polkachu.com | 0% fee" \
--chain-id=kichain-2 \
--gas-prices=0.025uxki \
--from=polkachu
```

```bash
kid tx staking delegate kivaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pq8jud7 70000000uxki \
--chain-id=kichain-2 \
--gas-prices=0.025uxki \
--from=polkachu
```
10 changes: 10 additions & 0 deletions group_vars/kichain_mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
network: kichain
folder: '.kid'
daemon: kid
chain_id: kichain-2
node_version: '2.0.1'
repo: https://github.com/KiFoundation/ki-tools.git
genesis: 'https://github.com/KiFoundation/ki-networks/raw/v0.1/Mainnet/kichain-2/genesis.json'
peers: '[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656'
seeds: '[email protected]:26656'
minimum_gas_price: '0.025uxki'
15 changes: 15 additions & 0 deletions kichain.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_kichain
- launch_node
32 changes: 32 additions & 0 deletions roles/initialize_kichain/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: Download genesis file
get_url:
url: '{{ genesis }}'
dest: '/home/{{ ansible_user }}/{{ folder }}/config/genesis.json'
mode: '0644'

- 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 seeds on the config.toml file
lineinfile:
path: '/home/{{ ansible_user }}/{{ folder }}/config/config.toml'
regexp: 'seeds = ""'
line: 'seeds = "{{ seeds }}"'
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

0 comments on commit d6c6d82

Please sign in to comment.