From 61edf606e3fc149cc53b0f5d4aac600a160e38e2 Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Mon, 22 Jan 2024 16:28:07 +0100 Subject: [PATCH] feat: test-6 Signed-off-by: Norman Meier --- README.md | 3 +- testnet/teritori-test-6/README.md | 240 ++++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 testnet/teritori-test-6/README.md diff --git a/README.md b/README.md index 15aa9ea..5f4eeec 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Teritori is a Cosmos SDK based blockchain here to enhance Web3 individuals, comm [*DEPRECATED*] - [teritori-testnet-v2](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-testnet-v2) [*DEPRECATED*] - [teritori-testnet-v3](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-testnet-v3) [*DEPRECATED*] - [teritori-test-4](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-4) -[__ACTIVE__] - [teritori-test-5](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-5) +[*DEPRECATED*] - [teritori-test-5](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-5) +[__ACTIVE__] - [teritori-test-6](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-6) # Mainnet diff --git a/testnet/teritori-test-6/README.md b/testnet/teritori-test-6/README.md new file mode 100644 index 0000000..561ee0d --- /dev/null +++ b/testnet/teritori-test-6/README.md @@ -0,0 +1,240 @@ +# [ACTIVE] + +## Server Configuration + +Here is the configuration of the server we are using: +- No. of CPUs: 2 +- Memory: 2GB +- Disk: 80GB SSD +- OS: Ubuntu 18.04 LTS + +Allow all incoming connections from TCP port 26656 and 26657 + +Notes on the configurations. +1. Multicore is important, regardless the less CPU time usage +2. teritorid uses less than 1GB memory and 2GB should be enough for now. +Once your new server is running, login to the server and upgrade your packages. + + + +## Setup your machine + +If you already have go 1.18+ and packages up to date, you can skip this part and jump to the second section: [Setup the chain](#setup-the-chain) +Make sure your machine is up to date: +```shell +apt update && apt upgrade -y +``` + +Install few packages: +```shell +apt install build-essential git curl gcc make jq -y +``` + +Install Go 1.19+: +```shell +wget -c https://go.dev/dl/go1.19.13.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.13.linux-amd64.tar.gz && rm -rf go1.19.13.linux-amd64.tar.gz +``` + +Setup your environnement (you can skip this part if you already had go installed before): +```shell +echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile +echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile +echo 'export GO111MODULE=on' >> $HOME/.bash_profile +echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile +``` + +Verify the installation: +```shell +go version +#Should return go version go1.19.13 linux/amd64 +``` + +## Setup the chain + +Clone the Teritori repository and install teritorid: +```shell +git clone https://github.com/TERITORI/teritori-chain && cd teritori-chain && git checkout v1.2.0 && make install +``` + +Verify the installation: +```shell +teritorid version +#Should return v1.4.2 +``` + +Init the chain: +```shell +teritorid init --chain-id teritori-test-6 +``` + +Add peers in the config file: +```shell +sed -i.bak 's/persistent_peers =.*/persistent_peers = "0d3cebbae24d9362334b0ed6b1910d6ec106ac4f@51.159.14.164:26656"/' $HOME/.teritorid/config/config.toml +``` + +Download the genesis file: +```shell +wget -O ~/.teritorid/config/genesis.json https://raw.githubusercontent.com/TERITORI/teritori-chain/main/testnet/teritori-test-6/genesis.json +``` + + +## Launch the node + +You have multiple choice for launching the chain, choose the one that you prefer in the below list: +- [Manual](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-6#Manual) +- [Systemctl](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-6#Systemctl) +- [Cosmovisor](https://github.com/TERITORI/teritori-chain/tree/main/testnet/teritori-test-6#Cosmovisor) + +### __Manual__ +- Create a screen and setup limit of files +- Launch the chain +```shell +screen -S teritori +ulimit -n 4096 +teritorid start +``` +You can escape the screen pressing `CTRL + AD` and enter it again using: +```shell +screen -r teritori +``` +### __Systemctl__ +- Create service file +- Enable and launch the service file +- Setup the logs + +```shell +tee </dev/null /etc/systemd/system/teritorid.service +[Unit] +Description=Teritori Cosmos daemon +After=network-online.target + +[Service] +User=$USER +ExecStart=/home/$USER/go/bin/teritorid start +Restart=on-failure +RestartSec=3 +LimitNOFILE=4096 + +[Install] +WantedBy=multi-user.target +EOF +``` + +```shell +systemctl enable teritorid +systemctl daemon-reload +systemctl restart teritorid +``` + +To check the logs: +```shell +journalctl -u teritorid.service -f -n 100 +``` + + +### __Cosmovisor__ +- Install cosmovisor +- Setup environment variables +- Create folders needed for upgrades +- Copy binaries to cosmovisor bin +- Create service file +- Enable and launch the service file +- Setup the logs + +```shell +go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest +``` + +```shell +export DAEMON_NAME=teritorid +export DAEMON_HOME=$HOME/.teritori +source ~/.profile +``` + +```shell +mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin +mkdir -p $DAEMON_HOME/cosmovisor/upgrades +``` + +```shell +cp $HOME/go/bin/teritorid $DAEMON_HOME/cosmovisor/genesis/bin +``` + +```shell +tee </dev/null /etc/systemd/system/teritorid.service +[Unit] +Description=Teritori Daemon (cosmovisor) + +After=network-online.target + +[Service] +User=$USER +ExecStart=/home/$USER/go/bin/cosmovisor start +Restart=always +RestartSec=3 +LimitNOFILE=4096 +Environment="DAEMON_NAME=teritorid" +Environment="DAEMON_HOME=/home/$USER/.teritori" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" +Environment="DAEMON_RESTART_AFTER_UPGRADE=true" +Environment="DAEMON_LOG_BUFFER_SIZE=512" + +[Install] +WantedBy=multi-user.target +EOF +``` + +```shell +systemctl enable teritorid +systemctl daemon-reload +systemctl restart teritorid +``` + +To check the logs: +```shell +journalctl -u teritorid.service -f -n 100 +``` + +Wait for the chain to synchronize with the current block... you can do the next step during this time + +## Setup your account + +Create an account: +```shell +teritorid keys add + ``` + + You can also you `--recover` flag to use an already existed key (but we recommend for security reason to use one key per chain to avoid total loss of funds in case one key is missing) + +Join our [Discord](https://discord.gg/teritori) and request fund on the `Faucet` channel using this command: +```shell +$request +``` + +You can check if you have received fund once your node will be synched using this CLI command: +```shell +teritorid query bank balances --chain-id teritori-test-6 +``` + +Once the fund are received and chain is synchronized you can create your validator: +```shell +teritorid tx staking create-validator \ + --commission-max-change-rate=0.01 \ + --commission-max-rate=0.2 \ + --commission-rate=0.05 \ + --amount 1000000utori \ + --pubkey=$(teritorid tendermint show-validator) \ + --moniker= \ + --chain-id=teritori-test-6 \ + --details="" \ + --security-contact=" + ``` + + +FAQ: Coming soon. + +Join us on [Discord](https://discord.gg/teritori) for Testnet 6 discussions.