Sep 042014
 

Many thanks to GNUtransfer for lending us a VPS and other resources to write this article.

In this article we will show how to use the package litecoind-init for debian wheezy amd64 available in our repository

This is the litecoind package for debian wheezy amd64 compiled with downloaded sources from git repository https://github.com/litecoin-project/litecoin and a script in init.d to start and stop it.

The package has a start and stop script in /etc/init.d

First let’s proceed to install it with apt-get, dependencies are also installed.

root@vps590197:/# apt-get install litecoind-init
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libboost-filesystem1.49.0 libboost-program-options1.49.0 libboost-system1.49.0 libboost-thread1.49.0 libdb5.1++ libminiupnpc5 minissdpd openssl pwgen rpl
Suggested packages:
  db-util db4.8-util ca-certificates
The following NEW packages will be installed:
  libboost-filesystem1.49.0 libboost-program-options1.49.0 libboost-system1.49.0 libboost-thread1.49.0 libdb5.1++ libminiupnpc5 litecoind-init minissdpd openssl pwgen rpl
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,971 kB of archives.
After this operation, 11.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? 
Get:1 http://repository.geeklab.com.ar/geeklab-repository/ wheezy/contrib litecoind-init amd64 0.8.7-2 [4,091 kB]
Get:2 http://security.debian.org/ wheezy/updates/main openssl amd64 1.0.1e-2+deb7u12 [701 kB]                                
Get:3 http://ftp.us.debian.org/debian/ wheezy/main libdb5.1++ amd64 5.1.29-5 [757 kB]                                        
Get:4 http://ftp.us.debian.org/debian/ wheezy/main rpl all 1.5.5-1 [8,314 B]                                                                                                                 
Get:5 http://ftp.us.debian.org/debian/ wheezy/main pwgen amd64 2.06-1+b2 [21.0 kB]                                                                                                           
Get:6 http://ftp.us.debian.org/debian/ wheezy/main libboost-system1.49.0 amd64 1.49.0-3.2 [33.4 kB]                                                                                          
Get:7 http://ftp.us.debian.org/debian/ wheezy/main libboost-filesystem1.49.0 amd64 1.49.0-3.2 [78.3 kB]                                                                                      
Get:8 http://ftp.us.debian.org/debian/ wheezy/main libboost-program-options1.49.0 amd64 1.49.0-3.2 [162 kB]                                                                                  
Get:9 http://ftp.us.debian.org/debian/ wheezy/main libboost-thread1.49.0 amd64 1.49.0-3.2 [64.0 kB]                                                                                          
Get:10 http://ftp.us.debian.org/debian/ wheezy/main libminiupnpc5 amd64 1.5-2 [37.9 kB]                                                                                                      
Get:11 http://ftp.us.debian.org/debian/ wheezy/main minissdpd amd64 1.1.20120121-1 [17.5 kB]                                                                                                 
Fetched 5,971 kB in 13s (452 kB/s)                                                                                                                                                           
Selecting previously unselected package libdb5.1++:amd64.
(Reading database ... 27776 files and directories currently installed.)
Unpacking libdb5.1++:amd64 (from .../libdb5.1++_5.1.29-5_amd64.deb) ...
Selecting previously unselected package openssl.
Unpacking openssl (from .../openssl_1.0.1e-2+deb7u12_amd64.deb) ...
Selecting previously unselected package rpl.
Unpacking rpl (from .../archives/rpl_1.5.5-1_all.deb) ...
Selecting previously unselected package pwgen.
Unpacking pwgen (from .../pwgen_2.06-1+b2_amd64.deb) ...
Selecting previously unselected package libboost-system1.49.0.
Unpacking libboost-system1.49.0 (from .../libboost-system1.49.0_1.49.0-3.2_amd64.deb) ...
Selecting previously unselected package libboost-filesystem1.49.0.
Unpacking libboost-filesystem1.49.0 (from .../libboost-filesystem1.49.0_1.49.0-3.2_amd64.deb) ...
Selecting previously unselected package libboost-program-options1.49.0.
Unpacking libboost-program-options1.49.0 (from .../libboost-program-options1.49.0_1.49.0-3.2_amd64.deb) ...
Selecting previously unselected package libboost-thread1.49.0.
Unpacking libboost-thread1.49.0 (from .../libboost-thread1.49.0_1.49.0-3.2_amd64.deb) ...
Selecting previously unselected package libminiupnpc5.
Unpacking libminiupnpc5 (from .../libminiupnpc5_1.5-2_amd64.deb) ...
Processing triggers for man-db ...
Setting up openssl (1.0.1e-2+deb7u12) ...
Setting up rpl (1.5.5-1) ...
Setting up pwgen (2.06-1+b2) ...
Setting up libboost-system1.49.0 (1.49.0-3.2) ...
Setting up libboost-filesystem1.49.0 (1.49.0-3.2) ...
Setting up libboost-program-options1.49.0 (1.49.0-3.2) ...
Setting up libboost-thread1.49.0 (1.49.0-3.2) ...
Setting up libdb5.1++:amd64 (5.1.29-5) ...
Setting up libminiupnpc5 (1.5-2) ...
Processing triggers for python-support ...
Selecting previously unselected package litecoind-init.
(Reading database ... 27919 files and directories currently installed.)
Unpacking litecoind-init (from .../litecoind-init_0.8.7-2_amd64.deb) ...
Selecting previously unselected package minissdpd.
Unpacking minissdpd (from .../minissdpd_1.1.20120121-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up litecoind-init (0.8.7-2) ...
update-rc.d: using dependency based boot sequencing
[ ok ] litecoin-init.sh: Start litecoind Daemon is disabled check /etc/default/litecoin-init.
Setting up minissdpd (1.1.20120121-1) ...
root@vps590197:/# 

Installing this package will create the user “litecoin” whose working directory is:

/var/lib/litecoin

The installation script leaves the package with a working configuration.

You just need to edit /etc/default/litecoin-init (The syntax is bash)

root@vps590197:/# cat /etc/default/litecoin-init 

ENABLE=no

SERVER_CONF=/var/lib/litecoin/.litecoin/litecoin-server.conf
CLIENT_CONF=/var/lib/litecoin/.litecoin/litecoin.conf
DATADIR=/var/lib/litecoin/.litecoin
RUNUSER=litecoin
RUNGROUP=litecoin

NICE_VAL=18

and set the value of the ENABLE variable to “yes”

root@vps590197:/# cat /etc/default/litecoin-init 

ENABLE=yes

SERVER_CONF=/var/lib/litecoin/.litecoin/litecoin-server.conf
CLIENT_CONF=/var/lib/litecoin/.litecoin/litecoin.conf
DATADIR=/var/lib/litecoin/.litecoin
RUNUSER=litecoin
RUNGROUP=litecoin

NICE_VAL=18


root@vps590197:/# 

In case we need to modify litecoind daemon configuration we must edit the file /var/lib/litecoin/.litecoin/litecoin-server.conf

And if we modify rpcuser and/or rpcpassword variable in the file /var/lib/litecoin/.litecoin/litecoin-server.conf we must do the same in file /var/lib/litecoin/.litecoin/litecoin.conf.

If we have a wallet.dat file we must copy it to directory /var/lib/litecoin/.litecoin and change owner and permissions

root@vps590197:/# chown litecoin:litecoin /var/lib/litecoin/.litecoin/wallet.dat
root@vps590197:/# chmod 0600 /var/lib/litecoin/.litecoin/wallet.dat
root@vps590197:/# 

If we do not have a wallet.dat file, one will be created the first time you run the daemon.

We now proceed to start the daemon.

The startup script is /etc/init.d/litecoin-init.sh

root@vps590197:/# /etc/init.d/litecoin-init.sh start
[ ok ] litecoin-init.sh: Start litecoind.
root@vps590197:/# 

Just wait a few minutes and then try to execute a query as user “litecoin”:

litecoin@vps590197:/$ litecoind getinfo
{
    "version" : 80702,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 34024,
    "timeoffset" : 0,
    "connections" : 3,
    "proxy" : "",
    "difficulty" : 0.60642934,
    "testnet" : false,
    "keypoololdest" : 1409869765,
    "keypoolsize" : 1025,
    "paytxfee" : 0.00000000,
    "mininput" : 0.00001000,
    "errors" : ""
}
litecoin@vps590197:/$ 

You may want to connect as another user (such as root)

root@vps590197:/# mkdir -p /root/.litecoin
root@vps590197:/# cp /var/lib/litecoin/.litecoin/litecoin.conf /root/.litecoin
root@vps590197:/# chown root:root /root/.litecoin/litecoin.conf
root@vps590197:/# chmod 0600 /root/.litecoin/litecoin.conf
root@vps590197:/# 

And then …

root@vps590197:/# litecoind getinfo
{
    "version" : 80702,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 18687,
    "timeoffset" : 0,
    "connections" : 4,
    "proxy" : "",
    "difficulty" : 0.22023019,
    "testnet" : false,
    "keypoololdest" : 1409869765,
    "keypoolsize" : 1025,
    "paytxfee" : 0.00000000,
    "mininput" : 0.00001000,
    "errors" : ""
}
root@vps590197:/# 

NOTE 1: We must wait for the entire chain of blocks to synchronize, it could take more than one day.

NOTE 2: Make sure you have enough disk space. For this article the entire block chain occupies about 4 GB.

Any bug or misconception feel free to leave a comment.

This concludes this article.