sudo apt update
sudo apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev lz4 -y
cd $HOME && \
ver="1.22.6" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/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" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
echo "export WALLET='wallet'" >> $HOME/.bash_profile
echo "export MONIKER='validator'" >> $HOME/.bash_profile
echo "export PORT_CANTO='26'" >> $HOME/.bash_profile
source $HOME/.bash_profile
cd $HOME
rm -rf Canto
git clone https://github.com/Canto-Network/Canto
cd Canto
git checkout 8.1.1
make install
cantod version --long | grep -e version -e commit
cantod init "validator" --chain-id canto_7700-1
cantod config chain-id canto_7700-1
cantod config keyring-backend os
cantod config node tcp://localhost:${PORT_CANTO}657
wget -O $HOME/.cantod/config/genesis.json https://download.dteam.tech/canto/mainnet/genesis
wget -O $HOME/.cantod/config/addrbook.json https://download.dteam.tech/canto/mainnet/addrbook
SEEDS="9a84c3bb8b5e86fc79c05867fecc22387cb6d3ed@seed.canto.mainnet.dteam.tech:37656"
PEERS="9254f022b3e1485eb3fc5c8f91f67b994dff306c@peer.canto.mainnet.dteam.tech:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:23556,[email protected]:15556,[email protected]:26656,[email protected]:26676,[email protected]:15556,[email protected]:26656,[email protected]:15556,[email protected]:29656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27656,[email protected]:26656,[email protected]:26656,[email protected]:30656,[email protected]:26656,[email protected]:27650,[email protected]:15556,[email protected]:14656,[email protected]:30204,[email protected]:29656,[email protected]:26669,[email protected]:26656,[email protected]:51656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:46656,[email protected]:58656,[email protected]:26656,[email protected]:15556,[email protected]:26656,[email protected]:26602,[email protected]:26656,[email protected]:30656,[email protected]:29656,[email protected]:26656,[email protected]:16656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,b6e53cc7251a2ccf4a0b8bf25b00a32d03cd414f@2a01:26656,[email protected]:21216,[email protected]:26656,[email protected]:27656,[email protected]:26602,[email protected]:26656,[email protected]:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.cantod/config/config.toml
sed -i.bak -e "s%:1317%:${PORT_CANTO}317%g;
s%:8080%:${PORT_CANTO}080%g;
s%:9090%:${PORT_CANTO}090%g;
s%:9091%:${PORT_CANTO}091%g;
s%:8545%:${PORT_CANTO}545%g;
s%:8546%:${PORT_CANTO}546%g;
s%:6065%:${PORT_CANTO}065%g" $HOME/.cantod/config/app.toml
sed -i.bak -e "s%:26658%:${PORT_CANTO}658%g;
s%:26657%:${PORT_CANTO}657%g;
s%:6060%:${PORT_CANTO}060%g;
s%:26656%:${PORT_CANTO}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${PORT_CANTO}656\"%;
s%:26660%:${PORT_CANTO}660%g" $HOME/.cantod/config/config.toml
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.cantod/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.cantod/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"20\"/" $HOME/.cantod/config/app.toml
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "1000000000000acanto"|g' $HOME/.cantod/config/app.toml
INDEXER="null"
sed -i -e "s/^indexer *=.*/indexer = \"$INDEXER\"/" $HOME/.cantod/config/config.toml
SNAPSHOT_INTERVAL=0
sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$SNAPSHOT_INTERVAL\"/" ~/.cantod/config/app.toml
sudo tee /etc/systemd/system/cantod.service > /dev/null <<EOF
[Unit]
Description=canto mainnet node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.cantod
ExecStart=$(which cantod) start
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
cantod tendermint unsafe-reset-all --home $HOME/.cantod
curl https://download.dteam.tech/canto/mainnet/pruned/latest-snapshot | lz4 -dc - | tar -xf - -C $HOME/.cantod
sudo systemctl daemon-reload
sudo systemctl enable cantod
sudo systemctl restart cantod
sudo journalctl -u cantod -f -o cat