From d6c6d82360d9d0cd8fcc3efcae9ca66113159250 Mon Sep 17 00:00:00 2001 From: Songhua Hu Date: Tue, 23 Nov 2021 15:06:48 -0800 Subject: [PATCH] Add support for kichain --- README.md | 14 +++++++++-- docs/kichain.md | 27 +++++++++++++++++++++ group_vars/kichain_mainnet.yml | 10 ++++++++ kichain.yml | 15 ++++++++++++ roles/initialize_kichain/tasks/main.yml | 32 +++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 docs/kichain.md create mode 100644 group_vars/kichain_mainnet.yml create mode 100644 kichain.yml create mode 100644 roles/initialize_kichain/tasks/main.yml diff --git a/README.md b/README.md index f2c52fac..603a22a3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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. @@ -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 @@ -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 | @@ -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` | diff --git a/docs/kichain.md b/docs/kichain.md new file mode 100644 index 00000000..021d8abf --- /dev/null +++ b/docs/kichain.md @@ -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 hello@polkachu.com" \ + --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 +``` diff --git a/group_vars/kichain_mainnet.yml b/group_vars/kichain_mainnet.yml new file mode 100644 index 00000000..a42ceebe --- /dev/null +++ b/group_vars/kichain_mainnet.yml @@ -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: '81396d4703a2e3cbd136c7324e4df5686fd48218@35.180.8.214:26656,c597db55d9a609b8b77c3d37ecf1fa9a67117cc0@144.217.82.4:26656,50af457247b59aa558a26a14bd7ac4bf86eeae70@195.201.164.223:26656,81eef39d2ca9a07490857d197423da4ba5e01879@15.188.134.35:26656,5adb5ad6a6fcef624866cefdb551dafdc07f7e78@15.188.198.188:26656,41b321292cbe50c5c30017cc71c404481be0e20b@3.38.12.5:26656' +seeds: '24cbccfa8813accd0ebdb09e7cdb54cff2e8fcd9@51.89.166.197:26656' +minimum_gas_price: '0.025uxki' diff --git a/kichain.yml b/kichain.yml new file mode 100644 index 00000000..409224f3 --- /dev/null +++ b/kichain.yml @@ -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 diff --git a/roles/initialize_kichain/tasks/main.yml b/roles/initialize_kichain/tasks/main.yml new file mode 100644 index 00000000..8b06625f --- /dev/null +++ b/roles/initialize_kichain/tasks/main.yml @@ -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