Repository navigation
Mining With Your Own Hardware
Contestants can now use their own computer hardware to mine on the TEA network. This will require running an installation script to setup your mining machine. The process is slightly different depending on the type of CML you've planted.
You can use a type A or type B CML-planted mining machine to not only earn public service mining rewards but also host TApps. In epoch 6 there won't be any type A CML available for sale. Type B Camellia seeds can be purchased through the marketplace as well as through the signup form. So if you want to host TApps in epoch 6, you'll need to purchase a B CML seed and plant it into a machine with a publicly-accessible IP address.
Note that Type C CML are not allowed to host TApps. You can setup miners for these to earn public service rewards (like remote attestation). Type C planted mining machines can be setup on a home computer and will require 1000T for the first staking slot. C CML-planted mining machines don't require a publicly accessible IP addresses. Besides mining, type C CML seeds can also be used for securing TEA loans and staking into other mining machines.
The mining machine installation scripts were designed to be run on Ubuntu.
- Linux: The script has been tested successfully on Ubuntu versions 18.04, 20.04, and 21.04 and may run on other Ubuntu versions as well.
- Mac and Windows: Most users running home computers will be best off running a virtual machine for Ubuntu. Click here for more info on Mac and Windows compatability. That link also explains how C CML owners on Mac and Windows can use Multipass to setup Ubuntu on their home computers under a virtual machine.
- For A or B-planted CML mining machines: A machine with a publicly-reachable IP address. You can use your home computer (provided you have shell access to run docker and have a way to get an IP address that is reachable from the outside world). For most people it will be easiest to use a cloud virtual server provider.
- For C-planted CML mining machines, most home computers running Ubuntu should work fine. These C CML machines don't always need to be reachable 24/7 so can be run from home computers behind residential routers.
- Minimum ram requirement for mining machine = 2gb.
The following guide will use DigitalOcean's 2GB droplet with Ubuntu 20.04 as the operating system. Because it has at least 2G of ram and a publicly accessible IP, we will be planting a B CML into this mining machine.
We'll choose a 2GB droplet with shared CPU for our mining machine:
Using ssh key authentication is more secure method of authentication. The following screenshot shows selecting password authentication:
You can now login to your remote droplet using the terminal application on your home computer:
ssh root@ipaddress
where ipaddress is the IP address you've just copied to your clipboard from the Digitalocean dashboard.
It will prompt you to enter your password if you're using password authentication.
Your first login will also ask Are you sure you want to continue connecting (yes/no/[fingerprint])? to which you can answer yes.
By default, digital ocean set the memory swap to off in order to save the life of their SSD drive. But if you do not care (you should not), you should turn it on. It will potentially prevent the OOM (out of memory) which causes your server to crash. Please follow the instruction below: Digital ocean instruction
Run this command in the terminal of your mining machine. The output the script will give you includes the machine id as well as the Polkadot wallet address which you can copy down:

After you are done running the initial script on your mining machine, click the Next step button in the browser wallet.
You'll need to fill in the machine id, Polkadot wallet address (SSS8), and the mining machine's IP in this screen:
There are two install scripts that you must run one after the other:
Paste the 1st script and press return. The script will download and install various packages and should complete within a minute.
Wait for the first install script to finish and then go back and run the second installation script.
The success link is confirmation that your miner was installed correctly. Click the link to continue:
Please read carefully before hosting any applications. Failure to do so could result in penalties.
After you activate your newly planted CML, you still need to wait for your new node to sync up with the blockchain's latest block. Depending on your network speed, this sync-up may take up to a few minutes to several hours. Your node cannot provide any hosting services while negotiating the sync even though the status shows "active". If you host any application and your node hasn't yet synced, your node may be marked as "offline" which will result in a penalty.
You will need to login (ssh) to your node and type in the following command:
sudo docker logs -f -n 10 delegate-layer1
If you can see the output like the following screenshot (note the "Imported" lines in the log):

then your machine has completed syncing and is ready to host applications.
But if you see log messages as in the following screenshot (note the "Syncing .... target:.....best:... finalized #..." line):

then your machine is still syncing up to the latest block. Do NOT host any applications just yet. Check again after a few minutes or hours.
Visit the TApps list to find a TApp you want to host. Miners earn a larger share of the TApp and public service mining rewards compared to stakers:
- 50% of the mining rewards will go to the miner.
- 50% of the rewards will be split between the miner and stakers. This staker group also includes the miner staking at the 0 index slot.
For example, let's say the address ending in NNP9 is mining with CML 298. That machine has 1 staker, the address ending in YfLd. Here's what the staking distribution looks like:
Let's say there are 100T worth of mining rewards to be divvied up betweeen miner and stakers for CML 298. Noting that 50% of 100T is 50T, the mining rewards are distributed as follows:
- NNP9 earns 50T for the miner's share.
- For the stakers' share of the 50T, NNP9 earns 70.711% of 50T and YfLd earns 29.289% of 50T.
So in total, NNP9 earns (50T + 35.3555T) = 85.3555T and YfLd earns 14.6445T of the 100T mining rewards for that round.
You can manage your active CML mining machine by clicking on its ID in your wallet:
These are the options you have available:
-
Migrate miner - Use this button to migrate your CML to a new machine (e.g. your old machine provider has unreliable uptime). The machine will have to be shut down first before this button becomes active. Note that if you sell your CML, the new miner has to run this command to migrate the CML to their own machine.
-
Start miner - Start up a previously stopped miner.
-
Shut down miner - Shut down an active miner.
-
Resume miner - If your miner was detected to be offline, you can slick resume to continue your miner once you're sure that your node is back online.
-
Apply to be a blockchain validator - - PoS staking and mining are possible in layer-1, the same as Polkadot. Miners wishing to earn through PoS can click this button which will take them to this url.
In your delegator-resources directory, there's a script named tools.sh. You can use this script file to perform administrative tasks on your mining machine using the following arguments:
-
tools.sh logs: Show the current running docker-compose logs -
tools.sh stop: Stop docker-compose -
tools.sh clean: Clean out legacy data -
tools.sh health: Check if current running docker-compose is healthy or not -
tools.sh restart: Restart current running docker-compose file. Replaces having to dodocker-compose down& thendocker-compose up -d.
For example, to clean out the current program files (e.g. a new epoch is starting), you can execute the following commands:
cd delegator-resources
./tools.sh stop
./tools.sh clean
If you've already run the installation script but need to start over from scratch, follow the direction below to delete the current installation.
- Stop the docker container:
tools.sh stop - Remove all the files in the delegator-resources/ directory:
cd delegator-resources/
rm -rf *
rm -rf .*
cd ..
rmdir delegator-resources/
A video tutorial of setting up a mining machine on DigitalOcean is available on YouTube
| TEA Project Web | Twitter| Medium Blog | TEA Web Wallet | Telegram | 中文维基 |