April 10
Galactica Node Guide | Гайд по ноде Галактика
Требования к серверу:
СPХ хетцнере
Установка
sudo apt update -y && sudo apt upgrade -y sudo apt install -y unzip gcc make logrotate git jq lz4 sed wget curl build-essential curl tar jq systemd #устанавливаем го sudo rm -rf /usr/local/go go_package_url="https://go.dev/dl/go1.20.13.linux-amd64.tar.gz" go_package_file_name=${go_package_url##*\/} wget -q $go_package_url sudo tar -C /usr/local -xzf $go_package_file_name echo "export PATH=\$PATH:/usr/local/go/bin" >>~/.profile echo "export PATH=\$PATH:\$(go env GOPATH)/bin" >>~/.profile source ~/.profile
git clone https://github.com/Galactica-corp/galactica.git galactica cd galactica make install galacticad version --long
cd cd .galactica mkdir galactica-validator cd galactica-validator/ export MAIN_PATH_HOME=/root export MAIN_PATH_CONFIG=$MAIN_PATH_HOME/.galactica/config export CHAIN_ID=galactica_9302-1 export KEYRING_BACKEND=file alias gala="galacticad --home $MAIN_PATH_HOME --keyring-backend $KEYRING_BACKEND" echo alias gala="galacticad --home $(realpath $MAIN_PATH_HOME) --keyring-backend $KEYRING_BACKEND" >> ~/.bashrc
gala config chain-id $CHAIN_ID gala config keyring-backend file gala config node tcp://0.0.0.0:26657 export VALIDATOR_MONIKER=<MONIKER> #заменить <MONIKER>на имя своей ноды sed -i.backup "s?moniker = \".*\"?moniker = \"$VALIDATOR_MONIKER\"?" $MAIN_PATH_CONFIG/config.toml gala init $VALIDATOR_MONIKER --chain-id galactica_9302-1
sed -i 's?laddr = "tcp://127.0.0.1:26657"?laddr = "tcp://0.0.0.0:26657"?g' $MAIN_PATH_CONFIG/config.toml sed -i 's?proxy_app = "tcp://127.0.0.1:26658"?proxy_app = "tcp://0.0.0.0:26658"?g' $MAIN_PATH_CONFIG/config.toml sed -i 's?cors_allowed_origins = \[\]?cors_allowed_origins = \["*"\]?g' $MAIN_PATH_CONFIG/config.toml sed -i.backup '/\[api\]/,+3 s?enable = false?enable = true?' $MAIN_PATH_CONFIG/app.toml sed -i 's?address = "tcp://localhost:1317"?address = "tcp://0.0.0.0:1317"?' $MAIN_PATH_CONFIG/app.toml sed -i 's?enabled-unsafe-cors = false?enabled-unsafe-cors = true?' $MAIN_PATH_CONFIG/app.toml sed -i 's?address = "localhost:9090"?address = "0.0.0.0:9090"?' $MAIN_PATH_CONFIG/app.toml sed -i '/\[grpc-web\]/,+7 s?address = "localhost:9091"?address = "0.0.0.0:9091"?' $MAIN_PATH_CONFIG/app.toml sed -i 's?pruning = "default"?pruning = "nothing"?g' $MAIN_PATH_CONFIG/app.toml sed -i 's?minimum-gas-prices = ".*"?minimum-gas-prices = "10ugnet"?g' $MAIN_PATH_CONFIG/app.toml
curl -L https://github.com/Galactica-corp/networks/blob/main/galactica_9302-1/genesis.json > $HOME/.galactica/config/genesis.json
wget https://raw.githubusercontent.com/Galactica-corp/networks/main/galactica_9302-1/seeds.txt -O ~/.galactica/config/seeds.txt seeds=$(cat ~/.galactica/config/seeds.txt | tr '\n' ',' | sed 's/,$//') sed -i '' "s/seeds = \"\"/seeds = \"$seeds\"/" ~/.galactica/config/config.toml
Если команда выдает ошибку (проверьте!) - записать сиды руками в конфиг
sudo tee /etc/systemd/system/galacticad.service > /dev/null << EOF [Unit] Description=Galactica Node After=network-online.target [Service] User=$USER ExecStart=$(which galacticad) start --home=$(realpath $MAIN_PATH_HOME) --chain-id=$CHAIN_ID --keyring-backend=file --pruning=nothing --metrics --rpc.unsafe --log_level=info --json-rpc.enable=true --json-rpc.enable-indexer=true --json-rpc.api=eth,txpool,personal,net,debug,web3 --api.enable Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload sudo systemctl enable galacticad sudo systemctl start galacticad
sudo journalctl -u galacticad.service -f --no-hostname -o cat
Эксплорер сети тут