Staking [PRiVCY Coin] with Raspberry Pi

in #privcy6 years ago (edited)

Screen Shot 2018-06-19 at 11.28.30 AM.png

Hardware Requirements

  1. Raspberry Pi 3 model B+ (1GB RAM)
  2. 32GB MicroSD Card

Step 1: Setting up Raspberry Pi OS

  1. Download the latest Raspberry Pi OS (Rasbian Stretch Lite) from the official website: https://www.raspberrypi.org/downloads/raspbian/

  2. Burn the OS to SD Card with Etcher.

  3. Now, to enable SSH for the OS, access the boot partition of the SD Card.

    sudo touch ssh
    
  4. Enable WiFi connection.

    sudo nano wpa_supplicant.conf
    
  5. Enter the following config

    country=GB
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
     ssid="<wifi name>"
     psk="<wifi password>"
    }
    
  6. Now, insert the SD card into Raspberry Pi then power on.

  7. Find the IP address from your router admin web panel.

  8. Connect to Pi for the first time

    ssh -p 22 pi@{IP-addresss}
    

Step 3: Hardening Raspberry Pi

  1. Configure Pi locale, to prevent warning messages and compilation errors.

    sudo raspi-config
    

  2. Don't forget to edit the locale file too.

    sudo nano /etc/default/locale
    
  3. Add the following content.

    LANG=en_US.UTF-8
    LC_ALL=en_US.UTF-8
    LANGUAGE=en_US.UTF-8
    
  4. Hardening security by adding a new user.

    sudo -i
    adduser <yourusername>
    adduser <yourusername> sudo
    
  5. Then reboot Pi.

    sudo reboot
    
  6. Then connect back as the new user

    ssh -p 22 <yourusername>@<ip-addresss>
    
  7. And delete the default Pi user

    sudo deluser pi
    sudo passwd root
    

Step 4: Configure Raspberry Pi

  1. Update Pi packages.

    sudo apt-get update 
    sudo apt-get upgrade
    
  2. Reboot the system.

    sudo reboot
    
  3. Install the required libraries.

    sudo apt-get install git qt5-default qt5-qmake qtbase5-dev-tools build-essential libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev build-essential libtool autotools-dev autoconf pkg-config libssl-dev libboost-all-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev autoconf openssl libssl-dev libevent-dev libminiupnpc-dev
    sudo apt-get install autotools-dev autoconf automake bsdmainutils build-essential git
    sudo apt-get install libtool libssl-dev libboost-all-dev pkg-config 
    sudo apt-get install libqrencode-dev libminiupnpc-dev libevent-dev libcap-dev libseccomp-dev
    
  4. Have a coffee, come back after 10 minutes.

Step 5: Install & Compile PRiVCY daemon

  1. The compilation for Raspberry Pi is not straightforward. Here's my handy script that:

    • Download the source for Github.
    • Compile required libraries.
    • Configure build files.
    • Compile daemon.
    • Copy daemon to home folder.

    You can check the content of the script here.

    wget "https://gist.github.com/stiucsib86/9eca3c814d5af2308d6d57f227d65f7f/raw/fed383f434d62dc5ae8ee214933f7c257c9d53c1/privcy-raspberry-pi.sh" -O privcy-raspberry-pi.sh
    chmod +x privcy-raspberry-pi.sh
    
  1. Run the script in background.

    sudo nohup ./privcy-raspberry-pi.sh &
    
  2. Come back after 2 hours.

Step 6: Setting up PRiVCY daemon for first-run

  1. Setup PRiVCY.conf to connect to the correct node

    nano ~/.PRiVCY/PRiVCY.conf
    
  2. Paste the following content.

    testnet=0
    listen=1
    server=1
    daemon=1
    maxconnections=90
    rpcuser=<YourIrrelevantUsername>
    rpcpassword=<YourIrrelevantPassword>
    rpcport=18580
    rpcconnect=127.0.0.1
    rpcallowip=127.0.0.1
    addnode=otwsvate4vvogbrt.onion:17770
    addnode=nufiijzpo7ac2k6u.onion:17770
    

    (Note: You should always double the check correct nodes from official Github Repo).

  3. Copy your wallet.dat and paste in ~/.PRiVCY/ folder.

Step 7: (Optional) Setting Startup Daemon

  1. You can setup cron to automatically start PRiVCY daemon when system boot up.

    mkdir ~/logs
    sudo crontab -e
    
  2. Append the following:

    @reboot sudo -u <yourUser> /home/<yourUser>/PRiVCYd >> /home/<yourUser>/logs/crontab.log 2>&1
    

    Note: The last part is to send all output to a log file so you can check that if you still have problems

Step 8: Done!

  1. Fire up PRiVCY daemon!

    cd ~
    ./PRiVCYd 
    
  2. Happy staking!

  3. Psst, don't forget to buy me coffee :D

    PRiVCY: PLxacTDxY5EYsTk2538s6nCbVGm4mqB74z

TODO

Sort:  

Congratulations @stiucsib86! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Wew fishballllls

Posted using Partiko Messaging