Author Topic: [GUIDE] How to quickly get Litecoin up and running on a Linux server  (Read 90297 times)

Offline Someguy123

  • Moderator
  • Full Member
  • ****
  • Posts: 344
  • Owner and operator of explorer.litecoin.net
    • Litecoin Block Explorer
If you're just wanting to make Litecoin work on your normal Linux system, please download the binaries from https://litecoin.org/
This guide was intended for SERVERS, not a consumers linux desktop.


In this guide, you'll learn how to Obtain packages needed for compiling, Download the source code, how to actually Compile and install Litecoin, and also Configuring litecoin
This guide will be for Debian and *buntu distro's, so if you're using a redhat based distro such as fedora, or something like gentoo, you'll have to figure out the packages by yourself.

TL;DR LAZY ROOT INSTALL ON DEBIAN 6:
Code: [Select]
apt-get install build-essential libssl-dev libdb4.8-dev libdb4.8++-dev libboost-all-dev git; git clone git://github.com/litecoin-project/litecoin.git; cd litecoin/src; make -j4 -f makefile.unix USE_UPNP=; cp litecoind /usr/bin/litecoind; mkdir ~/.litecoin; echo rpcuser=litecoinrpc >> ~/.litecoin/litecoin.conf; echo rpcpassword=InsertSecureP4ssH3r3 >> ~/.litecoin/litecoin.conf; echo rpcallowip=127.0.0.1 >> ~/.litecoin/litecoin.conf; litecoind -daemon;
TL;DR LAZY ROOT INSTALL ON UBUNTU14.04+/DEBIAN7
Code: [Select]
apt-get install build-essential libssl-dev libdb5.1-dev libdb5.1++-dev libboost-all-dev git; git clone git://github.com/litecoin-project/litecoin.git; cd litecoin/src; make -j4 -f makefile.unix USE_UPNP=; cp litecoind /usr/bin/litecoind; mkdir ~/.litecoin; echo rpcuser=litecoinrpc >> ~/.litecoin/litecoin.conf; echo rpcpassword=InsertSecureP4ssH3r3 >> ~/.litecoin/litecoin.conf; echo rpcallowip=127.0.0.1 >> ~/.litecoin/litecoin.conf; litecoind -daemon;
Step 1 - Obtaining the packages
The instructions slightly differ whether you're running an Ubuntu based distro, or a Debian stable based distro:
For Ubuntu OR Debian 7:
Code: [Select]
sudo apt-get install build-essential libssl-dev libdb5.1-dev libdb5.1++-dev libboost-all-dev gitFor Debian (stable)
Code: [Select]
sudo apt-get install build-essential libssl-dev libdb4.8-dev libdb4.8++-dev libboost-all-dev git
Step 2 - Downloading the source code for Litecoin
This step will download the required files from coblee's Github repository, this same line can be used across all distro's if the git package is installed.
Code: [Select]
git clone git://github.com/litecoin-project/litecoin.git
Step 3 - Compiling and installing Litecoin
So, you've downloaded the source code, obtained the prequisites, and now you're ready for compiling.
The files should've been saved into the current directory under the folder name "litecoin"
First, you must Change Directory into the src folder which is within the litecoin folder
Code: [Select]
cd litecoin/srcNext we must find out how many cores we have
Code: [Select]
cat /proc/cpuinfo | grep -i "model name"You should get output similar to this:
Code: [Select]
[email protected]:~/litecoin/src $ cat /proc/cpuinfo | grep -i "model name"
model name      : Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
model name      : Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
model name      : Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
model name      : Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
If you have 4 lines of "model name:", then this means you have 4 cores or CPU's. If you have just 1, you only have a single core available.

Now that we know this, we can continue to compile Litecoin
Change -j4 to the amount of cores you have, you can find this out by following the previous instructions above ^^^^
Code: [Select]
make -j4 -f makefile.unix USE_UPNP=If there were no errors, we can continue to the last part, if you saw something similar to "exiting: error" or "make error", you may need to make sure you've installed all of the prequisites, and that your system is up to date ( sudo apt-get upgrade )
We're almost done, the last step is to copy litecoind into /usr/bin
Code: [Select]
sudo cp litecoind /usr/bin/litecoind
Now that litecoind is installed, we just need to create a config file.
First, create the .litecoin dir to ensure it exists.
Code: [Select]
mkdir ~/.litecoinYou can create the ~/.litecoin/litecoin.conf from another computer and upload it via FTP or SCP if needed.

To create and edit the config, we're going to use nano, if you have a different editor in mind, feel free to use that instead.
Code: [Select]
nano ~/.litecoin/litecoin.conf
Enter the following text:
Code: [Select]
server=1
rpcallowip=127.0.0.1
rpcuser=HardToGuessUsername
rpcpassword=Str0ngS3cur3Passw0rd1
REMEMBER TO CHANGE THE USERNAME AND PASSWORD TO SOMETHING DIFFERENT, THIS IS JUST AN EXAMPLE.
(OPTIONAL):
If you're going to be accessing the daemon remotely, you should remove the rpcallowip= line, or add another line which says

Code: [Select]
rpcallowip=YOURIPADDRESS
For extra security we're going to lock down the config, otherwise other users on the system could find out our username and password, then steal our litecoins  ::) ( thanks 92vv15j67s for the reminder. )
Code: [Select]
chmod 600 ~/.litecoin/litecoin.conf

We can finally start the daemon:
Code: [Select]
litecoind -daemonYou will get a message that says
Code: [Select]
litecoin server starting
We can now check that this is working properly using:
Code: [Select]
litecoind getinfo
This should output something similar to:
Code: [Select]
{
    "version" : 60300,
    "protocolversion" : 60001,
    "walletversion" : 10500,
    "balance" : 0.00000000,
    "blocks" : 1234,
    "connections" : 9,
    "proxy" : "",
    "difficulty" : 10.43114940,
    "testnet" : false,
    "keypoololdest" : 1328988194,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "mininput" : 0.00010000,
    "errors" : ""
}

You can repeat the command to check how many blocks your daemon has retrieved so far, once your block count is the same as the most recent block on http://explorer.litecoin.net you can now use the daemon in your server programs, or for a pool.

If you need any help, simply post in the thread, PM me on here/bitcointalk, or message me on Freenode IRC (I'm someguy123)
« Last Edit: January 03, 2015, 06:34:01 PM by Someguy123 »

Offline Greedi

  • Sr. Member
  • ****
  • Posts: 617
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #1 on: August 04, 2012, 07:35:48 PM »
wow, that a nice guide bro


keep up the good work !

Offline crazy_rabbit

  • Newbie
  • *
  • Posts: 13
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #2 on: August 16, 2012, 06:01:26 AM »
Thanks, I was looking for this information. As soon as Git is back up (down at the moment) I'm going to give it a try!

Offline crazy_rabbit

  • Newbie
  • *
  • Posts: 13
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #3 on: August 16, 2012, 07:34:16 AM »
I got it up and running like a charm with this guide. Now off to download the blocks. Thanks again!

Offline g2x3k

  • Newbie
  • *
  • Posts: 17
  • PooL-X.eu
    • Pool-x.eu
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #4 on: August 23, 2012, 12:28:11 PM »
you can download a recent blocklist here: http://blockchain.litecoin.net/litecoin/
much quicker then waiting for litecoin todo it :)

Offline der_troll

  • Newbie
  • *
  • Posts: 1
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #5 on: November 04, 2012, 02:23:37 PM »
I'm new to linux, so I'm struggling a bit with this... Seems to be something wrong with g++ ?
make -j1 -f makefile.unix USE_UPNP=

/bin/sh ../share/genbuild.sh obj/build.h
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DUSE_IPV6 -DBOOST_SPIRIT_THREADSAFE -I/root/litecoin/src -I/root/litecoin/src/obj -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/version.d -o obj/version.o version.cpp
g++: error trying to exec 'cc1plus': execvp: No such file or directory
make: *** [obj/version.o] Error 1

Offline Greedi

  • Sr. Member
  • ****
  • Posts: 617
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #6 on: November 04, 2012, 02:50:11 PM »
I'm new to linux, so I'm struggling a bit with this... Seems to be something wrong with g++ ?
make -j1 -f makefile.unix USE_UPNP=

/bin/sh ../share/genbuild.sh obj/build.h
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DUSE_IPV6 -DBOOST_SPIRIT_THREADSAFE -I/root/litecoin/src -I/root/litecoin/src/obj -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/version.d -o obj/version.o version.cpp
g++: error trying to exec 'cc1plus': execvp: No such file or directory
make: *** [obj/version.o] Error 1

have you remebed them all?
sudo apt-get install build-essential libssl-dev libdb5.1-dev libdb5.1++-dev libboost-all-dev git

also, try apt-get install make

Offline 92vv15j67s

  • Newbie
  • *
  • Posts: 8
    • Walla Walla Project
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #7 on: November 07, 2012, 10:58:34 PM »
@Someguy123

Thanks a lot for sharing!

May I suggest to
Code: [Select]
chmod 600 ~/.litecoin/litecoin.conf
for some additional security? I haven't actually followed/tested your tutorial (yet), but this came to my attention when reading through it. Just an idea for improvement(?).

Offline LiteStar

  • Newbie
  • *
  • Posts: 5
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #8 on: November 18, 2012, 09:46:33 PM »
I downloaded https://github.com/downloads/litecoin-project/litecoin/litecoin-0.6.3c-linux.tar.gz
and after setting up the ~/.litecoin/litecoin.conf file ran:
    bin/64/litecoind -daemon

I'm getting this error:

Quote
Litecoin server starting


************************
EXCEPTION: 22DbRunRecoveryException       
DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery       
litecoin in AppInit()       

terminate called after throwing an instance of 'DbRunRecoveryException'
  what():  DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery

My system uname -a says:

Linux domain.com 3.0.0-14-server #23-Ubuntu SMP Mon Nov 21 20:49:05 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Help.


Offline LiteStar

  • Newbie
  • *
  • Posts: 5
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #9 on: November 24, 2012, 03:45:02 PM »
Had to delete my ~/.litecoin directory and download the blockchain again. That worked.

Offline Someguy123

  • Moderator
  • Full Member
  • ****
  • Posts: 344
  • Owner and operator of explorer.litecoin.net
    • Litecoin Block Explorer
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #10 on: November 30, 2012, 04:07:53 PM »
@Someguy123

Thanks a lot for sharing!

May I suggest to
Code: [Select]
chmod 600 ~/.litecoin/litecoin.conf
for some additional security? I haven't actually followed/tested your tutorial (yet), but this came to my attention when reading through it. Just an idea for improvement(?).
Added that now. Thanks.

Offline bitcoinnix

  • Newbie
  • *
  • Posts: 2
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #11 on: March 15, 2013, 07:46:13 PM »
Hmm - This doesn't look like it will take advantage of GPU.  Still looking for a decent howto on CGMiner w/ Scrypt to do GPU on RHEL6 or Fedora.

Offline UKMark

  • Jr. Member
  • **
  • Posts: 152
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #12 on: March 18, 2013, 08:37:08 PM »
Everything appears to be installed, blockchain downloaded and running and I can getinfo, getdifficulty, etc etc from the CLI
But if if I connect via my browser (Mozilla Firefox) to http://127.0.0.1:9332/getinfo I get the following JSON message:

Code: [Select]
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}
Is this because I am using a browser and I need to access via a script to be able to parse the JSON? Or is it something else that I am doing wrong? ....

TIA

Offline UKMark

  • Jr. Member
  • **
  • Posts: 152
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #13 on: March 18, 2013, 11:47:15 PM »
^^Now Solved by following the Bitcoin wiki on jsonRPC, its a piece of cake in .php  8)

Offline steveboutin

  • Newbie
  • *
  • Posts: 1
Re: [GUIDE] How to quickly get Litecoin up and running on a Linux server
« Reply #14 on: April 03, 2013, 08:44:43 PM »
Followed the guide to the letter, am getting this error:

EXCEPTION: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options14invalid_syntaxEEEEE
unrecognized line in 'chmod 600 ~/.litecoin/litecoin.conf'
litecoin in AppInit()

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::invalid_syntax> >'
  what():  unrecognized line in 'chmod 600 ~/.litecoin/litecoin.conf'

----------------

My litecoin.conf file looks like this:

server=1
rpcallowip=127.0.0.1
rpcuser=***********
rpcpassword=**********
chmod 600 ~/.litecoin/litecoin.conf

I'm relatively new to linux, and I honestly have no idea what I'm doing wrong.  Could somebody please help?