Published on

TUNA Mining Tutorial: A Step-by-Step Guide to Mining TUNA on Cardano

how-to-mine-tuna.png

Welcome to this comprehensive tutorial on how to mine TUNA, the native token of Fortuna. This is the special coin on the Cardano blockchain, developed by the @aiken_eng team, creators of the Smart contract language Aiken language.

What makes Fortuna special is a proof-of-work smart contract that draws its roots directly from Bitcoin's proof-of-work algorithm. so you need to work get some TUNA. this tutorial focuses on the simplest method to spine up the Fortuna miner.

What You'll Need

  • Git set up on your computer
  • An account on Demeter
  • Ogmios instance up and running on Demeter
  • Kupo instance also active on Demeter
  • Deno runtime environment installed
  • Of course, the Fortuna miner code

Step-by-Step Instructions

Step 1: Setup Git

  • Windows: Git can be installed using the official installer available on the Git website.

  • macOS: Git might come pre-installed, but if not, it can be installed using Homebrew or the official installer.

  • Linux: Git can be installed using the package manager specific to the distribution. For example, for Ubuntu you can use apt and for CentOS, you can use yum.

    • Ubuntu:

      sudo apt update
      sudo apt install git
      
    • CentOS:

      sudo yum update
      sudo yum install git
      

Step 2: Install Deno

  • Windows, macOS, Linux: Deno can be installed by following the official installation guide.

    • Shell (macOS and Linux):

      curl -fsSL https://deno.land/x/install/install.sh | sh
      
    • PowerShell (Windows):

      iwr https://deno.land/x/install/install.ps1 -useb | iex
      
    • Add Deno to your shell profile (bash or zsh):

      echo 'export DENO_INSTALL="/home/$USER/.deno"' >> ~/.bashrc
      echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> ~/.bashrc
      source ~/.bashrc
      

Step 3: Clone the Miner Repository

First, let's clone the Fortuna miner code from GitHub.

git clone https://github.com/aiken-lang/fortuna

Step 2: Set Up Ogmios and Kupo Instances on Demeter

  1. Sign Up on Demeter: Navigate to Demeter and sign up for an account.

  2. Create a New Project: Once signed in, create your new project. image

  3. Open Your Project: Go to your projects list and open the project you just created. Open your pronect

  4. Browse Extensions: Click on 'Browse Extensions'. Browse extensions

  5. Select Ogmios: Choose the Ogmios extension.

  6. Instance Options: You can either connect to a shared instance or create your own.

  7. Instance Connection: After connecting the instance, click the arrow to expand its details. Instance Connection

  8. Enable External Access: Scroll down to "Access from external dApps" and toggle on "Expose Http Port". Instance Connection

  9. Copy Public DNS: Note down the Public DNS link.

  10. Navigate to Miner Code Folder: Return to the folder where you cloned the miner code on your local machine (step 3).

  11. Rename .env.example: Change the file name to .env. Instance Connection

  12. Update .env File: Open .env and replace OGMIOS_URL="" with the Public DNS link you copied. Save the file. Instance Connection

  13. Repeat for Kupo: Go back to step 4 and this time select Kupo. Follow the same steps to get the Public DNS link for Kupo and update the .env file accordingly.

Step 3: Start Mining TUNA

With the Ogmios and Kupo URLs set in your .env file, you're all set to start mining. Run the following commands inside the miner folder:

  1. Initialize Wallet: This command will create a Cardano wallet and save the seed phrase in a seed.txt file in the root folder.

    deno task cli init
    
  2. Get Miner Address: To find out your miner address, run:

    deno task cli address
    
  3. Begin Mining: Send some ADA to your miner address and then initiate the mining process.

    deno task cli mine
    

Instance Connection

Congratulations! If you've followed all the steps correctly, your miner should now be operational.

Common Issues

  • Kupo may not be 100% synced.
  • Incorrect Kupo or Ogmios URLs.

Alternative Methods for Minting TUNA For those looking to optimize their mining performance, there are more advanced alternatives available:

You can modify the miner code to use Blockfrost instead of Ogmios. Running your own local instances of Ogmios and Kupo can give you an edge over other miners. Happy mining!