by flugdreka
20 deployments · 10 still active · last rev. 7 days ago

Deploy a full node for the TON Blockchain. It can take up to 2 hours to install. Do not reboot the system during the installation.

After successful installation, ton-node is added as systemd service. It will be running on port 1338. You can check its status by sending "service ton-node status".

Compatible with: Debian 10, Ubuntu 19.04, Ubuntu 18.10
export DEBCONF_FRONTEND=noninteractive
apt-get -y purge console-setup
apt-get update
apt-get autoremove -yq
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" install -yq libghc-zlib-dev gperf build-essential make wget libreadline-dev git ccache libmicrohttpd-dev libssl-dev cmake libgflags-dev --allow-downgrades --allow-remove-essential --allow-change-held-packages
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" dist-upgrade -yq
cd /root
git clone --recurse-submodules -j8
mkdir /root/ton-build
cd /root/ton-build
cmake /root/ton
cmake --build . --target validator-engine
cp /root/ton-build/validator-engine/validator-engine /bin/validator-engine
chmod 0755 /bin/validator-engine
cmake --build . --target lite-client
cp /root/ton-build/lite-client/lite-client /bin/lite-client
chmod 0755 /bin/lite-client
mkdir /etc/ton
chmod 0755 /etc/ton
wget -O /etc/ton/ton-client.config
wget -O /etc/ton/ton-global.config
chmod 0644 /etc/ton/ton-global.config
chmod 0644 /etc/ton/ton-client.config
mkdir /var/ton-work
mkdir /var/ton-work/db
mkdir /var/ton-work/etc
mkdir /var/log/ton-node
chmod 775 /var/log/ton-node
chmod 775 -R /var/ton-work
myip=$(wget -qO- | xargs echo)
validator-engine -C /etc/ton/ton-global.config --db /var/ton-work/db/ --ip ${myip}:1338 -l /var/log/ton-node/log
cat << EOF > /etc/systemd/system/ton-node.service
Description=TON Node
ExecStart=/bin/validator-engine -C /etc/ton/ton-global.config --db /var/ton-work/db/ --ip ${myip}:1338 -l /var/log/ton-node/log
systemctl daemon-reload
systemctl enable ton-node
service ton-node start