-
Notifications
You must be signed in to change notification settings - Fork 10
Build instructions
-to be written-
- Install necessary packages:
sudo aptitude install libssl1.0-dev libdb-dev libdb++-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libminiupnpc-dev make build-essential git zlib1g-dev
update: it is strongly suggested to use BDB/libdb-4.8 to keep everything compatible! Some distros still provide packages but you're most likely going to have to build it yourself.
- Clone repository
git clone https://github.com/Nyancoins/nyancoin-client.git
cd nyancoin-client
- Build
cd src
make -f makefile.unix STATIC=1
# if you have more than one core (and enough RAM) you can speed up the compilation by using -j<numberOfCores>
# for example: make -f makefile.unix STATIC=1 -j4
The client is written in C++ which takes more time and memory to compile than pure C code; RAM usage during compilation fluctuates wildly but I've observed it taking as much as 550MB-1100MB RAM per core.
If you have very little RAM (=< 1024 MB, like most common VPS), create a swap file first:
sudo dd if=/dev/zero of=/swap.bin bs=1M count=1024
sudo chmod 0600 /swap.bin
sudo mkswap /swap.bin
sudo swapon /swap.bin
Performance will suffer while the system is swapping, it's much better to have more RAM than a bigger swap file.
It may also help to stop any non-vital services to conserve memory.
If compilation was a success, you should see nyancoind
in your current directory.
file ./nyancoind
./nyancoind: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=e98372d668c6dd99621c48dd81cc2869bdd2b3dc, not stripped
# Let's take a look at how large the file is:
du -h ./nyancoind
46M ./nyancoind
# 46 MB is quite a lot, let's strip out all debugging symbols:
strip -s ./nyancoind
du -h ./nyancoind
5.6M ./nyancoind
# Much better :)
- You're done!
At this point you could copy the nyancoind
executable to /usr/local/bin
to install it system-wide
or just leave it where it is and call it using the full path.
- Running the daemon
To run nyancoind
as a daemon, you would call it like this:
./nyancoind -daemon
If this is your first time running, it will fail and tell you to create a nyancoin.conf file:
Error: To use the "-daemon" option, you must set a rpcpassword in the configuration file: /home/nyancoin/.nyancoin/nyancoin.conf
It is recommended you use the following random password:
rpcuser=nyancoinrpc
rpcpassword=FNfQpyXRN8PFG4iQAevMnRWZvrkYScnPrmdLoLcDpGvF
(you do not need to remember this password)
If the file does not exist, create it with owner-readable-only file permissions.
Follow the instructions:
# The path may be different for you!
cat <<EOF > /home/nyancoin/.nyancoin/nyancoin.conf
rpcuser=nyancoinrpc
rpcpassword=FNfQpyXRN8PFG4iQAevMnRWZvrkYScnPrmdLoLcDpGvF
EOF
# (just press enter after EOF)
# Tighten security
chmod 0600 /home/nyancoin/.nyancoin/nyancoin.conf
nyancoind
will generate a randomized password for you or you can use this BASH snippet to generate one yourself:
cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?"|fold -w 64|head
Having the nyancoin client download the blockchain may take a long time, you can reduce the time needed by following my other guide to download the blockchain manually.