Showing posts with label litecoin. Show all posts
Showing posts with label litecoin. Show all posts

Sunday, 4 August 2013

How to Build CPUMINER from Source Code in Debian


cpuminer is a miner program for Litecoin and Bitcoin cryptocurrencies. It runs on CPUs (it does not need a graphic card to run).

By default it uses scrypt algorithm, but it can be configured to use SHA-256 one.


Build cpuminer from source code:


In order to build cpuminer from source code we will download its source code from its repository:
$ sudo aptitude install git
$ git clone https://github.com/pooler/cpuminer
$ cd cpuminer
$ less README

Next we install some dependencies to be able to build it.
$ sudo aptitude install automake
$ sudo aptitude install pkg-config
$ sudo aptitude install gcc
$ sudo aptitude install make

NOTE: without this package: "possibly undefined macro: AC_MSG_ERROR" error appears
$ sudo aptitude install libcurl3-gnutls-dev


Create configure and Makefile files:
$ ./autogen.sh
configure.ac:15: installing './compile'
configure.ac:4: installing './config.guess'
configure.ac:4: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Makefile.am: installing './INSTALL'
Makefile.am: installing './depcomp'



Build the sources:

Sunday, 16 June 2013

How to call BTC-e API using LUA language


BTC-e.com is a web site where you can exchange virtual coins (like bitcoins, litecoins, etc), US dollars, euros and Russian rubles.

It provides a web interface for you to manually interact with.

Also if you are interested in building a bot to perform operations automatically, you could use their API.


In this article I am going to call the API from my Debian Sid system using Lua language.


Install Lua and dependencies


First I install lua 5.1 and luarocks to manage lua rocks.
$ sudo aptitude install lua5.1
$ sudo aptitude install luarocks

Once luarocks is already installed I install luasockets, and luasec. This will allow us to perform request using https protocol.
$ sudo luarocks install luasocket
$ sudo luarocks install luasec


INSTALL SHA2

http://code.google.com/p/sha2

Next we install sha2 rock to calculate hmac sha512 hashes.
$ sudo luarocks install sha2
$ cd /usr/local/lib/luarocks/rocks/sha2
$ sudo aptitude install lua-filesystem
$ sudo aptitude install lua5.1-md5-dev

Now we perform the tests:
$ lua test_sha2.lua
$ lua test_hmac.lua
They should pass OK.


INSTALL JSON