BurstCoin Mining, Single USB HDD, Raspberry Pi
[UNDER CONSTRUCTION] In Final Stages
Small plot passed testing+mining. Larger plot currently transferring, results to follow.
Feedback required at this stage. See something that can be improved?
https://www.reddit.com/r/burstcoin/comments/810e3h/full_guide_check_out_my_raspberry_pi3_burst/
See the HARDWARE tab for parts list and assembly/build information
Latest Update 28th Feb 2018
Introduction:
(Very grossly simplified)
BurstCoin mining works very differently to Proof-of-work mining used in Bitcoin and most others. Burst uses proof of capacity. For the Raspberry Pi this is a good thing. The Pi and most other single board computers are immensely under-powered when it comes to comparing against CPU/GPU or ASIC rigs commonly used elsewhere in the industry. And CPU/GPU or purpose built chips are reasonably expensive.
Burst uses storage devices for it's proof of capacity system, and as such for the Pi are easy to add/upgrade and comparatively cheep against GPUs.
Ordinarily proof-of-work mining systems in Bitcoin involve a device (CPU/GPU/ASIC) crunching very large numbers, and miners compete against each other to generate a solution first. The first to have their solution accepted gets the reward.
Burst approaches this by pre-generating "solutions" and storing them on hard-drives. Then when the miner is asked to solve the problem it instead looks for the solution. The first person to find it gets the reward.
This intro is relevant because you must remember the Pi is a very low powered machine typically not well suited to intensive tasks. The generation of those solutions to store on the Hard drives, (know as Plotting to Burst miners) is an intensive task, and at this time I have not found a way to achieve this with the Raspberry Pi. This can however be done on a conventional Pc and these solutions (Plots) are then copied onto the Pi for mining. This will be shown in the guide, step-by-step, it's not difficult.
Therefore this guide contains the following necessary steps:
Some of these tasks can be done simultaneously to reduce the amount of time waiting for a process to finish.
Latest Update 28th Feb 2018
Introduction:
(Very grossly simplified)
BurstCoin mining works very differently to Proof-of-work mining used in Bitcoin and most others. Burst uses proof of capacity. For the Raspberry Pi this is a good thing. The Pi and most other single board computers are immensely under-powered when it comes to comparing against CPU/GPU or ASIC rigs commonly used elsewhere in the industry. And CPU/GPU or purpose built chips are reasonably expensive.
Burst uses storage devices for it's proof of capacity system, and as such for the Pi are easy to add/upgrade and comparatively cheep against GPUs.
Ordinarily proof-of-work mining systems in Bitcoin involve a device (CPU/GPU/ASIC) crunching very large numbers, and miners compete against each other to generate a solution first. The first to have their solution accepted gets the reward.
Burst approaches this by pre-generating "solutions" and storing them on hard-drives. Then when the miner is asked to solve the problem it instead looks for the solution. The first person to find it gets the reward.
This intro is relevant because you must remember the Pi is a very low powered machine typically not well suited to intensive tasks. The generation of those solutions to store on the Hard drives, (know as Plotting to Burst miners) is an intensive task, and at this time I have not found a way to achieve this with the Raspberry Pi. This can however be done on a conventional Pc and these solutions (Plots) are then copied onto the Pi for mining. This will be shown in the guide, step-by-step, it's not difficult.
Therefore this guide contains the following necessary steps:
- Obtain a Burst wallet on your Pc to hold your mined coins.
- Use this wallet to activate the account, (we'll need 1 Burst coin from somewhere).
- Generate the "Plot" on the Pc/laptop, and copy it to the Pi
- Install the CreepMiner on the Raspberry Pi3 and configure it to Mine
Some of these tasks can be done simultaneously to reduce the amount of time waiting for a process to finish.
Step (1) Downloading a Wallet
For this head over to https://www.burst-coin.org/download-wallet and download their Qbundle for your operating system. They also have guides there on how to get started with the absolute basics of saving your passphrase etc. There are other ways to start this project off, but this appears to be the most beginner friendly as it also includes the "Plotting" software we will need to use later.
For this head over to https://www.burst-coin.org/download-wallet and download their Qbundle for your operating system. They also have guides there on how to get started with the absolute basics of saving your passphrase etc. There are other ways to start this project off, but this appears to be the most beginner friendly as it also includes the "Plotting" software we will need to use later.
Step (2) Plotting
At the top of that wallet main page, is the drop-down "Tools" menu. Within that list is "Plotter". Follow the instructions to install Xplotter when prompted, (may be later when you click "start") . You'll then be presented by something like whats in the screenshot to the right. Now you'll need to make the plot that is going to be moved onto the Pi but made on your Pc. My Pi project/testing device I'm using to make this has a 300GB HDD. So for this I made a 250GB plot to leave room for the operating system and other files. **Note, I would recommend also making a 1GB plot to use as a test. Once you confirm the Pi software is correct and does mine, then progress to your intended large plot. Make your large plot first. Move the slider to choose the plot size you want. Then select a folder to store this plot in the top-most box. And finally on the left of your wallet left-click below where is says "no name set" and and address. It will bring up the menu I'm showing. Click "Copy Numeric Account ID" and paste this into the associated box in the plotter. |
https://www.burst-coin.org/creating-and-discovering-your-first-burst-account
For further reading this is what I followed on my first wallet. Later we will need at least one Burst coin to "activate" the account. Then click "start plotting" The time it takes is entirely dependent on the plot size you are creating and Pc specs. Be patient. Meanwhile with the wallet synchronizing and the plotter plotting we can do other steps... |
Step (3) Preparing the Pi
Because all the preparation steps are the same for all nodes here, I have made a beginner friendly guide with images, step-by-step. "Getting started" Link opens a new window
Getting Started
You will for this project need WinSCP from that guide.
Then continue below...
Because all the preparation steps are the same for all nodes here, I have made a beginner friendly guide with images, step-by-step. "Getting started" Link opens a new window
Getting Started
You will for this project need WinSCP from that guide.
Then continue below...
Step (4) Enabling WiFi
Wifi is available once the Pi is rebooted. Either reboot now using
sudo reboot and remove the ethernet cable. Or continue, and reboot later as it is required after the next step. |
With the Pi turned on, booted and you logged in with SSH we can start the setup.
First WiFi network connections are stored: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf Go to the bottom of the file and add the following text: network={ ssid="YOUR WIFI ROUTER NAME" psk="YOUR WIFI ROUTER PASSWORD" } **Note: Enter details between the quotes, leave the "" in save and exit using ctrl+O Then 'enter' ctrl+X |
Step (5) Expand the file system, (making full use of the SD card) and changing the Password.
|
enter:
sudo raspi-config The default password for obvious security reasons should be changed. That is done in this menu. select "1 change user password", and follow the on-screen instructions. This will be the new password when using PUTTY to SSH into the Pi. Because we installed a 2GB image onto the card, the Pi may think that the card is only 2GB in size. So we tell it to expand the file-system (returns it to it's full size allowed): select "7 advanced options" select "A1 expand filesystem" select 'finish' system will reboot, (remove the ethernet cable if you didn't at the previous step). And log back in with SSH and PUTTY once reboot is complete. |
Step (6) Updates
The image we downloaded may have an update or two since they released it:
sudo apt-get update
sudo apt-get upgrade
select 'y' to accept the storage requirement.
The image we downloaded may have an update or two since they released it:
sudo apt-get update
sudo apt-get upgrade
select 'y' to accept the storage requirement.
Step (7) Moving everything to the USB drive
People have been making projects (not just nodes) on the raspberry pi for some time. A common failure point seems to be the SD cards. The constant read/write process 24/7 drastically shorten their life. We can reduce this by moving the entire file-system to the USB drive, and where possible using traditional platter HDDs. Check out the 'HARDWARE' section for cheap solutions available to the Raspberry Pi.
For moving the file-system we need the "git" repository
sudo apt-get install git
Insert the USB drive if you havn't already, then check if it is mounted to the Pi.
sudo lsblk
99% of the time it will be mounted as /dev/sda with a partition called sda1. However if it has found sda1 it won't let us continue until it is unmounted. (It would be telling it to make changes to the filesystem whilst it's in use. It won't let us and doesn't like it). So we unmount with
umount /dev/sda1
We need to delete this partition to stop raspbian from automatically using the drive on boot, at this point. The helper in the next step will automatically create a new partition to do it's job of moving the files.
sudo fdisk /dev/sda
d
(deletes old partition)
w
(writes and commits the changes)
Now it's compatible with the helper script.
The folks at Adafruit have made a very useful helper to reduce the amount of commands you need. These next three lines create a new partition and move the entire file system onto the USB drive. It does warn you that any data currently written to /sda will be overwritten. If you are an advanced user and have called the partition something other than /sda, this is where it should be changed.
git clone https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper.git
cd Adafruit-Pi-ExternalRoot-Helper
sudo ./adafruit-pi-externalroot-helper -d /dev/sda
It will ask you to check that you are writing to the correct partition, select y when you are sure. When I do this step it takes a little under 10mins. Please be patient.
People have been making projects (not just nodes) on the raspberry pi for some time. A common failure point seems to be the SD cards. The constant read/write process 24/7 drastically shorten their life. We can reduce this by moving the entire file-system to the USB drive, and where possible using traditional platter HDDs. Check out the 'HARDWARE' section for cheap solutions available to the Raspberry Pi.
For moving the file-system we need the "git" repository
sudo apt-get install git
Insert the USB drive if you havn't already, then check if it is mounted to the Pi.
sudo lsblk
99% of the time it will be mounted as /dev/sda with a partition called sda1. However if it has found sda1 it won't let us continue until it is unmounted. (It would be telling it to make changes to the filesystem whilst it's in use. It won't let us and doesn't like it). So we unmount with
umount /dev/sda1
We need to delete this partition to stop raspbian from automatically using the drive on boot, at this point. The helper in the next step will automatically create a new partition to do it's job of moving the files.
sudo fdisk /dev/sda
d
(deletes old partition)
w
(writes and commits the changes)
Now it's compatible with the helper script.
The folks at Adafruit have made a very useful helper to reduce the amount of commands you need. These next three lines create a new partition and move the entire file system onto the USB drive. It does warn you that any data currently written to /sda will be overwritten. If you are an advanced user and have called the partition something other than /sda, this is where it should be changed.
git clone https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper.git
cd Adafruit-Pi-ExternalRoot-Helper
sudo ./adafruit-pi-externalroot-helper -d /dev/sda
It will ask you to check that you are writing to the correct partition, select y when you are sure. When I do this step it takes a little under 10mins. Please be patient.
This is our drives labels and addresses. We need to check that the PARTUUID long number (that's the USB), is entered into
sudo nano /boot/cmdline.txt |
So everything has been copied over and the drive configured. We just need to change the boot file so it starts from the USB drive from now on. The helper untility should have done this automatically. But recently this has not been the case. Do this just to check, it's simple and is just a copy/paste action. sudo blkid -o export /dev/sda1 The numbers will be different but it brings up something like the image on the left. |
Enter:
sudo nano /boot/cmdline.txt And ensure that the helper has changed root=PARTUUID= to match the one that was listed to you above. Yours will be different to mine. Then Save and exit using ctrl+o then ctrl+x. Do another reboot with sudo reboot and when the Pi starts this time your USB activity light will blink like crazy, showing it's now getting it's data from there. |
Step (8) Installing Burst Software
More dependencies: **The full poco library may be unnecessary/excessive, I will do a re-build to confirm**
sudo wget https://pocoproject.org/releases/poco-1.8.1/poco-1.8.1.tar.gz
sudo tar xvf poco-1.8.1.tar.gz
cd poco-1.8.1
sudo ./configure
sudo make
Again this one takes a while, ~60mins
sudo wget https://pocoproject.org/releases/poco-1.8.1/poco-1.8.1.tar.gz
sudo tar xvf poco-1.8.1.tar.gz
cd poco-1.8.1
sudo ./configure
sudo make
Again this one takes a while, ~60mins
Step (9) Making CreepMiner
There are no pre-compiled versions of CreepMiner that I could find for a Raspberry Pi3, however an advantage of this slightly longer installation is that it gives a much higher success rate with installation wth many different types of single board computers. Not just the Pi. First: cmake CMakeLists.txt -DMINIMAL_BUILD=ON Then: make |
This process takes a few minutes more, showing it's progress.
Step (10) Moving the Plot to the Pi
So by this time the plot may have been created on the Pc. If it has we can continue...
So by this time the plot may have been created on the Pc. If it has we can continue...
With WinSCP open and logged in you can view it in the following way:
In the left column navigate to where your plot is located on the Pc. In the right (main box) Navigate to "/home/pi" on the Raspberry Pi. WinSCP then makes it a simple drag and drop. Drag the entire plot folder to the Pi. This again will take some time dependent on the size of the plot. I suggest moving your small test plot first and move the larger one in the background. |
Step (11) Configure CreepMiner
Force the Miner to make a failed start, (this will generate it's config file and associated folder). cd creepMiner cd bin ./creepMiner then (after the error) nano /home/pi/.creepMiner/1.7.16/mining.conf And ammend "plots" and "urls" to something similar on the right. An explanation: |
https://github.com/Creepsky/creepMiner/wiki/Setting-up-the-miner
Gives information on how to enter the Pool address under "url"
It also shows how to add the "plots"
"plots" takes the format of the screenshot, however yours will be /home/pi/"NAME_OF_PLOT_FOLDER_COPIED_FROM_PC"
Multiple plots can be pathed using the format from creepMiner wiki.
The URL Information for the pool was sourced from
https://0-100-pool.burst.cryptoguru.org/
At the bottom of their page their is a "config" tab. There are directions for the URL.
Nearly all sorted. That's the bulk of the hard work done.
Gives information on how to enter the Pool address under "url"
It also shows how to add the "plots"
"plots" takes the format of the screenshot, however yours will be /home/pi/"NAME_OF_PLOT_FOLDER_COPIED_FROM_PC"
Multiple plots can be pathed using the format from creepMiner wiki.
The URL Information for the pool was sourced from
https://0-100-pool.burst.cryptoguru.org/
At the bottom of their page their is a "config" tab. There are directions for the URL.
Nearly all sorted. That's the bulk of the hard work done.
For confidence you can perform a quick test as I did by using a small 1GB plot to identify errors without wasting loads of time if there are.
Step (12) Activating the Wallet
This is so your mining rewards go to the pool to distribute back to the miners. This activation costs 1 Burst coin to broadcast it onto the network. It also takes 4 blocks to confirm, which translates to a few minutes.
Load your wallet with at least 1 Burst Coin and sync your wallet fully for this stage.
Then navigate to http://localhost:8125/rewardassignment.html
This is so your mining rewards go to the pool to distribute back to the miners. This activation costs 1 Burst coin to broadcast it onto the network. It also takes 4 blocks to confirm, which translates to a few minutes.
Load your wallet with at least 1 Burst Coin and sync your wallet fully for this stage.
Then navigate to http://localhost:8125/rewardassignment.html
And do as it says...
The reward recipient will be the pool, and they will instruct you of the address, usually on their page where the url details were for the miner.config earlier.
The secret passphrase is needed to confirm the transaction.
This "website" is hosted on your localmachine, nothing funny going on.
Once we're confirmed and activated, go back to your Pi and initiate the Miner. Adjust to the larger plot if necessary.
Happy Mining!!
The reward recipient will be the pool, and they will instruct you of the address, usually on their page where the url details were for the miner.config earlier.
The secret passphrase is needed to confirm the transaction.
This "website" is hosted on your localmachine, nothing funny going on.
Once we're confirmed and activated, go back to your Pi and initiate the Miner. Adjust to the larger plot if necessary.
Happy Mining!!