I wanted to try mining on my Kubuntu 13.04. Not to get rich, but simply to verify that the production of crypto-currencies really was decentralized, and also to learn how-to mine.

I first tried mining Bitcoin with BFGMiner. I choose the later over cgminer because that’s the only one I found to be readily available from an Ubuntu PPA:

1 $ sudo tee -a /etc/apt/sources.list <<-EOF
2     deb https://ppa.launchpad.net/unit3/bfgminer/ubuntu quantal main
3     deb-src https://ppa.launchpad.net/unit3/bfgminer/ubuntu quantal main
4   EOF
5 $ sudo aptitude install bfgminer

Unfortunately the version was not up to date, and was not compiled for mining scrypt-based coins like Litecoin. Here is how I built BFGMiner with this support.

Install the dependencies:

1 $ sudo aptitude install build-essential autoconf libtool libjansson-dev libcurl4-gnutls-dev libncurses5-dev libudev-dev libusb-1.0-0-dev yasm uthash-dev

Get a copy of the latest version and prepare the environment:

1 $ cd ~
2 $ git clone https://github.com/luke-jr/bfgminer.git
3 $ cd bfgminer/
4 $ ./autogen.sh

Then I built it while enabling scrypt and CPU optimizations:

1 $ ./configure --enable-cpumining --enable-scrypt
2 $ make

Then create a config file in ~/.bfgminer/bfgminer.conf:

{
  "pools": [
    {
      "url": "stratum+tcp://coinotron.com:3334",
      "user": "foo.ltc",
      "pass": "xxxxxxxxxx",
      "pool-priority": "0"
    },
    {
      "url": "https://p2pool.org:9327",
      "user": "LTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "pass": "password",
      "pool-priority": "1"
    }
  ],
  "algo": "scrypt",
  "api-port": "4028",
  "expiry": "120",
  "expiry-lp": "3600",
  "gpu-dyninterval": "7",
  "log": "5",
  "no-pool-disable": true,
  "no-show-processors": true,
  "no-show-procs": true,
  "queue": "1",
  "scan-time": "60",
  "scrypt": true,
  "skip-security-checks": "0",
  "submit-stale": true,
  "temp-hysteresis": "3",
  "shares": "0",
  "kernel-path": "/usr/local/bin"
}

And your ready to launch the miner:

1 $ ~/bfgminer/bfgminer