diff --git a/README.md b/README.md index edb5dd7e23..d62ce6089f 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,31 @@ -

GenesisL1 blockchain

-Cosmos SDK sdk v0.46.15
-Source code fork of cronos and ethermint +# GenesisL1 blockchain -Node requirements: +

+ GenesisL1 +

-
  • 300GB+ good hard drive disk
  • -
  • 8GB+ RAM (if necessary it will be swapped to 150GB from hard drive)
  • -
  • 4 CPU Threads
  • -
  • Good Internet Connection
  • +

    + Cosmos SDK v0.46.15 +

    -Node init/upgrade time is 30-60min or a few tea cups +

    + Source code fork of cronos and ethermint. +

    -
  • Initialization (which will generate a new key):
    -sh genesisd.sh init $YOUR_NEW_NODE_NAME
  • +## Node requirements -
  • Upgrading (for if you already have an existing .genesisd folder and configuration):
    -sh genesisd.sh upgrade
  • +- 300GB+ good hard drive disk +- 8GB+ RAM (if necessary it will use at max 150GB from hard drive as swap, see below) +- 4 CPU Threads +- Good Internet Connection -
  • Upgrading (for if you already have an existing .genesisd folder and configuration, but want a different node name):
    -sh genesisd.sh upgrade $YOUR_NEW_NODE_NAME
  • -Other options: - +## **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.sh ` + + Example: sh swap_add.sh 50 will create a new genesisd_swapfile that is 50GB in size in '/'. + +- **Removing swap** `sh swap_remove.sh ` + + Example: sh swap_remove.sh /genesisd_swapfile_2 turns off swapfile genesisd_swapfile_2, removes the related line in '/etc/fstab' and deletes /genesisd_swapfile_2. + +- **Removing all swaps** `sh swap_remove_all.sh` + + This will turn off all genesis swapfiles, removes all related lines in '/etc/fstab' and deletes all /genesisd_swapfiles diff --git a/genesisd.sh b/genesisd.sh index 278ae73a58..67bbede468 100644 --- a/genesisd.sh +++ b/genesisd.sh @@ -274,7 +274,7 @@ if [ "$1" = "init" ]; then sleep 120s fi - genesisd init $moniker --chain-id genesis_29-2 + genesisd init $moniker --chain-id genesis_29-2 fi #IMPORTING GENESIS STATE diff --git a/genesisd_docs/UPGRADE_29-2_CRONOS.md b/genesisd_docs/UPGRADE_29-2_CRONOS.md new file mode 100644 index 0000000000..9101acca56 --- /dev/null +++ b/genesisd_docs/UPGRADE_29-2_CRONOS.md @@ -0,0 +1,102 @@ +# Chain upgrade: genesis_29-2 (Cronos) + +This readme is a guide on how to upgrade your node from genesis_29-2 (evmos) to genesis_29-2 (cronos) and what you should be paying attention to. + +**IMPORTANT:** Make sure you backup your keys before running the `genesisd.sh` script. Even if it is configured to make a backup of everything, manually doing one yourself is always wise in case anything goes wrong. + +Also, for those who come from genesis_29-2 (evmos), do note that this is a different repository than we used before. The old one was named `genesisd`, this one `genesisL1`. Thus don't skip the first steps if you haven't already git cloned the new repository. + +--- + +###

    1. I am new, I am not a validator yet, but would like to join 🎉

    + +#### Oneliner: + +Make sure to replace in the oneliner below with a name of your choice. + +``` +cd ~ && git clone https://github.com/alpha-omega-labs/genesisL1.git && cd genesisL1 && sh genesisd.sh init --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 init --reset-priv-val-state` + + _replace with a name of your choice_ + + _the --reset-priv-val-state flag is an extra pre-caution to prevent old values to be used in your new node (if you already had a .genesisd folder)._ + +--- + +###

    2. 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 upgrade --reset-priv-val-state and replace with a name of your choice._ + +--- + +###

    3. 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 upgrade --skip-state-download and replace with a name of your choice._ + + _--skip-state-download is not necessary but, as you already upgraded, you probably already have the 14GB genesis.json state file thus speeding up the process._ + +--- + +###

    4. 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`