Install LanaCoin Wallet Server on Ubuntu

Here’s a clear, step-by-step guide to compile and run the LanaCoin wallet/node/server on the latest Ubuntu Server, including basic configuration and security recommendations:


1. Install Latest Ubuntu Server

  • Download the latest Ubuntu Server ISO from https://ubuntu.com/download/server.
  • Install it on your machine or VPS following the installer prompts.
  • During installation:
    • Set a strong password for your user.
    • Enable OpenSSH if you plan to manage remotely.

2. Update and Secure the System

Run these commands after installation:

sudo apt update && sudo apt upgrade -y
sudo apt install ufw fail2ban -y

 

Configure firewall (UFW):

sudo ufw allow ssh
sudo ufw allow 7506/tcp   # LanaCoin default port

 

Enable Fail2Ban for SSH protection:

sudo systemctl enable fail2ban
sudo systemctl start fail2ban

 


3. Install Required Build Dependencies

sudo apt-get install build-essential libssl-dev libdb++-dev libboost-all-dev git -y


4. Download LanaCoin Source

cd ~
git clone https://github.com/LanaCoin/lanacoin.git
cd lanacoin/src

 


5. Compile LanaCoin Daemon

Use make with UPnP disabled:

make -f makefile.unix USE_UPNP=-
# For faster build on multi-core systems:
make -f makefile.unix USE_UPNP=- -j4

 


6. Install the Binary

sudo cp lanacoind /usr/local/bin/


7. Configure LanaCoin

Create configuration directory and file:

cd ~
mkdir .lanacoin
nano .lanacoin/lanacoin.conf

 

Add these lines to lanacoin.conf:

server=1
daemon=1
rpcuser=yourusername
rpcpassword=yourstrongpassword
rpcallowip=127.0.0.1


(Optional: Add rpcport=5706and port=XXXX if you want custom ports.)


8. Start LanaCoin Node

lanacoind


9. Monitor Logs

 


Extra Security Tips

  • Disable root SSH login:\ Edit /etc/ssh/sshd_configPermitRootLogin no
  • Use SSH keys instead of passwords.
  • Regularly update system:\ sudo apt update && sudo apt upgrade -y

✅ This will give you a running LanaCoin node on Ubuntu Server.\ Do you also want instructions for enabling RPC and connecting a wallet or mining setup? Or should I include systemd service configuration so the node starts automatically on reboot?

 

Here’s how to enable RPC for LanaCoin and make it accessible for wallet connections or automation:


1. Edit lanacoin.conf for RPC

Open the configuration file:

nano ~/.lanacoin/lanacoin.conf

Add or update these lines:

server=1
daemon=1
rpcuser=yourusername
rpcpassword=yourstrongpassword
rpcallowip=127.0.0.1
rpcport=5706
port=7506


Explanation:

  • rpcuser and rpcpassword: Required for authentication.
  • rpcallowip: Restricts RPC access to localhost (safe default).\ If you need remote access, add your client’s IP (e.g., rpcallowip=192.168.1.100).
  • rpcport: Default is 5706. Change if needed.
  • port: Default P2P port is 7506.

2. Restart LanaCoin Daemon

lanacoind stop
lanacoind

 


3. Test RPC Locally

Use curl to check:

curl –user yourusername:yourstrongpassword –data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getinfo”,”params”:[]}’ -H ‘content-type:text/plain;’ http://127.0.0.1:5706/

 

You should see JSON output with node info.


4. Secure RPC

  • Never expose RPC to the internet without protection.
  • If remote access is needed:
    • Use a VPN or SSH tunnel.
    • Or bind RPC to a private network IP only.
  • Consider adding rpcbind=<your-server-ip> in lanacoin.conf if you want to allow specific IPs.

Optional: Enable Auto-Start with systemd

Create a service file:

sudo nano /etc/systemd/system/lanacoin.service

Add:

[Unit]
Description=LanaCoin Daemon
After=network.target

[Service]
ExecStart=/usr/local/bin/lanacoind -daemon
ExecStop=/usr/local/bin/lanacoind stop
Restart=always
User=<your-username>

[Install]
WantedBy=multi-user.target


Enable and start:

sudo systemctl enable lanacoin
sudo systemctl start lanacoin

 


✅ Now your LanaCoin node supports RPC for wallet integration or automation.

Here are some common LanaCoin RPC commands you can use once RPC is enabled. These examples use curl for direct calls, but you can also script them in Python or Bash.


1. Check Node Info

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getinfo”,”params”:[]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 

Returns: Version, balance, connections, block count.


2. Get Wallet Balance

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getbalance”,”params”:[]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 


3. Generate a New Address

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getnewaddress”,”params”:[“default”]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 

Tip: Replace "default" with a label for the address.


4. List All Addresses

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getaddressesbyaccount”,”params”:[“default”]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 


5. Send Coins

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”sendtoaddress”,”params”:[“recipient_address”, amount]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 

Example:

“params”:[“LanaCoinAddressHere”, 100.0]


6. Check Transaction by TXID

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”gettransaction”,”params”:[“txid_here”]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 


7. Get Blockchain Info

 

curl –user yourusername:yourstrongpassword \
–data-binary ‘{“jsonrpc”:”1.0″,”id”:”curltest”,”method”:”getblockchaininfo”,”params”:[]}’ \
-H ‘content-type:text/plain;’ \
http://127.0.0.1:5706/

 


Security Reminder

  • Never expose RPC to the public internet without a VPN or SSH tunnel.
  • Use strong rpcuser and rpcpassword.
  • Restrict rpcallowip to trusted IPs only.

Here’s an updated Bash script with extra RPC commands for mining and wallet management, so you can manage your LanaCoin node more completely:


lanacoin-cli.sh (Extended Version)

#!/bin/bash

 

# LanaCoin RPC credentials
RPCUSER=”yourusername”
RPCPASS=”yourstrongpassword”
RPCPORT=”5706″
RPCURL=”http://127.0.0.1:$RPCPORT/”

 

# Function to send RPC request
rpccall() {
    METHOD=$1
    PARAMS=$2
    curl –silent –user $RPCUSER:$RPCPASS \
        –data-binary “{\”jsonrpc\”:\”1.0\”,\”id\”:\”lanacoin\”,\”method\”:\”$METHOD\”,\”params\”:[$PARAMS]}” \
        -H ‘content-type:text/plain;’ $RPCURL
}

 

# Commands
case “$1” in
    info)
        rpccall “getinfo” “”
        ;;
    balance)
        rpccall “getbalance” “”
        ;;
    newaddress)
        rpccall “getnewaddress” “\”default\””
        ;;
    addresses)
        rpccall “getaddressesbyaccount” “\”default\””
        ;;
    send)
        if [ $# -ne 3 ]; then
            echo “Usage: $0 send <address> <amount>”
            exit 1
        fi
        rpccall “sendtoaddress” “\”$2\”, $3″
        ;;
    tx)
        if [ $# -ne 2 ]; then
            echo “Usage: $0 tx <txid>”
            exit 1
        fi
        rpccall “gettransaction” “\”$2\””
        ;;
    blockchain)
        rpccall “getblockchaininfo” “”
        ;;
    # — Wallet Management —
    unlock)
        if [ $# -ne 3 ]; then
            echo “Usage: $0 unlock <passphrase> <timeout>”
            exit 1
        fi
        rpccall “walletpassphrase” “\”$2\”, $3″
        ;;
    lock)
        rpccall “walletlock” “”
        ;;
    encrypt)
        if [ $# -ne 2 ]; then
            echo “Usage: $0 encrypt <passphrase>”
            exit 1
        fi
        rpccall “encryptwallet” “\”$2\””
        ;;
    dumpprivkey)
        if [ $# -ne 2 ]; then
            echo “Usage: $0 dumpprivkey <address>”
            exit 1
        fi
        rpccall “dumpprivkey” “\”$2\””
        ;;
    # — Mining Commands —
    startmining)
        if [ $# -ne 2 ]; then
            echo “Usage: $0 startmining <threads>”
            exit 1
        fi
        rpccall “setgenerate” “true, $2”
        ;;
    stopmining)
        rpccall “setgenerate” “false”
        ;;
    getmininginfo)
        rpc_call “getmininginfo” “”
        ;;
    *)
        echo “Usage: $0 {info|balance|newaddress|addresses|send|tx|blockchain|unlock|lock|encrypt|dumpprivkey|startmining|stopmining|getmininginfo}”
        ;;
esac

 


New Features

  • Wallet Managementencrypt <passphrase> → Encrypt wallet.
    • unlock <passphrase> <timeout> → Unlock wallet for sending/mining.
    • lock → Lock wallet immediately.
    • dumpprivkey <address> → Export private key for an address.
  • Miningstartmining <threads> → Start CPU mining with specified threads.
    • stopmining → Stop mining.
    • getmininginfo → Show mining status and difficulty.

Usage Examples

 

./lanacoin-cli.sh encrypt MyStrongPassphrase
./lanacoin-cli.sh unlock MyStrongPassphrase 60
./lanacoin-cli.sh startmining 4
./lanacoin-cli.sh stopmining
./lanacoin-cli.sh getmininginfo

 


✅ This script now covers RPC basics, wallet security, and mining control.