forked from alpha-omega-labs/genesis-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from zenodeapp/tgenesis-v1.0.0
tgenesis v1.0.0
- Loading branch information
Showing
93 changed files
with
3,222 additions
and
1,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,137 @@ | ||
# GenesisL1 blockchain | ||
<h1 align="center"> | ||
GenesisL1 Testnet (Cronos fork) | ||
</h1> | ||
|
||
<p align="center"> | ||
<img src="https://github.com/zenodeapp/genesisL1/assets/108588903/be368fa2-a154-48a6-b04b-8eb452b02033" alt="GenesisL1" width="150" height="150"/> | ||
<ins>Release <b>v1.0.0</b> ~ Cronos <b>v1.0.15</b></ins> | ||
</p> | ||
|
||
<p align="center"> | ||
Cosmos SDK v0.46.15 | ||
<img src="https://raw.githubusercontent.com/alpha-omega-labs/genesis-parameters/main/assets/l1-logo.png" alt="GenesisL1" width="150" height="150"/> | ||
</p> | ||
|
||
<p align="center"> | ||
<i>Source code fork of cronos and ethermint.</i> | ||
Chain ID <b>tgenesis_290-1</b> | ||
</p> | ||
|
||
<p align="center"> | ||
A source code fork of <b>Cronos</b> and <b>Ethermint</b> | ||
</p> | ||
|
||
<p align="center"> | ||
Cosmos SDK <b>v0.46.15</b> | ||
</p> | ||
|
||
--- | ||
|
||
> [!IMPORTANT] | ||
> **For full-node syncing** | ||
> | ||
> We were an Evmos-fork before we made the decision to hard fork to Cronos. Therefore if you do not want to **state sync**, but wish to sync a **full node**, follow the instructions in the [`genesis-ethermint`](https://github.com/alpha-omega-labs/genesis-ethermint) repository first before continuing. | ||
## Node requirements | ||
|
||
- 300GB+ good hard drive disk | ||
- 8GB+ RAM (if necessary it will use at max 150GB from hard drive as swap, see below) | ||
- 8GB+ RAM | ||
- 4 CPU Threads | ||
- Good Internet Connection | ||
|
||
## **Script** | ||
## Instructions | ||
|
||
The instructions provided here will only be suitable for those who would like to join the **public** testnet: `tgenesis_290-1` by **setting up a new node** _or_ **upgrading an existing (full) node**. If you instead want to _test_ **locally**, see the [README](/setup-local/README.md) in the [/setup-local](/setup-local)-folder. | ||
|
||
### Overview | ||
> [!NOTE] | ||
> More details for every script mentioned in this README can be found in the folders where they are respectively stored: [/setup](/setup), [/setup-local](/setup-local) or [/utils](/utils). | ||
`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. | ||
### 1. Cloning the repository | ||
|
||
``` | ||
Usage: genesisd.sh <command> [moniker] | ||
<command> should be either 'upgrade' or 'init' | ||
git clone https://github.com/alpha-omega-labs/genesis-crypto.git | ||
``` | ||
|
||
### 2. Checkout the right tag/branch | ||
|
||
Options: | ||
--crisis-skip Makes sure that genesisd starts with the --x-crisis-skip-assert-invariants flag (default: false) | ||
--skip-state-download Skips downloading the genesis.json file, only do this if you're certain to have the correct state file already (default: false) | ||
--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) | ||
``` | ||
git checkout v1.0.0-t | ||
``` | ||
|
||
### Usage | ||
### 3. Node setup | ||
|
||
- **Initialization (new validators; generates a new key)** | ||
Depending on your circumstances, you'll either have to **Setup a node _(using state sync)_** or **Upgrade a node**. | ||
|
||
`sh genesisd.sh init $YOUR_NEW_NODE_NAME` | ||
#### 3.1 Setup a node _(using state sync)_ | ||
|
||
- **Upgrading (existing validators; you already have an existing .genesisd folder and configuration)** | ||
This script takes care of the needed steps to join the network via _state sync_. | ||
|
||
`sh genesisd.sh upgrade` | ||
> [!WARNING] | ||
> Running this will **wipe the entire database** (the _/data_-folder **excluding** the priv_validator_state.json file). Therefore if you already have a node set up and you prefer not to have your GenesisL1 database lost, create a backup. | ||
> | ||
> You could use [utils/backup/create.sh](/utils/backup/create.sh) for this. | ||
_--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_ | ||
<br> | ||
``` | ||
sh setup/state-sync.sh <moniker> | ||
``` | ||
|
||
<p align="center"> | ||
☕ <i>node init/upgrade time is 30-60min or a few tea cups...</i> | ||
</p> | ||
#### 3.2 Upgrade a node | ||
|
||
--- | ||
This script assumes that you are currently operating on the Evmos fork of GenesisL1 (repo: [`genesis-ethermint`](https://github.com/alpha-omega-labs/genesis-ethermint)) and the node synced till height: `insert_height_here` which caused it to panic. | ||
|
||
### Information | ||
> [!IMPORTANT] | ||
> This should only be used if you run a **full-node** and have to perform the **"plan_crypto"**-upgrade. | ||
#### Swap | ||
``` | ||
sh setup/upgrade.sh | ||
``` | ||
|
||
### 4. Daemon check | ||
|
||
If you can't access the `tgenesisd` command at this point, then you may need to execute: | ||
|
||
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. | ||
``` | ||
. ~/.bashrc | ||
``` | ||
> Or the equivalent: `source ~/.bashrc` | ||
### 5. Create or import a key (optional) | ||
|
||
A key is necessary to interact with the network/node. If you haven't already created one, either import one or generate a new one, using: | ||
|
||
``` | ||
sh utils/key/create.sh <key_alias> | ||
``` | ||
|
||
#### Backups | ||
OR | ||
|
||
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. | ||
``` | ||
sh utils/key/import.sh <key_alias> <private_eth_key> | ||
``` | ||
|
||
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. | ||
> _<private_eth_key>_ is the private key for a (wallet) address you already own. | ||
## **Other (bonus) scripts** | ||
### 6. Node syncing | ||
|
||
There are some extra scripts in the `genesisd_scripts` folder, which could be useful later down the line. | ||
If everything went well, you should now be able to run your node using: | ||
|
||
### Swap scripts | ||
``` | ||
systemctl start tgenesisd | ||
``` | ||
|
||
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. | ||
and see its status with: | ||
|
||
- **Adding swap** `sh swap_add.sh <amount_of_swap_in_gb>` | ||
``` | ||
journalctl -fu tgenesisd -ocat | ||
``` | ||
|
||
Example: sh swap_add.sh 50 will create a new genesisd_swapfile that is 50GB in size in '/'. | ||
### 7. Become a validator (optional) | ||
|
||
- **Removing swap** `sh swap_remove.sh <filename>` | ||
Once your node is _up-and-running_, _fully synced_ and you have a _key_ created or imported, you could become a validator using: | ||
|
||
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. | ||
``` | ||
sh setup/create-validator.sh <moniker> <key_alias> | ||
``` | ||
> This is a wizard and shall prompt the user only the required fields to create an on-chain validator. | ||
- **Removing all swaps** `sh swap_remove_all.sh` | ||
### 8. Explore utilities (optional) | ||
|
||
This will turn off all genesis swapfiles, removes all related lines in '/etc/fstab' and deletes all /genesisd_swapfiles | ||
> [!TIP] | ||
> The [/utils](/utils)-folder contains useful utilities one could use to manage their node (e.g. for fetching latest seeds and peers, fetching the genesis state, quickly shifting your config's ports, recalibrating your state sync etc.). To learn more about these, see the [README](utils/README.md) in the folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.