Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2404 of /usr/share/drupal7/includes/menu.inc).

TON miner (PoW) and validator (PoS) on AWS and GCP

TON (The Open Network), or TONcoin, former Telegram Open Network founded by the instant messaging app Telegram.

Miner - PoW

We can use GPU for mining.

AWS g4ad

AMD EPYC CPU + AMD Radeon Pro V520 GPU.

  • Lower price, better TON mining performance, better C/P value.
  • ETH (ethash) hash rate is low, so not for dual mining.

Make sure to use Ubuntu 18.04, as AWS doesn't provide Ubuntu 20.04 drivers.

Install GPU driver.

sudo apt install -y unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version

sudo dpkg --add-architecture i386
sudo apt-get update -y && sudo apt upgrade -y
sudo shutdown -r now

aws s3 cp --recursive s3://ec2-amd-linux-drivers/latest/ .
tar -xf amdgpu-pro*ubuntu*.xz
cd amdgpu*/
sudo apt install linux-modules-extra-$(uname -r) -y
cat RPM-GPG-KEY-amdgpu | sudo apt-key add -

./amdgpu-pro-install -y --opencl=pal,legacy
sudo shutdown -r now

dmesg | grep amdgpu

Install miner

wget https://github.com/todxx/teamredminer/releases/download/v0.9.4.2/teamredminer-v0.9.4.2-linux.tgz
tar zxvf teamredminer-v*-linux.tgz 
cd teamredminer-v*-linux
./teamredminer -a ton -o stratum+tcp://ton.hashrate.to:4003 -u EQB6no6mqZrsC9qfHZQ1DU0ZDTW5sDjtwOm9sSuVPGEpFpn2.trmtest -p x

AWS G4dn

Intel CPU + nVidia Tesla T4 GPU.

  • A little higher price, slightly lower TON mining performance.
  • ETH (ethash) hashrate =~ 25 MH/s. But still not able to cover instance cost. Not recommend.

Use Ubuntu 20.04.

Install GPU driver.

distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-$distribution.pin
sudo mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/7fa2af80.pub
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt-get update
sudo apt-get install -y linux-headers-$(uname -r) cuda cuda-drivers byobu screen
sudo apt-get clean
sudo shutdown -r now

export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}}
sudo /usr/bin/nvidia-persistenced --verbose
git clone https://github.com/NVIDIA/cuda-samples.git
cd cuda-samples/
make

# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/optimize_gpu.html
sudo nvidia-smi --auto-boost-default=0
sudo nvidia-smi -ac 5001,1590

Install miner

  • danila-miner
wget https://whalepool-cdn.fra1.digitaloceanspaces.com/software/danila-miner/danila-miner-2.3.1-ubuntu-focal.tar.gz
tar zxvf danila*
./danila-miner run https://server1.whalestonpool.com EQB6no6mqZrsC9qfHZQ1DU0ZDTW5sDjtwOm9sSuVPGEpFpn2
  • gminer
mkdir gminer && cd gminer
wget https://github.com/develsoftware/GMinerRelease/releases/download/2.91/gminer_2_91_linux64.tar.xz
tar xvf gminer*

./miner --algo ton --server stratum+tcp://tcp.whalestonpool.com:4001 --user EQB6no6mqZrsC9qfHZQ1DU0ZDTW5sDjtwOm9sSuVPGEpFpn2 --cuda

./miner --algo eth+ton --server stratum+tcp://ethash.poolbinance.com:443 --user bluet0626.001 --worker bluet0626.001 --dserver stratum+tcp://tcp.whalestonpool.com:4001 --duser EQB6no6mqZrsC9qfHZQ1DU0ZDTW5sDjtwOm9sSuVPGEpFpn2 --cuda

Validator - PoS

As the software toolkit mytonctrl doesn't support GPU accelerating, use CPU for validator.

Instance Types

  • GCP
    • n2d.highcpu-224: 224 AMD EPYC vCPU cores.
  • AWS
    • c6a.48xlarge: 192 AMD EPYC vCPU cores.

Use Ubuntu 20.04.

Install validator

wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh
sudo bash install.sh -m full
mytonctrl
> emi

Post-installation

If you find this useful, please donate:

  • TON: EQB6no6mqZrsC9qfHZQ1DU0ZDTW5sDjtwOm9sSuVPGEpFpn2
  • ERC20 Tokens: ETH/BNB/MATIC (Ethereum / BSC / Polygon): 0x6c4E28D24836E5eD2639354151534dF9E5c274Ab
    • or use my ENS name: bluet.eth

If you're interested in building mining farms or PoS validator project, please COUNT ME IN!

Add new comment