Cosmos Ecosystem
September 5, 2022
Cosmic Horizon
OFFICIAL LINKS
Discord | Website | Twitter | Telegram | Telegram (RU) | Telegram (TR) | GitHub | Whitepaper | Public Roadmap
1. Обновление пакетов и установка окружения
cd $HOME sudo apt update sudo apt install make clang pkg-config libssl-dev build-essential git jq ncdu bsdmainutils htop -y < "/dev/null"
2. Установка Go
cd $HOME wget -O go1.18.4.linux-amd64.tar.gz https://golang.org/dl/go1.18.4.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz && rm go1.18.4.linux-amd64.tar.gz 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 go version
3. Компиляция бинарного файла
cd $HOME git clone https://github.com/cosmic-horizon/coho.git cd coho/ starport chain build cd $HOME
4. Инициализация узла и скачивание генезиса
(придумайте свое название ноды и задайте значение переменной $Сoho_Nodename)
cohod init $Сoho_Nodename --chain-id darkenergy-1 wget -O $HOME/.coho/config/genesis.json https://raw.githubusercontent.com/cosmic-horizon/testnets/main/darkenergy-1/genesis.json
5. Добавление пиров
peers="cc297ea4d0735d714f5e1537ab04ceb29cf0682b@95.214.55.4:26656,3c9fd940daeccd52ca211ab8e366f0ef540ed254@195.3.221.12:26656,eefa94e12bec5efa2efef58d4e3b517f6e606f92@141.95.108.187:26656,34e2b93b4ca96687742c53dd2dea2de9e548f1b4@88.99.219.120:26656,f91f1434063abdcf69d80860a22836c286e077ca@65.21.132.27:26656,b2e6413a51757ca83684abfa6f7067ff0e525437@95.216.5.110:26656,7d7e7044af1c231dec855f7279bce15c292a3c3a@95.217.118.121:26656" sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.coho/config/config.toml sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 100/g' $HOME/.coho/config/config.toml sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 100/g' $HOME/.coho/config/config.toml sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0ustrd\"/;" ~/.coho/config/app.toml
6. Изменение настроек прунинга
recent=100 every=0 interval=10 sed -i.back "s/pruning *=.*/pruning = \"custom\"/g" $HOME/.coho/config/app.toml sed -i "s/pruning-keep-recent *=.*/pruning-keep-recent = \"$recent\"/g" $HOME/.coho/config/app.toml sed -i "s/pruning-keep-every *=.*/pruning-keep-every = \"$every\"/g" $HOME/.coho/config/app.toml sed -i "s/pruning-interval *=.*/pruning-interval = \"$interval\"/g" $HOME/.coho/config/app.toml
7. Создание и запуск сервиса
echo "[Unit] Description=Coho Node After=network.target [Service] User=$USER Type=simple ExecStart=$(which cohod) start Restart=on-failure LimitNOFILE=65535 [Install] WantedBy=multi-user.target" > $HOME/cohod.service sudo mv $HOME/cohod.service /etc/systemd/system sudo tee <<EOF >/dev/null /etc/systemd/journald.conf Storage=persistent EOF sudo systemctl restart systemd-journald sudo systemctl daemon-reload sudo systemctl enable cohod sudo systemctl restart cohod
8. Создаём кошелек (сохранякм мнемонику)
придумайте свое название кошелька и задайте значение переменной $wallet.
cohod keys add $wallet
Восстановление кошелька через мнемонику
cohod keys add $wallet --recover
9. Создаём валидатора
cohod tx staking create-validator \ --moniker="$Сoho_Nodename" \ --amount=1000000ucoho \ --fees 300ucoho \ --pubkey=$(cohod tendermint show-validator) \ --chain-id=darkenergy-1 \ --commission-max-change-rate=0.01 \ --commission-max-rate=0.20 \ --commission-rate=0.10 \ --min-self-delegation=1 \ --from=$wallet \ --yes