Update readme for running validators on separate machine
This commit is contained in:
parent
20b00afa56
commit
8166dee68c
@ -21,7 +21,7 @@
|
|||||||
laconic-so deployment --dir <testnet-deployment-dir> stop
|
laconic-so deployment --dir <testnet-deployment-dir> stop
|
||||||
```
|
```
|
||||||
|
|
||||||
- Fetch the stack in machine where the testnet chain node is running:
|
- Fetch the stack in machine where the testnet chain node was running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||||
@ -56,15 +56,17 @@
|
|||||||
- Copy the example variables file:
|
- Copy the example variables file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml
|
cp ~/cerc/laconicd-stack/playbooks/generate-genesis/generate-genesis-vars.example.yml ~/cerc/laconicd-stack/playbooks/generate-genesis/generate-genesis-vars.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run playbook to use exported state for generating mainnet genesis:
|
- Run playbook to use exported state for generating mainnet genesis:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" -e "early_supports_acc_address=$EARLY_SUPPORTS_ACC_ADDR"
|
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/generate-genesis/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" -e "early_supports_acc_address=$EARLY_SUPPORTS_ACC_ADDR"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Input private key of the existing account that was exported in previous steps when prompted
|
||||||
|
|
||||||
- Genesis file will be generated in output directory along with a file specifying the staking amount
|
- Genesis file will be generated in output directory along with a file specifying the staking amount
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -72,31 +74,42 @@
|
|||||||
ls -l output
|
ls -l output
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Copy over the generated genesis file and staking amount file to the machine where the node is to be run
|
||||||
|
|
||||||
|
- The genesis file will be used to start the node
|
||||||
|
|
||||||
|
- Once the node is running we will publish the genesis file, staking amount file and node address so that it is available to other validators
|
||||||
|
|
||||||
## Run node
|
## Run node
|
||||||
|
|
||||||
- Copy the example variables file if not already done:
|
- Run these steps in a separate machine where the mainnet node is to be run
|
||||||
|
|
||||||
|
- Fetch the stack:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml
|
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||||
```
|
```
|
||||||
|
|
||||||
- Update `~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml` with required values:
|
This command clones the entire repository into the `~/cerc` folder
|
||||||
|
|
||||||
|
- Copy the example variables file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Path to the generated mainnet genesis file
|
cp ~/cerc/laconicd-stack/playbooks/validator/validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml
|
||||||
# Use the absolute path of generated output directory in the previous steps
|
```
|
||||||
genesis_file: "<absolute-path-to-generated-output-dir>/genesis.json"
|
|
||||||
|
|
||||||
# Path to staking-amount.json generated in previous steps
|
- Update `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml` with required values:
|
||||||
staking_amount_file: "<absolute-path-to-generated-output-dir>/staking-amount.json"
|
|
||||||
|
|
||||||
|
```bash
|
||||||
# Set custom moniker for the node
|
# Set custom moniker for the node
|
||||||
cerc_moniker: "LaconicMainnetNode"
|
cerc_moniker: "<your-moniker>"
|
||||||
|
|
||||||
# Set desired key name
|
# Set path to genesis file
|
||||||
key_name: "laconic-validator"
|
genesis_file: "<path-to-generated-genesis-file>"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Keep rest of the values empty
|
||||||
|
|
||||||
- Export the data directory and mainnet deployment directory as environment variables:
|
- Export the data directory and mainnet deployment directory as environment variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -108,14 +121,12 @@
|
|||||||
export MAINNET_DEPLOYMENT_DIR=
|
export MAINNET_DEPLOYMENT_DIR=
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run ansible playbook to submit the gentx and run the node:
|
- Run ansible playbook to set up and start your validator node:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/run-first-validator.yml
|
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/run-validator.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
- Input private key of the existing account that was exported in previous steps when prompted
|
|
||||||
|
|
||||||
- Check logs to ensure that node is running:
|
- Check logs to ensure that node is running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -154,7 +165,7 @@
|
|||||||
- Copy the genesis file to [config](./config) folder:
|
- Copy the genesis file to [config](./config) folder:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/genesis.json ~/cerc/laconicd-stack/config/mainnet-genesis.json
|
cp <absolute-path-to-generated-output-dir>/genesis.json ~/cerc/laconicd-stack/config/mainnet-genesis.json
|
||||||
```
|
```
|
||||||
|
|
||||||
- Copy the staking amount file to [config](./config) folder:
|
- Copy the staking amount file to [config](./config) folder:
|
||||||
|
@ -41,6 +41,9 @@
|
|||||||
# Set custom moniker for the node
|
# Set custom moniker for the node
|
||||||
cerc_moniker: "<your-moniker>"
|
cerc_moniker: "<your-moniker>"
|
||||||
|
|
||||||
|
genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json"
|
||||||
|
staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json"
|
||||||
|
|
||||||
# Set persistent peers (comma-separated list of node IDs and addresses)
|
# Set persistent peers (comma-separated list of node IDs and addresses)
|
||||||
# You can find the list of available peers in https://git.vdb.to/cerc-io/laconicd-stack/src/branch/main/node-addresses.yml
|
# You can find the list of available peers in https://git.vdb.to/cerc-io/laconicd-stack/src/branch/main/node-addresses.yml
|
||||||
cerc_peers: "<node-id>@<node-host>:26656,<node-id>@<node-host>:26656"
|
cerc_peers: "<node-id>@<node-host>:26656,<node-id>@<node-host>:26656"
|
||||||
@ -71,6 +74,8 @@
|
|||||||
|
|
||||||
## Create Validator
|
## Create Validator
|
||||||
|
|
||||||
|
- Run these steps in a machine different from the one where the node is running
|
||||||
|
|
||||||
- Export required env vars:
|
- Export required env vars:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -79,6 +84,9 @@
|
|||||||
|
|
||||||
export DATA_DIRECTORY=<data-directory>
|
export DATA_DIRECTORY=<data-directory>
|
||||||
export MAINNET_DEPLOYMENT_DIR=<mainnet-deployment-dir>
|
export MAINNET_DEPLOYMENT_DIR=<mainnet-deployment-dir>
|
||||||
|
|
||||||
|
# Set the public IP address of the machine where your node is running
|
||||||
|
export NODE_URL="tcp://PUBLIC_IP_ADDRESS:26657"
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run ansible playbook to create validator on running chain:
|
- Run ansible playbook to create validator on running chain:
|
||||||
@ -98,6 +106,8 @@
|
|||||||
|
|
||||||
## Register Your Node
|
## Register Your Node
|
||||||
|
|
||||||
|
- Run these steps in a machine where the node is running
|
||||||
|
|
||||||
- Get your node's address:
|
- Get your node's address:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
- name: Generate Mainnet Genesis File
|
- name: Generate Mainnet Genesis File
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
vars_files:
|
vars_files:
|
||||||
- first-validator-vars.yml
|
- generate-genesis-vars.yml
|
||||||
vars:
|
vars:
|
||||||
data_directory: "{{ lookup('env', 'DATA_DIRECTORY') }}"
|
data_directory: "{{ lookup('env', 'DATA_DIRECTORY') }}"
|
||||||
mainnet_deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}"
|
mainnet_deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}"
|
||||||
@ -104,3 +104,12 @@
|
|||||||
-e "CERC_MONIKER={{ cerc_moniker }}" \
|
-e "CERC_MONIKER={{ cerc_moniker }}" \
|
||||||
-e "CERC_CHAIN_ID={{ cerc_chain_id }}" \
|
-e "CERC_CHAIN_ID={{ cerc_chain_id }}" \
|
||||||
cerc/laconicd:local bash -c "/scripts/create-and-collect-gentx.sh"
|
cerc/laconicd:local bash -c "/scripts/create-and-collect-gentx.sh"
|
||||||
|
|
||||||
|
- name: Update genesis file in output
|
||||||
|
shell: |
|
||||||
|
cp {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/config/genesis.json output/genesis.json
|
||||||
|
|
||||||
|
- name: Clear tmp directory
|
||||||
|
file:
|
||||||
|
path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp"
|
||||||
|
state: absent
|
@ -20,8 +20,8 @@
|
|||||||
fail:
|
fail:
|
||||||
msg: >-
|
msg: >-
|
||||||
Required key files are not defined.
|
Required key files are not defined.
|
||||||
Please set genesis_file and staking_amount_file in validator-vars.yml.
|
Please set genesis_file in validator-vars.yml.
|
||||||
when: not genesis_file or not staking_amount_file
|
when: not genesis_file
|
||||||
|
|
||||||
- name: Fetch laconicd stack
|
- name: Fetch laconicd stack
|
||||||
shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||||
@ -64,12 +64,6 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Copy staking amount file to laconicd-data tmp directory
|
|
||||||
copy:
|
|
||||||
src: "{{ staking_amount_file }}"
|
|
||||||
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/staking-amount.json"
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: Copy genesis file to laconicd-data tmp directory
|
- name: Copy genesis file to laconicd-data tmp directory
|
||||||
copy:
|
copy:
|
||||||
src: "{{ genesis_file }}"
|
src: "{{ genesis_file }}"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
cerc_chain_id: "laconic-mainnet"
|
cerc_chain_id: "laconic-mainnet"
|
||||||
min_gas_price: 0.001
|
min_gas_price: 0.001
|
||||||
cerc_loglevel: "info"
|
cerc_loglevel: "info"
|
||||||
genesis_file: "~/cerc/laconicd-stack/config/mainnet-genesis.json"
|
|
||||||
staking_amount_file: "~/cerc/laconicd-stack/config/staking-amount.json"
|
|
||||||
cerc_moniker: ""
|
cerc_moniker: ""
|
||||||
|
genesis_file: ""
|
||||||
|
staking_amount_file: ""
|
||||||
cerc_peers: ""
|
cerc_peers: ""
|
||||||
|
@ -72,5 +72,5 @@ laconicd genesis validate
|
|||||||
|
|
||||||
chmod 777 $genesis_file_path
|
chmod 777 $genesis_file_path
|
||||||
|
|
||||||
# Update the input genesis file
|
# Clear tmp directory
|
||||||
cp $genesis_file_path $input_genesis_file
|
rm -rf $NODE_HOME/tmp
|
||||||
|
Loading…
Reference in New Issue
Block a user