Htmlcoin on Raspberry Pi
Download Htmlcoin Linux 64
Changelog:
Upgrade to Debian Buster 10.4 release
Htmlcoin 0.19
Htmlcoin 64bit (Recommended from Raspberry Pi 2 - Raspberry Pi 4)
https://github.com/HTMLCOIN/HTMLCOIN/releases/download/v2.5.0/htmlcoin-2.5.0-linux64.tar.gz
Download Htmlcoin Linux 32
Htmlcoin 32bit
https://github.com/HTMLCOIN/HTMLCOIN/releases/download/v2.5.0/htmlcoin-2.5.0-linux32.tar.gz
The QT version works and is usable but you will find better performance with the "htmlcoind" version as it doesn't have a desktop, only command line.
Complete Walk Through
https://steemit.com/qtum/@cryptominder/qtum-staking-tutorial-using-qtumd-on-a-raspberry-pi-3
Pi Zero RAM restrictions
To ensure stability, you need to enable SWAP.
What is SWAP anyway?
SWAP enables "virtual memory", it uses a portion of your disk to store data that cannot be stored in RAM, this helps devices like the Pi Zero to continue running without crashing even if the applications are using more than the 512MB RAM included with the Pi Zero.
How do we enable SWAP?
Enabling SWAP on the Pi Zero is extremely easy:
Open up a terminal as shown on the screenshot below
Inside the terminal, type "sudo dphys-swapfile setup" and press enter
You'll see some text coming up, and a confirmation of your 2gb SWAP file being generated.Still inside the same terminal, type "sudo dphys-swapfile swapon" and press enter This won't give you any confirmation, however, your SWAP file has been setup and activated!. You only need to do this once, the Pi Will activate your SWAP file in case of a reboot/shutdown.
Here we can see that the SWAP file is active giving us a total of 2.42GB of RAM (SWAP and ZRAM included)
Installation of Htmlcoin
In order to launch Htmlcoin, we need to go install it.
Follow instructions on linux installation of Htmlcoin.
Syncing can take anything from a couple of hours to a day, please be patient.
Protecting access with a basic firewall
Well, our raspberry is only for staking, there's no need to have all those ports open, let's close everything we don't need and only allow access to necesary services.
First, let's install UFW (uncomplicated firewall) which is an easy-to-use interface for iptables
sudo apt install ufw
Once this is installed, we proceed with access permissions, we will define which ports will be accessible. Let's check first what's open:
sudo ufw status This should show something like this:
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
Ok so it's time to start closing down access, type the following:
sudo ufw default deny incoming
sudo ufw allow 3888/tcp
Here we've defined the basics, closing down everything except port 4888 and 4889 which are used by Htmlcoin to function.
If you're using SSH, it's recommended to only allow access from local network.
sudo ufw allow from 196.168.0.0/24 to any port 22
Binaries available on Raspberry Pi
htmlcoind
htmlcoin-cli
htmlcoin-qt
htmlcoin-tx
Launching Htmlcoin daemon
All we need to do to launch the Htmlcoin daemon is type: htmlcoind -daemon
As soon as you type this, the wallet will create the wallet.dat file among other files (if they’re not already there). The wallet will run and begin syncing instantly from the other Blockchain nodes, this can take a few hours to complete so you can go ahead and have some coffee and let it synchronize.
Launching Htmlcoin-Qt
If you're using Raspberry Pi desktop interface, all you need to do is navigate to the applications menu->other->htmlcoin-qt
Encrypting wallet
We can encrypt the wallet at any time, it's better to do it before we go any further.
To do this, type the following on the command line:
htmlcoin-cli encryptwallet yourpassword
This will encrypt the wallet which in turn closes the daemon, you'll see the following message:
wallet encrypted; Htmlcoin server stopping, restart to run with encrypted wallet. If you already backed up before encrypting, you need to make a new backup.
htmlcoin-cli getaccountaddress "" -> Right after launching the daemon, you can obtain your wallet address by typing this.
You can send Htmlcoin coins to the address we just obtained from the daemon, please remember that those transactions require at least 500+ confirmations before they become mature enough for staking.
Staking
Now that we've waited until we have at least 501 confirmations on our received transaction, we are eligible for staking, however, if our wallet is encrypted (which we did for security reasons) we won't be able to stake, let's open our wallet for staking using the command line!.
htmlcoin-cli walletpassphrase password 999999999 true
The above command will unlock the wallet for 31.6 Years! that should be enough for now. Please note, this will not unlock your backup, only the wallet that's running right now.
Now that we've unlocked our wallet, we need to wait until we have more than 501 confirmations to be eligible for staking, if we already do, it's a matter of time which will vary depending on the network weight vs your wallet's weight.
Checking Balance
To check your balance, type htmlcoin-cli getinfo this will show general information, including your available balance and balance in staking
Check transactions
To check your transactions (incoming and outgoing) type htmlcoin-cli listtransactions
Check staking info
To check Htmlcoin's staking information, type htmlcoin-cli getstakinginfo
Staking tips
Staking really depends on network weight vs your wallet’s weight which is based on the amount of coins you have, higher weight increases your chances of staking a block.
If you have a large amount of coins, it’s a good idea to split those up in separate transactions, for instance, if you have 10,000,000 HTMCOIN, it’s better to send 20 transactions of 500,000 HTM each to your wallet, each one generates a UTXO input which will take part in staking. This optimizes the staking process and works much better than just one large HTML input.
If you want to split your coins into different addresses inside your Rasbperry Pi wallet, type the following to obtain new addresses inside your wallet: htmlcoin-cli getnewaddress Each time you type this, you’ll get a new address, HTMLCOIN can generate any amount of addresses you want, but please keep in mind, if you do go over 100 new address, you might want to make a new backup of your wallet
How to backup to a separate device
Making a backup in Raspberry is simple, you only need to copy the wallet.dat file, but how do you export this to another device?
First, we'll download Filezilla, which is an easy to use and secure FTP/SFTP server
Installing is just like any other windows app.
When the installer finishes, we launch Filezilla and are greeted with this screen, let's proceed and add our previously created ssh-key
We go into Edit -> Settings -> SFTP. This will give us the following screen in which we will be able to import our SSH key.
Please note that Filezilla only accepts the private key which is created when the ssh-key was generated.
Here we've already added the ssh key, now we can log into our server
we enter our Raspberry Pi ip address + username (root in this case), leave a blank password because we're using ssh-key to login
Just press ok when prompted, and you'll be able to log in.
Here we can see the /root/ folder of our Raspberry Pi, this is where our wallet runs and has the wallet stored in /root/.htmlcoin we can go ahead and double click the folder which will show us the following:
Now all we need to do is scroll down to wallet.dat, right click and select download from the list. This will download the wallet.dat file to our computer, we've successfully backed up our Htmlcoin wallet!.
Editing Configuration File
How to edit the htmlcoin.conf configuration file.
Launch Terminal.
Change directories to the Htmlcoin data directory:
cd .htmlcoin (location home/pi/.htmlcoin for Linux install) or
cd /home/htmlcoin/.htmlcoin (default location for image install)Launch the editor, opening an existing or making a new configuration file:
sudo nano htmlcoin.confEdit configuration file, for example, enter
uacomment=Your_Htmlcoin_Address
addnode=104.236.105.31:4888
Press Control-O to write the file.
For “File name to write: htmlcoin.conf” press Enter.
Press Control-X to exit the editor.
Restart your Htmlcoin Core wallet to load the new configuration file.
Check the new settings. For Htmlcoin-Qt use Window – Information and check for your address in "User Agent":
For htmlcoind use the command getnetworkinfo and check for your address in "subversion":