CrossFi (validator setup guide and network monitoring system)
CrossFi Chain is a layer 1 blockchain with a modular architecture. It consists of two integral parts, Cosmos and EVM. Each part is responsible for its specific functionality, with their work completely synchronized as a single organism.
----------------------------------------------------------------------------------------
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop screen unzip bc fail2ban htop -y
wget https://golang.org/dl/go1.20.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
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
The output should be:go version go1.20 linux/amd64
wget https://github.com/crossfichain/crossfi-node/releases/download/v0.3.0-prebuild3/crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz && tar -xf crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz tar -xvf crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz chmod +x $HOME/bin/crossfid mv $HOME/bin/crossfid $HOME/go/bin rm -rf crossfi-node_0.3.0-prebuild3_linux_amd64.tar.gz $HOME/bin
Specify variables, for ease of work:
CROSSFI_MONIKER="YourValidatorName" CROSSFI_WALLET="YourWalletName"
echo 'export CROSSFI_MONIKER='${CROSSFI_MONIKER} >> $HOME/.profile echo 'export CROSSFI_WALLET='${CROSSFI_WALLET} >> $HOME/.profile source $HOME/.profile
crossfid init $CROSSFI_MONIKER --chain-id crossfi-evm-testnet-1
crossfid config chain-id crossfi-evm-testnet-1 && \ peers="" && \ sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.mineplex-chain/config/config.toml && \ seeds="[email protected]:10218" && \ sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.mineplex-chain/config/config.toml
crossfid keys add $CROSSFI_WALLET
Or restore if there is a mnemonic:
crossfid keys add $CROSSFI_WALLET --recover
wget -O genesis.json "https://raw.githubusercontent.com/crossfichain/testnet/master/config/genesis.json" --inet4-only mv genesis.json ~/.mineplex-chain/config
cd $HOME/.mineplex-chain/config && \ indexer="null" && \ snapshot_interval="0" && \ pruning="custom" && \ pruning_keep_recent="1000" && \ pruning_keep_every="0" && \ pruning_interval="50" && \ sed -i.bak -e "s/^indexer *=.*/indexer = \"$indexer\"/" config.toml && \ sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$snapshot_interval\"/" app.toml && \ sed -i.bak -e "s/^pruning *=.*/pruning = \"$pruning\"/" app.toml && \ sed -i.bak -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" app.toml && \ sed -i.bak -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" app.toml && \ sed -i.bak -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" app.toml
cd $HOME/.mineplex-chain/config && \ sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:26653\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:26652\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:6061\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:26651\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":26655\"%" config.toml && \ sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:9092\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:9093\"%" app.toml && \ echo 'export NODE=http://localhost:26652' >> $HOME/.bash_profile && \ source $HOME/.bash_profile && \ crossfid config node $NODE
sudo tee /etc/systemd/system/crossfid.service > /dev/null <<EOF [Unit] Description=crossfi After=network-online.target [Service] User=$USER ExecStart=$(which crossfid) start Restart=on-failure RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload && sudo systemctl enable crossfid && sudo systemctl restart crossfid && sudo journalctl -u crossfid -f -o cat
Running a node from a state sync (optional)
sudo systemctl stop crossfid && \ crossfid tendermint unsafe-reset-all --home /root/.mineplex-chain --keep-addr-book
peers="6ccbd12710c67de8642cf1a7f545537b6e3e5e66@rpc.crossfi.stakeup.tech:29656" && \ sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.mineplex-chain/config/config.toml && \ SNAP_RPC="https://rpc.crossfi.stakeup.tech:443" && \ LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \ TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) && \ echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && \ sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.mineplex-chain/config/config.toml
sudo systemctl restart crossfid && journalctl -u crossfid -f -o cat
Running a node from a snapshot (optional)
sudo systemctl stop crossfid.service
Backup priv_validator_state.json
cp $HOME/.mineplex-chain/data/priv_validator_state.json $HOME/priv_validator_state.json
Remove old data in directory ~/.mineplex-chain/data
rm -rf ~/.mineplex-chain/data
mkdir -p ~/.mineplex-chain/data; \ cd ~/.mineplex-chain/data; \ wget https://snapshots.stakeup.tech/crossfi/crossfi-evm-testnet-1_latest.tar; \ tar -xf crossfi-evm-testnet-1_latest.tar -C $HOME/.mineplex-chain/data/; \
Return your priv_validator_state.json
mv $HOME/priv_validator_state.json $HOME/.mineplex-chain/data/priv_validator_state.json
wget -O $HOME/.mineplex-chain/config/addrbook.json "https://snapshots.stakeup.tech/crossfi/addrbook.json"
sudo systemctl restart crossfid && journalctl -u crossfid -f -o cat
After full synchronization, you can create own validator. Create a validator
crossfid tx staking create-validator \ --amount=1000000000000000000mpx \ --pubkey=$(crossfid tendermint show-validator) \ --moniker=$CROSSFI_MONIKER \ --chain-id=crossfi-evm-testnet-1\ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.1" \ --min-self-delegation="1" \ --fees 200000000000000000mpx \ --gas 400000 \ --from=$CROSSFI_WALLET \ --identity="" \ --website="" \ --details="" \ -y
Network monitoring system (optional)
sudo apt-get install jq sysstat bc smartmontools fdisk -y
mkdir status && \ cd status
Download the script and settings
wget https://raw.githubusercontent.com/landerosua/status/main/tendermint/node_status/cosmos.sh && \ wget https://raw.githubusercontent.com/landerosua/status/main/tendermint/node_status/cosmos.conf && \ wget https://raw.githubusercontent.com/landerosua/status/main/tendermint/node_status/name.conf
chmod +x cosmos.sh
CHAT_ID_ALARM="you_id_chat_for_alarm_messages(telegram)"
CHAT_ID_STATUS="you_id_chat_for_log_messages(telegram)"
BOT_TOKEN="you_bot_token(telegram bot)"
VALIDATOR_ADDRESS="you_valoper_address"
DELEGATOR_ADDRESS="you_wallet"
MONIKER="you_validator_moniker"
Updating and configuring settings in files
mv name.conf crossfi.conf && \ sed -i 's,# CURL=,CURL=, g' $HOME/status/crossfi.conf && \ sed -i "s/^SERVER *=.*/SERVER = \"CrossFi\"/" $HOME/status/cosmos.conf && \ sed -i "s/^CHAT_ID_ALARM *=.*/CHAT_ID_ALARM = \"$CHAT_ID_ALARM\"/" $HOME/status/cosmos.conf && \ sed -i "s/^BOT_TOKEN *=.*/BOT_TOKEN = \"$BOT_TOKEN\"/" $HOME/status/cosmos.conf && \ sed -i "s/^MONIKER *=.*/MONIKER = \"$MONIKER\"/" $HOME/status/crossfi.conf && \ sed -i 's,https://api-cosmos.cosmostation.io/v1/status/,https://api.crossfi.stakeup.tech/cosmos/base/tendermint/v1beta1/blocks/latest, g' $HOME/status/crossfi.conf && \ sed -i "s/^DELEGATOR_ADDRESS *=.*/DELEGATOR_ADDRESS = \"$DELEGATOR_ADDRESS\"/" $HOME/status/crossfi.conf && \ sed -i "s/^VALIDATOR_ADDRESS *=.*/VALIDATOR_ADDRESS = \"$VALIDATOR_ADDRESS\"/" $HOME/status/crossfi.conf && \ sed -i "s/^TOKEN *=.*/TOKEN = \"mpx\"/" $HOME/status/crossfi.conf && \ sed -i "s/^DENOM *=.*/DENOM = \"1000000000000000000\"/" $HOME/status/crossfi.conf && \ sed -i "s/^PROJECT *=.*/PROJECT = \"crossfi-testnet\"/" $HOME/status/crossfi.conf && \ sed -i 's,/root/go/bin/cosmosd,/root/go/bin/crossfid, g' $HOME/status/crossfi.conf && \ sed -i 's,/root/.cosmos/config/,/root/.mineplex-chain/config/, g' $HOME/status/crossfi.conf && \ sed -i "s/^CHAT_ID_ALARM *=.*/CHAT_ID_ALARM = \"$CHAT_ID_ALARM\"/" $HOME/status/crossfi.conf && \ sed -i "s/^CHAT_ID_STATUS *=.*/CHAT_ID_STATUS = \"$CHAT_ID_STATUS\"/" $HOME/status/crossfi.conf && \ sed -i "s/^BOT_TOKEN *=.*/BOT_TOKEN = \"$BOT_TOKEN\"/" $HOME/status/crossfi.conf
crontab -e
Adding a line
1,11,21,31,41,51 * * * * bash $HOME/status/cosmos.sh >> $HOME/status/cosmos.log 2>&1
At work, the logs look like this
Useful links
Website - https://crossfi.org/
Discord - https://discord.gg/crossfi
Twitter - https://x.com/crossfichain
Github - https://github.com/crossfichain
Medium - https://medium.com/@crossfichain