Coder Social home page Coder Social logo

xiti922 / cht Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chronicnetwork/cht

0.0 0.0 0.0 1021 KB

Official Repo of Chronic Chain v1.1

License: Other

Shell 0.17% JavaScript 0.01% Go 5.41% TypeScript 94.22% Makefile 0.11% HTML 0.01% Vue 0.03% Dockerfile 0.05%

cht's Introduction

CHT MAINNET MOROCCO-1

Hardware Requirements

  • Minimal
    • 4 GB RAM
    • 100 GB SSD
    • 3.2 x4 GHz CPU
  • Recommended
    • 8 GB RAM
    • 1 TB NVME SSD
    • 3.2 GHz x4 GHz CPU

Operating System

  • Recommended
    • Linux(x86_64)

Installation Steps

1. Basic Packages

# update the local package list and install any available upgrades 
sudo apt-get update && sudo apt upgrade -y 
# install toolchain and ensure accurate time synchronization 
sudo apt-get install make build-essential gcc git jq chrony -y
# install gcc & make
sudo apt install gcc && sudo apt install make

2. Install Go

Follow the instructions here to install Go.

Alternatively, for Ubuntu LTS, you can do:

wget https://golang.org/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz

Unless you want to configure in a non standard way, then set these in the .profile in the user's home (i.e. ~/) folder.

cat <<EOF >> ~/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source ~/.profile
go version

Output should be: go version go1.18.2 linux/amd64

Install chtd from source

1. Clone repository

  • Clone git repository
git clone https://github.com/ChronicNetwork/cht.git
  • Checkout latest tag
cd cht
git fetch --tags
git checkout v1.1.0

2. Install CLI

make build && make install

To confirm that the installation was successful, you can run:

chtd version

Output should be: v1.1.0

Instruction for new validators

Init

chtd init "$MONIKER_NAME" --chain-id $CHAIN_ID

Generate keys

# To create new keypair - make sure you save the mnemonics!
chtd keys add <key-name> 

or

# Restore existing chronic wallet with mnemonic seed phrase. 
# You will be prompted to enter mnemonic seed. 
chtd keys add <key-name> --recover

or

# Add keys using ledger
chtd keys show <key-name> --ledger

Check your key:

# Query the keystore for your public address 
chtd keys show <key-name> -a

Validator Setup Instructions

Set minimum gas fees

perl -i -pe 's/^minimum-gas-prices = .+?$/minimum-gas-prices = "0.0125ucgas"/' ~/.cht/config/app.toml

Add persistent peers

Download new genesis file

curl https://raw.githubusercontent.com/ChronicNetwork/net/main/mainnet/v1.1/genesis.json > ~/.cht/config/genesis.json

Setup Unit/Daemon file

# 1. create daemon file
touch /etc/systemd/system/chtd.service
# 2. run:
cat <<EOF >> /etc/systemd/system/chtd.service
[Unit]
Description=Chronic daemon
After=network-online.target
[Service]
User=<USER>
ExecStart=/home/<USER>/go/bin/chtd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
# 3. reload the daemon
systemctl daemon-reload
# 4. enable service - this means the service will start up 
# automatically after a system reboot
systemctl enable chtd.service
# 5. start daemon
systemctl start chtd.service

In order to watch the service run, you can do the following:

journalctl -u chtd.service -f

Congratulations! You now have a full node. Once the node is synced with the network, you can then make your node a validator.

Create validator

  1. Transfer funds to your validator address. A minimum of 1 CHT (1000000ucht) is required to start a validator.

  2. Confirm your address has the funds.

chtd q bank balances $(chtd keys show -a <key-alias>)
  1. Run the create-validator transaction Note: 1,000,000 ucht = 1 CHT, so this validator will start with 1 CHT
chtd tx staking create-validator \ 
--amount 1000000loki \ 
--commission-max-change-rate "0.05" \ 
--commission-max-rate "0.10" \ 
--commission-rate "0.05" \ 
--min-self-delegation "1" \ 
--details "validators write bios too" \ 
--pubkey $(chtd tendermint show-validator) \ 
--moniker $MONIKER_NAME \ 
--chain-id $CHAIN_ID \ 
--fees 2000loki \
--from <key-name>

To ensure your validator is active, run:

chtd q staking validators | grep moniker

Backup critical files

priv_validator_key.json
node_key.json

Instruction for old validators

Stop node

systemctl stop chtd.service

Install latest Chtd from source

Install latest Chtd

Download genesis file

curl https://raw.githubusercontent.com/ChronicNetwork/net/main/mainnet/genesis.json > ~/.cht/config/genesis.json

Clean old state

chtd unsafe-reset-all

Rerun node

systemctl daemon-reload
systemctl start chtd.service

cht's People

Contributors

discoverdefiteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.