diff --git a/README.md b/README.md index edb5dd7e23..d62ce6089f 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,31 @@ -
+ +
-+ Cosmos SDK v0.46.15 +
-Node init/upgrade time is 30-60min or a few tea cups ++ Source code fork of cronos and ethermint. +
-sh genesisd.sh init $YOUR_NEW_NODE_NAME
sh genesisd.sh upgrade
sh genesisd.sh upgrade $YOUR_NEW_NODE_NAME
+## **Script**
+
+### Overview
+
+`genesisd.sh` is available in the root folder of the repository. Running `sh genesisd.sh` gives an overview of what the script is capable of.
+
+```
Usage: genesisd.sh [moniker]
should be either 'upgrade' or 'init'
@@ -30,4 +35,57 @@ Usage: genesisd.sh [moniker]
--reset-priv-val-state Resets data/priv_validator_state.json file [UNSAFE] (default: false)
--no-service This prevents the genesisd service from being made (default: false)
--no-start This prevents the genesisd service from starting at the end of the script (default: false)
-
+```
+
+### Usage
+
+- **Initialization (new validators; generates a new key)**
+
+ `sh genesisd.sh init $YOUR_NEW_NODE_NAME`
+
+- **Upgrading (existing validators; you already have an existing .genesisd folder and configuration)**
+
+ `sh genesisd.sh upgrade`
+
+ _--if you want a different node name you could use `sh genesisd.sh upgrade $YOUR_NEW_NODE_NAME`_
+
+ _--more detailed guides for specific upgrades could be found in the [\/genesisd_docs](genesisd_docs/)-folder_
++ ☕ node init/upgrade time is 30-60min or a few tea cups... +
+ +--- + +### Information + +#### Swap + +Initializing a node uses quite a bit of memory. The script therefore automatically creates virtual memory (swap) to compensate for the amount it requires to start the node. Currently the script is set to automatically calculate how much RAM + Swap is available. Then, whether the user has enough disk space, creates additional swap to have a total of 150GB available RAM + Swap (Example: if 32GB RAM is unused and 30GB of swap is free, an additional swap of 88GB will be created). These swapfiles are formatted as `genesisd_swapfile_{number}` and are made persistent across reboots by adding a line to the `etc/fstab` file. See the bonus scripts for more info on how to properly add or remove them. + +#### Backups + +If a `.genesisd` folder already exists, the script will back this up to a folder formatted as `.genesisd_backup_{date_time}`. This is a unique name based on the system's current time. Therefore running the script multiple times will continue to create new backup folders. + +Since our state file is large this would mean that it will be around ~14GB every time a backup is made. Make sure to remove older backup folders if you plan on running the script more often (testing purposes for instance). They're hidden folders in the root folder; use `cd ~` then `ls -a` to see them. + +## **Other (bonus) scripts** + +There are some extra scripts in the `genesisd_scripts` folder, which could be useful later down the line. + +### Swap scripts + +Since the node requires quite some memory usage, swapfiles are created when you run the genesisd.sh script. To alter these swap files we've included scripts to quickly add or remove genesisd_swapfiles. + +- **Adding swap** `sh swap_add.sh1. I am new, I am not a validator yet, but would like to join 🎉
+ +#### Oneliner: + +Make sure to replace2. I am a validator and I NEVER upgraded to the 'cronos' version of GenesisL1 🥱
+ +This means that you still use the `genesisd` repository and not the `genesisL1` repository. If this is the case, then: + +#### Oneliner: + +``` +cd ~ && git clone https://github.com/alpha-omega-labs/genesisL1.git && cd genesisL1 && sh genesisd.sh upgrade --reset-priv-val-state +``` + +#### Or, step-by-step: + +1. `cd ~` +2. `git clone https://github.com/alpha-omega-labs/genesisL1.git` +3. `cd genesisL1` +4. `sh genesisd.sh upgrade --reset-priv-val-state` + + _in case you want to change your node's name, you could also run sh genesisd.sh upgrade3. I am a validator and I HAVE upgraded to the 'cronos' version of GenesisL1 😎
+ +#### Oneliner: + +``` +cd ~ && rm -r genesisL1 && git clone https://github.com/alpha-omega-labs/genesisL1.git && cd genesisL1 && sh genesisd.sh upgrade --skip-state-download +``` + +#### Or, step-by-step: + +1. `cd ~` +2. `rm -r genesisL1` +3. `git clone https://github.com/alpha-omega-labs/genesisL1.git` +4. `cd genesisL1` +5. `sh genesisd.sh upgrade --skip-state-download` + + _in case you want to change your node's name, you could also run sh genesisd.sh upgrade4. I am a validator and I HAVE upgraded to the 'cronos' version of GenesisL1, but prefer to upgrade manually 🤓
+ +For advanced users only. You know who you are. Take note of what exactly happens in the oneliner or step-by-step guide. Important to know is that the `priv_validator_state.json` shouldn't date back to when we were at 29-2 (evmos), else you will not be able to participate properly in the consensus. Your `priv_validator_state.json`-file would then point to a block height that's, at the time of writing, in the future (probably to 6751398 or 6751399). If you're one of these people then you should skip the backup and restore of the `priv_validator_state.json`-file in the commands below. + +_The commands below don't take care of this for it's too user-specific, but make sure that your config.toml and app.toml are up-to-date. If you participated in the cronos upgrade and already copied over the config files in the `/genesisd_config/` folder or used the `genesisd.sh` script back then, then you're good, else you should check the folder to see what the config files are supposed to look like. Do not forget to restore your moniker and any other settings you had if you end up using these pre-configured files._ + +#### Oneliner: + +``` +cd ~ && rm -r genesisL1 && git clone https://github.com/alpha-omega-labs/genesisL1.git && service genesisd stop && cd genesisL1 && go mod tidy && make install && cd ~/.genesisd && cp ./data/priv_validator_state.json ./priv_validator_state.json && genesisd tendermint unsafe-reset-all && mv ./priv_validator_state.json ./data/priv_validator_state.json && service genesisd start +``` + +#### Or, step-by-step: + +1. `cd ~` +2. `rm -r genesisL1` +3. `git clone https://github.com/alpha-omega-labs/genesisL1.git` +4. `service genesisd stop` +5. `cd genesisL1` +6. `go mod tidy` +7. `make install` +8. `cd ~/.genesisd` +9. `cp ./data/priv_validator_state.json ./priv_validator_state.json` +10. `genesisd tendermint unsafe-reset-all` +12. `mv ./priv_validator_state.json ./data/priv_validator_state.json` +13. `service genesisd start`