Post
Topic
Board Announcements (Altcoins)
[SHC] [INFO] ShareCoin Linux Build Guide (v3.1)
by
shcoins
on 26/03/2018, 17:27:36 UTC
Version: 3.1
Platform: Linux
Source: https://github.com/neonatura/shioncoin/

Two release programs are built; the "shcoind" daemon which provides coin interface functionality, and the "shc" utility program which provides RPC communication for performing operations against the server.

The "shc" utility program must have permission to read the "/var/lib/shioncoin/blockchain/rpc.dat" file in order to communicate to the server. The utility program must be ran on the same machine that the "shcoind" daemon is running on.

All commands below assume you are logged in as the "root" user. Installation packages are generally referred to for the CentOS distribution, and are typically fairly similar for Ubuntu.


Package Dependencies

The "shcoind" daemon has a few dependencies that will need to be installed before it can be compiled.

In order to setup your system for normal development you can run the following:

yum install gcc make automake cpp


C++ Database Library

The "C++ Database" is used in order to store wallet information. The wallet is compatible with the legacy bitcoin format.

yum install libdb-cxx


Boost Runtime Library

The "shcoind" daemon utilizes the "system", "filesystem", and "thread" modules.

yum install boost-system boost-filesystem boost-thread


GMP Math Library

The "GMP" library provides complex math functionality.

yum install gmp-devel
apt-get install libgmp-dev



Share Runtime Library

Installation of the share runtime library is optional, in that, a local copy will automatically be downloaded and compiled by the "shioncoin" package if it is not already installed. It is recommended to install the share runtime library independantly in order to take full advantage of all the ShionCoin virtual currency features available.

cd /tmp
git clone https://github.com/neonatura/share
cd share
./autogen.sh
mkdir build
cd build


On CentOS:
../configure --libdir=/usr/lib64
make
make install
ldconfig


On Ubuntu:
../configure
make
make install


You can test that the installation has properly been installed by running a test of one of the utility programs provided:

shgeo "Missoula, MT"

You can optionally perform a "make check" in order to run the full unit-testing against the underlying functionality provided by the library. Note that this can take some time to perform.


Compiling the Main Package

Run the following in order to download and compile the ShionCoin package:

cd /tmp
git clone https://github.com/neonatura/shioncoin/
cd shioncoin
./autogen.sh
mkdir build
cd build
../configure
make
make install


The "make install" command above is optional. Once a "make" has been performed a sym-link of the executables are available in the "/tmp/shioncoin/build/bin/" directory.

cd bin
mkdir -p /root/shc
cp shcoind /root/shc
cp shc /root/shc


You can optionally run a "make check" in order to perform unit-testing against the underlying ShionCoin interface functionality. It may be neccessary to remove the files "/var/lib/share/blockchain/test_*" if this program is ran more than once. The test program uses a seperate block-chain, and does not otherwise affect the main ShareCoin block-chain. No "test net" is currently being provided.


Service Running and Installing

If you installed the libshare runtime library, then run "shpref shcoind.debug true" in order to print verbose information to the log file.

The current method used to install the "shcoind" service to start upon boot pre-dates the newly introduced "systemctl" standard, and there-fore you will likely need to install the service manually.

Paste the following into a new file "/etc/systemd/system/shcoind.service".
Code:
[Unit]
Description = ShareCoin
After = network.target

[Service]
ExecStart = /usr/local/bin/shcoind

[Install]
WantedBy = multi-user.target

Run the "shcoind" program in order to manually start the service. You can run "shcoind -nf" in order to start the program in the foreground. A log file is written at "/var/log/share/shcoind.log".


Troubleshooting

In the event that the block-chain becomes corrupted or un-usable, you can restore from an automatically generated backup. The backup will only contain a majority of the original block-chain. Restoring a backup chain does not affect the wallet.

Ensure the "shcoind" daemon is not running and follow the instructions below:

cd /var/lib/shioncoin/blockchain/
mkdir arch
cp shc_* arch
rm shc_block.* shc_tx.* shc_coin.*
shcoind --shc-rebuild-chain


Once the "shcoind --shc-rebuild-chain" command has finished you can start up the "shcoind" daemon.

If the block-chain enters into a fault state where no new blocks are accepted, it is possible to "purge" recent block-chain records in an attempt to resolve the issue. The "shc_*.arch" files contain orphan blocks and tx's, and are removed to prevent a block from being re-introduced that could cause the original symptoms to re-appear.

The "XX" below is the current block height reported by "shc block.info" minus about 1000 blocks. The "XX" references the desired height of the block chain. You will need to restart the "shcoind" daemon in order to trigger a new block download from the truncated block height.

Start up the "shcoind" service and run:

shc block.info
shc block.purge XX
shc sys.shutdown

rm /var/lib/shioncoin/blockchain/shc_*.arch

shc block.info


You can generate binary backups, or restore them, using the "shc block.export" and "shc block.import" commands. See the ShareCoin Command Guide for more information.