DMDv3 Wallet Compilation Guide for Raspberry Pi (Headless Mode), October 2017

More info here: bit.diamonds 

Dmdv3 wallet compilation guide for raspberry pi (headless mode), october 2017

1.

Disclaimer

1.This guide will walk you through the compilation steps of a headless DMD client. That means you won�t have a GUI, just the console version of the wallet (also called rpc wallet). If you are not comfortable with the command line, you may give up on the idea of using the Pi altogether, and opt for a fully featured PC instead (Linux, Mac, or Windows based) with enough resources to run a fully fledged QT wallet.

2.Once compiled, the wallet can be used for holding DMD funds, coin staking, or to setup a masternode. The specifics for running such variation will not be presented here, and should be obtained at bitcointalk.org, bitdiamonds website, or the Slack Diamond group.

3.The compilation process described herein was based on the Broadcom BMC2835 (ARMv6) architecture, available in the following Pi models: 2, B, B+, A, A+, zero, and zero W.

4.Newer Pi models based on the BMC2836 (Pi2) and BMC2837 (Pi3) architectures are supposed to be backwards compatible, and therefore should also be capable of compiling the wallet, as long as the recommended Raspbian OS version and software packages described in this guide are used.

5.Although Pi models with 256Mb RAM should be equally capable of compiling the wallet, the process can be very lengthy and may take several hours, or even days.

6.This document will guide you in the installation of the wallet, nothing more. It is not, and does not intend to be, an official wallet release. The author of the guide or the DMD Development Team should NOT be held responsible for any loss of DMD funds as a consequence of improper wallet compilation. In short, use the guide at your own risk!

7.As a safety measure, it is strongly recommended that you make transfer tests with smaller coin amounts to ensure you have a fulling working wallet, prior to managing larger DMD amounts.

8.If you enconter any dificulties along the compilation process, please PM user shinebright on DMD�s Slack group, and I�ll be glad to help you anyway I can. Please note that I�m no TI expert, just a DMD user with lots of interest in low power consumption staking with the most solid and rewarding cryptocoin!

2.

Hardware requirements

- Raspberry Pi with 512mb RAM (models B and above)

- Power cable (5V, 2A minimum recommended)

- SD card with minimum 8Gb capacity

- Monitor with suitable connection interface, depending on your Pi model (required for initial setup)

- USB Keyboard (required for initial setup)

3.

System requirements

- Raspbian Jessie Lite

Warning: The latest version of Raspbian (Stretch) is not recommended due to potential Boost library version conflicts. If you have Raspbian this version already installed, you are welcome to try compiling DMD wallet anyway, but results are not granted.

4.

Download Raspbian Jessie Lite

You can find the latest stable version of Raspbian Jessie Lite here:

downloads.raspberrypi.org

Note that Raspbian Lite is the console-only version of the OS, with a very small footprint (ideal to be run in headless mode).

5.

Burn the OS into the SD Card

For this step, I recommend that you follow Raspberry Pi�s official tutorial at

raspberrypi.org

There you can find detailed instructions for 'burning' the image into the SD card, on various host operating systems (Window, Linux or Mac).

6.

Boot Raspbian Jessie Lite

- Insert the SD card with Jessie Lite (obtained in step 5) into your Pi.

- Plug in your keyboard and monitor.

- Connect the ethernet cable (make sure you have a working internet connection).

- Plug the power cable to the Pi, and wait for the onscreen boot process to finish.

- Log in as the default pi user:

- username: pi

- password: raspberry

7.

Create a new username and password

As a safety precaution, you should create a new user, since the default pi's username and password are too common.

Create a new user

 CODE

sudo adduser USERNAME

Replace USERNAME with whatever name you desire. You will be asked to provide a password. Make sure to create a strong one, since this user account will harbor all your DMD coins.

Give superuser (sudo) priviledges to the new user

 CODE

sudo usermod -aG sudo USERNAME

Log in into the new account, typing your new password when prompted

 CODE

su - USERNAME

8.

Initial setup

If you intend to connect the Pi via wifi, go to step 9. Otherwise, skip to step 10 (ethernet only).

9.

Setup wifi connection

Edit the network interfaces file

 CODE

sudo nano /etc/network/interfaces

Add this to the first line

 CODE

auto wlan0

And add the following to the end of the file

 CODE

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Configure wpa_supplicant

 CODE

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add the following to end of the file

 CODE

network={
ssid="NETWORK_SSID"
psk="NETWORK_PASSWORD"
}

Reboot the Pi

 CODE

sudo reboot

After the boot has finished, login again (please use your NEW username for this, not 'pi') and your Pi should connect automatically to the wifi network.

Additional security-related configuration steps can be found here: raspberrypi.org

10.

Get your IP address

Get your local IP address

 CODE

ifconfig

Among the results, you should see a line in the following format

 CODE

inet addr:192.168.0.10

That's your IP address. Save it for the next step.

If you want to use the Pi as a headless client, go to step 11. On the other hand, if you want to use it as a regular desktop computer with keyboard and monitor, you may skip to step 12.

11.

Remote connect to the Pi

You may now unplug any peripherals (keyboard, display) and establish a remote connection to the Pi via terminal (Mac or Linux) or putty (Windows). You can download putty here: putty.org.

From now on, all the steps assume that you are in a console environment, regardless of the your main computer operating system, and that the Pi is connected to the network, either via wifi or ethernet cable. All the commands should now be issued on your main computer, not on the Pi (except for those using it as a regular desktop computer).

Open terminal (Mac or Linux) or putty (Windows) and connect to the Pi via ssh

 CODE

ssh USERNAME@ADDRESS

Where ADDRESS is the IP address obtained in step 11. Once the connection has been established, go to step 12.

12.

Create a swap file

Since compilation requires a lot of RAM (Pis are rather limited in this regard), you will need to create a swap file. A swap size of 1024Mb is recommended, regardless of the amount of RAM your Pi has.

Check available swap size

 CODE

free -m

If your swap is around 1024 mb, you're fine. Otherwise, you need to change it

 CODE

sudo nano /etc/dphys-swapfile

Change the swap size:

 CODE

CONF_SWAPSIZE=1024

Turn swap on

 CODE

sudo dphys-swapfile swapon

Reboot the Pi. Issue `free -m` again to confirm swap size has changed.

13.

Install dependencies

Once the boot process has finished, you will need to update the system

 CODE

sudo apt-get update

Next, you need to install the compilation dependency packages

 CODE

sudo apt-get install git automake build-essential libtool autotools-dev autoconf pkg-config libssl-dev libboost-all-dev libminiupnpc-dev

14.

Download DMD v.3.0.13 wallet from GitHub

Navigate to your home directory

 CODE

cd

Clone the DMD wallet into your home folder

 CODE

git clone https://github.com/DMDcoin/Diamond.git

This will create the Diamond folder inside your home directory

15.

Compile the wallet

Navigate to the Diamond folder

 CODE

cd Diamond

Compile Diamond

 CODE

./autogen.sh
./configure --with-incompatible-bdb
make

This runs the GCC compiler. If everything goes smoothly, you should now have a compiled wallet.

IMPORTANT: Jessie Lite comes bundled with Berkley DB 5.3. It is important to note that, although your wallet.dat file will be portable accross different operating systems, it will only be compatible with DMD wallets that have been compiled with this specific BDB version.

16.

Disable the swap file

After compilation, the swap file will not be needed anymore, so we need to disable it

 CODE

sudo swapoff -a

17.

Initiate the wallet

Type

 CODE

./diamondd

You should get the following message `DMD server starting`

Since this is the first time the wallet is iniated, the Diamond wallet configuration folder (.DMDV3) will be freshly created with all configuration files inside. You can now stop the wallet by hitting Control + C (full blockchain synching will be performed later).

18.

Edit the config file

Navigate to the .DMDV3 folder

 CODE

cd
cd .DMDV3

Open the diamond.conf file

 CODE

sudo nano diamond.conf

The document should be blank. Add the following text to it:

 CODE

rpcuser=DMDUSERNAME
rpcpassword=DMDPASSWORD
rpcport=17772
rpcallowip=127.0.0.1
listen=1
daemon=1
server=1
noirc=1
staking=0
maxconnections=24
addnode=94.100.221.211
addnode=94.130.107.224
addnode=94.130.107.225
addnode=94.130.107.227
addnode=94.130.99.25
addnode=94.177.230.81
addnode=94.197.121.95
addnode=95.18.83.207
addnode=96.37.74.144
addnode=96.38.137.224
addnode=96.39.182.63
addnode=96.39.253.106
addnode=96.60.68.148
addnode=98.146.162.121
addnode=99.192.81.50
addnode=99.21.69.25

Where DMDUSERNAME and DMDPASSWORD can be any characters you want. You do not need to save or store these values, they are only required for wallet runtime.

Exit the file by hitting Control + X (type �y� for saving and then ENTER)

If you need the most recent node list, please check: chainz.cryptoid.info

19.

Synchronize to DMD's blockchain

Run the daemon

 CODE

cd
cd Diamond/src
./diamondd

You should get the message:

 CODE

DMD server starting

Run 'top' to verify resources usage

 CODE

top

Find diamondd (diamond daemon) in the table. It should be consuming most of your Pi�s CPU. This is actually expected, since the wallet should now be synchronizing the blockchain.

At this stage, you should wait for the blockchain to be fully downloaded. You will be able to verify this when a dramatic drop in CPU usage happens (from 90% to 5%, for instance). That means the wallet has been fully sync'ed. When that happens, hit Control + Z to exit 'top'.

P.S. The time required for full synchronization depends on your system, internet connection and blockchain size.

20.

Check wallet information and blockchain synchronization status

Check wallet info

 CODE

./diamond-cli getinfo

This will show your wallet general info, including wallet version, total balance, and blocksize. If you get an error message, wait a few minutes and try again.

21.

Check receiving address

Type

 CODE

./diamond-cli getaddressesbyaccount ""

This will show you a public key (address) generated at wallet creation time.

22.

Double-checking receiving address

Type

 CODE

./diamond-cli validateaddress <ADDRESS>

You should get:

 CODE

isvalid=true and ismine=true

among the results

This informs that the address belongs to your wallet and can be used to receive funds.

23.

Encrypt the wallet

Type

 CODE

./diamond-cli encryptwallet <YOURPASSPHRASE>

This may take a few seconds. Make sure you choose a strong, long passphrase. Be careful to secure the passphrase somewhere safe. If you loose it, you will not be able to open the wallet anymore and all your funds will be lost forever. Note that the encryptwallet parameter will not be available anymore after passphrase creation.

24.

Backup your wallet into your Main Computer

Check if the blockchain is fully sync'ed, by verifying if the block number matches the latest found here: chainz.cryptoid.info

If you're using the Pi as a desktop computer with monitor and keyboard, all you have to do is copy the wallet.dat file from the .DMDV3 folder into a pendrive and secure it in a safe place.

If using the Pi as headless client with a Mac or Linux main computer, you will use 'scp' to copy files over the network. This software should be previously installed in most Mac and Linux distributions

 CODE

scp USERNAME@ADDRESS:~/.DMDV3/wallet.dat ~/

This will copy wallet.dat to your home folder

If using a Windows PC, first you need to download pscp from the putty homepage: chiark.greenend.org.uk

After installation, you should be able to transfer your wallet file over the network to your main computer

 CODE

pscp USERNAME@ADDRESS:~/.DMDV3/wallet.dat C:\Users\YOURNAME\Downloads\

This will copy wallet.dat to your Downloads folder (make sure you replace YOURNAME by your windows username). Remember to secure the file in a safe place afterwards.

After backup, you can now start transfering funds to you wallet!

25.

Staking

If you wish to stake, you first need to stop the client.

 CODE

cd
cd .DMDV3
./diamond-cli stop

Open the diamond.conf file

 CODE

sudo nano diamond.conf

Change the line

 CODE

staking=0 to staking=1

Exit the file by hitting Control + X (type �y� for saving and then ENTER)

Restart the client and unlock the wallet for staking

 CODE

cd
cd Diamond/src
./diamondd
./diamond-cli walletpassphrase YOURPASSPHRASE 600000000

The long number is the parameter for setting the time (in seconds) that the wallet will be unlocked for staking

26.

Additional wallet commands

If will need to know additional commands to transfer funds and manage the wallet. There are 2 diffferent help parameters that can be used, which spit out different results, all self-informative

 CODE

diamond-cli help
diamond-cli --help

Enjoy your DMDv3 wallet and happy staking!

If you find this guide helpful and wish to donate, here is my DMD address: dEDEPoPDcf6RhABkEXttPzzwBX5SMTjiYU





go top