mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-10-31 18:27:26 +00:00 
			
		
		
		
	Update validator_guide to latest version. (#1161)
* Update validator_guide.md * Update validator_guide.md * Update validator_guide.md
This commit is contained in:
		
							parent
							
								
									c0f71921d9
								
							
						
					
					
						commit
						b3879f2633
					
				| @ -14,7 +14,7 @@ The monthly storage requirements for a node are as follows. These are estimated | |||||||
| - A default pruning node (`pruning = “default”`) grows at a rate of ~25 GB per month | - A default pruning node (`pruning = “default”`) grows at a rate of ~25 GB per month | ||||||
| 
 | 
 | ||||||
| ## Install Go | ## Install Go | ||||||
| Kava is built using Go and requires Go version 1.13+. In this example, you will be installing Go on a fresh install of ubuntu 18.04. | Kava is built using Go and requires Go version 1.17+. In this example, you will be installing Go on a fresh install of ubuntu 20.04. | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| # Update ubuntu | # Update ubuntu | ||||||
| @ -24,9 +24,12 @@ sudo apt upgrade -y | |||||||
| # Install packages necessary to run go and jq for pretty formatting command line outputs | # Install packages necessary to run go and jq for pretty formatting command line outputs | ||||||
| sudo apt install build-essential jq -y | sudo apt install build-essential jq -y | ||||||
| 
 | 
 | ||||||
|  | # Install git | ||||||
|  | sudo apt install git | ||||||
|  | 
 | ||||||
| # Install go | # Install go | ||||||
| wget https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz (or latest version at https://golang.org/dl/) | wget https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz (or latest version at https://golang.org/dl/) | ||||||
| sudo tar -xvf go1.17.1.linux-amd64.tar.gz | sudo tar -xvf go1.17.6.linux-amd64.tar.gz | ||||||
| sudo mv go /usr/local | sudo mv go /usr/local | ||||||
| 
 | 
 | ||||||
| # Updates environmental variables to include go | # Updates environmental variables to include go | ||||||
| @ -41,54 +44,53 @@ source ~/.profile | |||||||
| To verify that Go is installed: | To verify that Go is installed: | ||||||
| ```bash | ```bash | ||||||
| go version | go version | ||||||
| # Should return go version go1.17.1 linux/amd64 | # Should return go version go1.17.6 linux/amd64 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ## Install Kava | ## Install Kava | ||||||
| Install Kava using `git clone`. Note that version 0.15.1 is the correct version for mainnet. | Install Kava using `git clone`. Note that version 0.16.1 is the correct version for mainnet. | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| git clone https://github.com/kava-labs/kava | git clone https://github.com/kava-labs/kava | ||||||
| cd kava | cd kava | ||||||
| git checkout v0.15.1 | git checkout v0.16.1 | ||||||
| make install | make install | ||||||
| ``` | ``` | ||||||
| To verify that kava is installed: | To verify that kava is installed: | ||||||
| ```bash | ```bash | ||||||
| kvd version --long | kava version --long | ||||||
| # name: kava | # name: kava | ||||||
| # server_name: kvd | # server_name: kava | ||||||
| # client_name: kvcli | # version: 0.16.1 | ||||||
| # version: 0.15.1 | # commit: c2257c409659e2a6c1c8907fe5ae596c5e46f19d | ||||||
| # commit: f0c90f0cbf96d230a83cd2309b8fd032e52d7fb933881541472df1bf2703a939 |  | ||||||
| 
 | 
 | ||||||
| # build_tags: netgo,ledger | # build_tags: netgo,ledger | ||||||
| # go: go version go1.15.14 linux/amd64 | # go: go version go1.17.6 linux/amd64 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ## Configuring Your Node | ## Configuring Your Node | ||||||
| Next, download the correct genesis file and sync your node with the Kava mainnet. To download the genesis file: | Next, download the correct genesis file and sync your node with the Kava mainnet. To download the genesis file: | ||||||
| ```bash | ```bash | ||||||
| # First, initialize kvd. Replace <name> with the public name of your node | # First, initialize kava. Replace <name> with the public name of your node | ||||||
| kvd init --chain-id kava-8 <name> | kava init --chain-id kava-9 <name> | ||||||
| # Download the genesis file | # Download the genesis file | ||||||
| wget https://kava-genesis-files.s3.amazonaws.com/kava-8-genesis-migrated-from-block-1878508.json -O ~/.kvd/config/genesis.json | wget https://kava-genesis-files.s3.amazonaws.com/kava-9/genesis.json -O ~/.kava/config/genesis.json | ||||||
| # Verify genesis hash | # Verify genesis hash | ||||||
| jq -S -c -M '' $HOME/.kvd/config/genesis.json | shasum -a 256 | jq -S -c -M '' $HOME/.kava/config/genesis.json | shasum -a 256 | ||||||
| # f0c90f0cbf96d230a83cd2309b8fd032e52d7fb933881541472df1bf2703a939 | # 5c688df5ae6cba9c9e5a9bab045eb367dd54ce9b7f5fab78cf3e636cf2e2b793 | ||||||
| ``` | ``` | ||||||
| Next,  adjust some configurations. To open the config file: | Next,  adjust some configurations. To open the config file: | ||||||
| ```bash | ```bash | ||||||
| vim $HOME/.kvd/config/config.toml | vim $HOME/.kava/config/config.toml | ||||||
| ``` | ``` | ||||||
| At line 160, add [seeds](https://docs.google.com/spreadsheets/d/1TWsD2lMi1idkPI6W9xFCn5W64x75yn9PDjvQaJVkIRk/edit?usp=sharing). These are used to connect to the peer-to-peer network: | At line 212, add [seeds](https://docs.google.com/spreadsheets/d/1j-e1HTkskNRS6mlhxLLQa0loB-ShcVUjz8WVVZxvPaY). These are used to connect to the peer-to-peer network: | ||||||
| 
 | 
 | ||||||
| At line 163, add some [persistent peers](https://docs.google.com/spreadsheets/d/1TWsD2lMi1idkPI6W9xFCn5W64x75yn9PDjvQaJVkIRk/edit?usp=sharing), which help maintain a connection to the peer-to-peer network | At line 215, add some [persistent peers](https://docs.google.com/spreadsheets/d/1j-e1HTkskNRS6mlhxLLQa0loB-ShcVUjz8WVVZxvPaY), which help maintain a connection to the peer-to-peer network | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Next, chose how much historical state you want to store. To open the application config file: | Next, chose how much historical state you want to store. To open the application config file: | ||||||
| ```bash | ```bash | ||||||
| vim $HOME/.kvd/config/app.toml | vim $HOME/.kava/config/app.toml | ||||||
| ``` | ``` | ||||||
| In this file, choose between `default`, `nothing`, and `everything`. To reduce hard drive storage, choose `everything` or `default`. To run an archival node, chose `nothing`. | In this file, choose between `default`, `nothing`, and `everything`. To reduce hard drive storage, choose `everything` or `default`. To run an archival node, chose `nothing`. | ||||||
| ```bash | ```bash | ||||||
| @ -101,14 +103,14 @@ minimum-gas-prices = "0.001ukava" | |||||||
| ### Syncing Your Node | ### Syncing Your Node | ||||||
| To sync your node, you will use systemd, which manages the Kava daemon and automatically restarts it in case of failure. To use systemd, you will create a service file. Be sure to replace `<your_user>` with the user on your server: | To sync your node, you will use systemd, which manages the Kava daemon and automatically restarts it in case of failure. To use systemd, you will create a service file. Be sure to replace `<your_user>` with the user on your server: | ||||||
| ```bash | ```bash | ||||||
| sudo tee /etc/systemd/system/kvd.service > /dev/null <<'EOF' | sudo tee /etc/systemd/system/kavad.service > /dev/null <<'EOF' | ||||||
| [Unit] | [Unit] | ||||||
| Description=Kava daemon | Description=Kava daemon | ||||||
| After=network-online.target | After=network-online.target | ||||||
| 
 | 
 | ||||||
| [Service] | [Service] | ||||||
| User=<your_user> | User=<your_user> | ||||||
| ExecStart=/home/<your_user>/go/bin/kvd start | ExecStart=/home/<your_user>/go/bin/kava start | ||||||
| Restart=on-failure | Restart=on-failure | ||||||
| RestartSec=3 | RestartSec=3 | ||||||
| LimitNOFILE=4096 | LimitNOFILE=4096 | ||||||
| @ -120,69 +122,69 @@ EOF | |||||||
| To start syncing: | To start syncing: | ||||||
| ```bash | ```bash | ||||||
| # Start the node | # Start the node | ||||||
| sudo systemctl enable kvd | sudo systemctl enable kavad | ||||||
| sudo systemctl start kvd | sudo systemctl start kavad | ||||||
| ``` | ``` | ||||||
| To check on the status of syncing: | To check on the status of syncing: | ||||||
| ```bash | ```bash | ||||||
| kvcli status --output json | jq '.sync_info' | kava status --log_format json | jq '.sync_info' | ||||||
| ``` | ``` | ||||||
| This will give output like: | This will give output like: | ||||||
| ```bash | ```bash | ||||||
| { | { | ||||||
| "latest_block_hash": "21D7E37A0A5992E1992DD43E42C05E4475A6E212694F746ABEE132267067847D", |   "latest_block_hash": "03BC172D991C3D66BAAA12A41CAA1A4718C63605B71FD9E0EF09EC38C2DA9F85", | ||||||
| "latest_app_hash": "FBE0E799BCCA57F12F781252787BD6340782E5D45E591294D01269F481B128AC", |   "latest_app_hash": "FBC020AC8258C4854D2D3384E78929384B0BFBA462F948D493E7883AD315B38C", | ||||||
| "latest_block_height": "183566", |   "latest_block_height": "36", | ||||||
| "latest_block_time": "2021-03-22T17:21:41.848445277Z", |   "latest_block_time": "2022-01-19T16:22:18.54790946Z", | ||||||
| "earliest_block_hash": "09E688467E5016159D74CEDE2EE870D671CAA772F76E6697AEEB685A398ACB08", |   "earliest_block_hash": "C124499F70881EC71F41231DAB111F448558C5A7794D044F0613E1509FA4C8DF", | ||||||
| "earliest_app_hash": "", |   "earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", | ||||||
| "earliest_block_height": "1", |   "earliest_block_height": "1", | ||||||
| "earliest_block_time": "2021-03-05T06:00:00Z", |   "earliest_block_time": "2022-01-19T16:00:00Z", | ||||||
| "catching_up": false |   "catching_up": true | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| The main thing to watch is that the block height is increasing. Once you are caught up with the chain, `catching_up` will become false. At that point, you can start using your node to create a validator. If you need to sync using a snapshot, please use https://kava.quicksync.io/ | The main thing to watch is that the block height is increasing. Once you are caught up with the chain, `catching_up` will become false. At that point, you can start using your node to create a validator. If you need to sync using a snapshot, please use https://kava.quicksync.io/ | ||||||
| 
 | 
 | ||||||
| To check the logs of the node: | To check the logs of the node: | ||||||
| ```bash | ```bash | ||||||
| sudo journalctl -u kvd -f | sudo journalctl -u kavad -f | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ## Creating a Validator | ## Creating a Validator | ||||||
| First, create a wallet, which will give you a private key / public key pair for your node. | First, create a wallet, which will give you a private key / public key pair for your node. | ||||||
| ```bash | ```bash | ||||||
| # Replace <your-key-name> with a name for your key that you will remember | # Replace <your-key-name> with a name for your key that you will remember | ||||||
| kvcli keys add <your-key-name> | kava keys add <your-key-name> | ||||||
| # To see a list of wallets on your node | # To see a list of wallets on your node | ||||||
| kvcli keys list | kava keys list | ||||||
| ``` | ``` | ||||||
| **Be sure to write down the mnemonic for your wallet and store it securely. Losing your mnemonic could result in the irrecoverable loss of KAVA tokens.** | **Be sure to write down the mnemonic for your wallet and store it securely. Losing your mnemonic could result in the irrecoverable loss of KAVA tokens.** | ||||||
| 
 | 
 | ||||||
| To see the options when creating a validator: | To see the options when creating a validator: | ||||||
| ```bash | ```bash | ||||||
| kvcli tx staking create-validator -h | kava tx staking create-validator -h | ||||||
| ``` | ``` | ||||||
| An example of creating a validator with 50KAVA self-delegation and 10% commission: | An example of creating a validator with 50KAVA self-delegation and 10% commission: | ||||||
| ```bash | ```bash | ||||||
| # Replace <key_name> with the key you created previously | # Replace <key_name> with the key you created previously | ||||||
| kvcli tx staking create-validator \ | kava tx staking create-validator \ | ||||||
| --amount=50000000ukava \ | --amount=50000000ukava \ | ||||||
| --pubkey=$(kvd tendermint show-validator) \ | --pubkey=$(kava tendermint show-validator) \ | ||||||
| --moniker="choose moniker" \ | --moniker="choose moniker" \ | ||||||
| --website="optional website for your validator" | --website="optional website for your validator" \ | ||||||
| --details="optional details for your validator" | --details="optional details for your validator" \ | ||||||
| --commission-rate="0.10" \ | --commission-rate="0.10" \ | ||||||
| --commission-max-rate="0.20" \ | --commission-max-rate="0.20" \ | ||||||
| --commission-max-change-rate="0.01" \ | --commission-max-change-rate="0.01" \ | ||||||
| --min-self-delegation="1" \ | --min-self-delegation="1" \ | ||||||
| --from=<key_name> \ | --from=<your-key-name> \ | ||||||
| --chain-id=kava-8 \ | --chain-id=kava-9 \ | ||||||
| --gas=auto | --gas=auto \ | ||||||
| --gas-adjustment=1.4 | --gas-adjustment=1.4 | ||||||
| ``` | ``` | ||||||
| To check on the status of your validator: | To check on the status of your validator: | ||||||
| ```bash | ```bash | ||||||
| kvcli status --output json | jq '.validator_info' | kava status --log_format json | jq '.ValidatorInfo' | ||||||
| ``` | ``` | ||||||
| After you have completed this guide, your validator should be up and ready to receive delegations. Note that only the top 100 validators by weighted stake (self-delegations + other delegations) are eligible for block rewards. To view the current validator list, checkout one of the Kava block explorers: | After you have completed this guide, your validator should be up and ready to receive delegations. Note that only the top 100 validators by weighted stake (self-delegations + other delegations) are eligible for block rewards. To view the current validator list, checkout one of the Kava block explorers: | ||||||
| - https://www.mintscan.io/kava | - https://www.mintscan.io/kava | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Blockchain Validator
						Blockchain Validator