Nibiru (Cosmos Fork)
Спасибо нашему участнику Liver за наводку на данный космофорк.
Описание
Что такое Nibiru?
Нибиру - децентрализованная платформа, proof-of-stake (POS) блокчейна, которая разработана на экосистеме Cosmos.
Команда в первую очередь сосредоточилась на создании и тестировании протокола торговли бессрочными свопами Nibi-Perps в devnet. Также начата адаптация пользователей и валидаторов для частной тестовой сети.
В процессе перевода и подготовки...
Полезные ссылки
Эксполрер || Эксплорер 2 || Gitbook || Discord || Twitter || Medium || LinkedIn || Сайт
Требования к серверу
Минимальные: 4CPU, 8GB RAM, 100GB SSD or NVMe
Рекомендуемые: 8CPU, 64GB RAM, 1TB SSD or NVMe
Наблюдения: чаще всего минимальных хватает за глаза, но лучше брать диск от 200GB.
Установка
NODENAME=<MONIKER>
Зададим порт, имя кошелька, название сети:
NIBIRU_PORT=39 echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile if [ ! $WALLET ]; then echo "export WALLET=wallet" >> $HOME/.bash_profile # при желании можно изменить fi echo "export NIBIRU_CHAIN_ID=nibiru-testnet-2" >> $HOME/.bash_profile echo "export NIBIRU_PORT=${NIBIRU_PORT}" >> $HOME/.bash_profile source $HOME/.bash_profile
Обновление и установка пакетов:
sudo apt update && sudo apt upgrade -y && \ sudo apt install curl build-essential git wget jq make gcc tmux chrony -y
if ! [ -x "$(command -v go)" ]; then ver="1.19.2" cd $HOME wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" sudo rm -rf /usr/local/go sudo rm -rf /usr/bin/go sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" rm "go$ver.linux-amd64.tar.gz" echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile source ~/.bash_profile fi
Скачаем и скомпилируем бинарник:
cd $HOME && rm -rf nibiru git clone https://github.com/NibiruChain/nibiru.git cd nibiru git checkout v0.16.2 make install
nibid config chain-id $NIBIRU_CHAIN_ID nibid config node tcp://localhost:${NIBIRU_PORT}657
nibid init $NODENAME --chain-id $NIBIRU_CHAIN_ID
curl -s https://rpc.testnet-2.nibiru.fi/genesis | jq -r .result.genesis > $HOME/.nibid/config/genesis.json
sed -i 's|seeds =.*|seeds = "'$(curl -s https://networks.testnet.nibiru.fi/$NIBIRU_CHAIN_ID/seeds)'"|g' $HOME/.nibid/config/config.toml
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${NIBIRU_PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${NIBIRU_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${NIBIRU_PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${NIBIRU_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${NIBIRU_PORT}660\"%" $HOME/.nibid/config/config.toml sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${NIBIRU_PORT}317\"%; s%^address = \":8080\"%address = \":${NIBIRU_PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${NIBIRU_PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${NIBIRU_PORT}091\"%; s%^address = \"0.0.0.0:8545\"%address = \"0.0.0.0:${NIBIRU_PORT}545\"%; s%^ws-address = \"0.0.0.0:8546\"%ws-address = \"0.0.0.0:${NIBIRU_PORT}546\"%" $HOME/.nibid/config/app.toml
pruning="custom" pruning_keep_recent="100" pruning_keep_every="0" pruning_interval="50" sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.nibid/config/app.toml sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.nibid/config/app.toml sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.nibid/config/app.toml sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.nibid/config/app.toml
sed -i 's/minimum-gas-prices =.*/minimum-gas-prices = "0.025unibi"/g' $HOME/.nibid/config/app.toml
sed -i 's|enable =.*|enable = true|g' $HOME/.nibid/config/config.toml sed -i 's|rpc_servers =.*|rpc_servers = "'$(curl -s https://networks.testnet.nibiru.fi$NIBIRU_CHAIN_ID/rpc_servers)'"|g' $HOME/.nibid/config/config.toml sed -i 's|trust_height =.*|trust_height = "'$(curl -s https://networks.testnet.nibiru.fi/$NIBIRU_CHAIN_ID/trust_height)'"|g' $HOME/.nibid/config/config.toml sed -i 's|trust_hash =.*|trust_hash = "'$(curl -s https://networks.testnet.nibiru.fi/$NIBIRU_CHAIN_ID/trust_hash)'"|g' $HOME/.nibid/config/config.toml
sudo tee /etc/systemd/system/nibid.service > /dev/null <<EOF [Unit] Description=nibi After=network-online.target [Service] User=$USER ExecStart=$(which nibid) start --home $HOME/.nibid Restart=on-failure RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
Перезапустим демона, включим сервис и сразу проверим логи.
sudo systemctl daemon-reload sudo systemctl enable nibid sudo systemctl restart nibid && sudo journalctl -u nibid -f -o cat
curl localhost:${NIBIRU_PORT}657/status
Если есть подключение к генезисам(к сети) и нода синхронизирована, то можно переходить к следующему шагу
nibid keys add $WALLET
Если Вы потеряли кошелек, то его можно восстановить по мнемонической фразе:
nibid keys add $WALLET --recover
Сохраняем информацию, вводим команды по очереди , в 1 и 2 вводим свой пароль:
NIBIRU_WALLET_ADDRESS=$(nibid keys show $WALLET -a)
NIBIRU_VALOPER_ADDRESS=$(nibid keys show $WALLET --bech val -a)
echo 'export NIBIRU_WALLET_ADDRESS='${NIBIRU_WALLET_ADDRESS} >> $HOME/.bash_profile echo 'export NIBIRU_VALOPER_ADDRESS='${NIBIRU_VALOPER_ADDRESS} >> $HOME/.bash_profile source $HOME/.bash_profile
Кран
Токены можно запросить в Discord в разделе Faucet
https://discord.com/channels/947911971515293759/984840062871175219
FAUCET_URL="https://faucet.testnet-2.nibiru.fi/" ADDR="..." # your address curl -X POST -d '{"address": "'"$ADDR"'", "coins": ["110000000unibi","100000000000unusd"]}' $FAUCET_URL
Либо написать Mr.Nixon в дискорде, то есть мне
nibid tx staking create-validator \ --amount 2000000unibi \ --from $WALLET \ --commission-max-change-rate "0.01" \ --commission-max-rate "0.2" \ --commission-rate "0.07" \ --min-self-delegation "1" \ --pubkey $(nibid tendermint show-validator) \ --moniker $NODENAME \ --chain-id $NIBIRU_CHAIN_ID \ --node tcp://localhost:${NIBIRU_PORT}657 \ --fees 5000unibi
Полезные команды
nibid q bank balances $NIBIRU_WALLET_ADDRESS --node tcp://localhost:${NIBIRU_PORT}657
nibid keys list
journalctl -fu nibid -o cat
sudo systemctl start nibid
sudo systemctl stop nibid
sudo systemctl restart nibid
nibid tx staking delegate $NIBIRU_VALOPER_ADDRESS 10000000unibi --from $WALLET --chain-id $NIBIRU_CHAIN_ID --node tcp://localhost:${NIBIRU_PORT}657 --fees 5000unibi
Переделегировать награды с одного валидатора другому:
nibid tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 10000000unibi --from=$WALLET --chain-id=$NIBIRU_CHAIN_ID --node tcp://localhost:${NIBIRU_PORT}657 --gas=auto --fees 5000unibi
Данные в <> включая сами знаки подлежат изменению!
nibid tx gov vote 1 yes --from $WALLET --chain-id=$NIBIRU_CHAIN_ID --node tcp://localhost:${NIBIRU_PORT}657
1 - номер голосования, в случае другого номера, его также необходимо изменить!
nibid tx distribution withdraw-rewards $NIBIRU_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$NIBIRU_CHAIN_ID --node tcp://localhost:${NIBIRU_PORT}657
nibid tx staking edit-validator \ --moniker=$NODENAME \ --identity=<your_keybase_id> \ --website="<your_website>" \ --details="<your_validator_description>" \ --chain-id=$NIBIRU_CHAIN_ID \ --from=$WALLET \ --node tcp://localhost:${NIBIRU_PORT}657
nibid tx slashing unjail \ --broadcast-mode=block \ --from=$WALLET \ --chain-id=$NIBIRU_CHAIN_ID \ --gas=auto \ --node tcp://localhost:${NIBIRU_PORT}657 \ --fees 5000unibi
Удаление ноды
sudo systemctl stop nibid sudo systemctl disable nibid sudo rm /etc/systemd/system/nibi* -rf sudo rm $(which nibid) -rf sudo rm $HOME/.nibid* -rf sudo rm $HOME/nibiru -rf sed -i '/NIBIRU_/d' ~/.bash_profile