Solo Mining on CLI interface
This is a tutorial on how to solo mine Sugarchain on a VPS, using a CLI interface. In this tutorial, I am using an Ubuntu 16.04 LTS Server which should be quite similar to an Ubuntu 18.04 LTS server.
Step 1: Running Wallet
Instead of running the Sugarchain GUI wallet, we will be running the Sugarchain daemon wallet
Log into your VPS server 
Download and extract wallet by executing these commands:
wget https://github.com/sugarchain-project/sugarchain/releases/download/v0.16.3.30-moonlight/sugarchain-0.16.3.30-moonlight-x86_64-linux-gnu.tar.gz
tar -xvzf sugarchain-0.16.3.30-moonlight-x86_64-linux-gnu.tar.gz

Once downloaded and extracted, the files should be located in the /root/
folder or your user folder. In my case, it is located in ~/sugarchain-0.16.3
(~
is the same as /root/
).
Once file is located, cd to the /bin/
folder. E.g:
cd ~/sugarchain-0.16.3/bin

Once there, run the daemon wallet by executing this command:
./sugarchaind -daemon
It should say Sugarchain Server is starting
.

Step 2: Wallet Configuration
Once the wallet is running, we need to setup the sugarchain.conf file
- cd back to root by running
cd ~
or cd /root/
. Either one works.
- Once back at
root
, a hidden file called .sugarchain
should have been created when we ran the daemon wallet. cd
to the folder by running: cd .sugarchain
.
- Create a new file called
sugarchain.conf
by using the nano command:
nano sugarchain.conf

- A new window should have opened, saying at the top
GNU nano (version)
Copy and paste the following into the file:server=1
rpcport=34229
rpcuser=(anything you want)
rpcpassword=(anything you want)

- Press Ctrl+O and then Ctrl+X to save file.
Step 3: Restarting wallet
It may sound simple, but it's not GUI anymore, so there are a few steps we must do
- cd back to root
cd ~
- Run the
htop
command (you may need to install htop, which you can do by executing apt install htop
)
- Look for a process called:
./sugarchaind -daemon
- Press F9 then enter to end the process.

- Once the process has been killed, press F10 to exit.
- Then cd back to wallet folder:
cd sugarchain-0.16.3/bin
- Again, run:
./sugarchaind -daemon

- Let wallet sync. (To check, execute:
./sugarchain-cli -rpcuser=(rpcuser) -rpcpassword=(rpcpassword) getblockcount
)

Step 4: Downloading Miner
This step is similar to what you would normally do in GUI, but with few more steps
- cd back to root
- Download miner and build miner by executing:
apt-get install -y \
build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake zlib1g-dev && \
git clone https://github.com/cryptozeny/cpuminer-opt-sugarchain.git && \
cd cpuminer-opt-sugarchain && \
./build-yespower.sh && \
./cpuminer --cputest
and press enter

- Let miner download and build

Step 5: Running miner
Before we start mining we need to get a wallet address. This can be simply done by doing cd /root/sugarchain-0.16.3/bin
and running ./sugarchain-cli -rpcuser=(same as rpcuser) -rpcpassword=(same as rpcpassword) getaccountaddress ""

- Once you have wallet address, cd back to
cpuminer-opt-sugarchain
and run:
./cpuminer -a yespower -o http://127.0.0.1:34229/ --no-longpoll -u (rpcuser) -p (rpcpassword --coinbase-addr=(Your sugar address) -t1 (increase for more hashpower)

- Congrats, you are solo mining