Title: Stratum Mining Proxy For Raspberry Pi Post by: elmohasacoin on December 28, 2013, 01:44:43 AM Hey all... I made a post on my photography website on how to install Stratum Mining Proxy on Raspberry Pi. For next year I want my website to only be my photography and video work so I am moving my posts to either a hosted wordpress account and here. So this is the post I made for running a mining proxy on a Raspberry Pi. Please forgive me if this is in the wrong place:
Honestly, when you have as many miners as I do sometimes setting them up gets annoying. Imagine having to setup 20 or more ASIC blades. Having your own stratum proxy not only makes setup easier but stratum improves pool performance. Advantages of stratum is: No more messages like “pool is not providing work fast enough” in miners, because work is produced locally by the proxy Extremely low stale rate (less than 0.1%, that means below 1 stale per 1000 accepted shares) Very low network bandwidth usage (around 10kB/minute) The best way to have your own proxy is to install it on a Raspberry Pi. They are inexpensive, low power and runs Linux. It doesn’t get any better than that. If you want more information about stratum read the great post on Slush’s website. http://mining.bitcoin.cz/stratum-mining The following tutorial is a modified version of Slush’s tutorial for the Raspberry Pi. What you will need: Raspberry Pi Model B SD Card With Linux installed(I recommend Occidentalis)http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/ (http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/) Case for Pi Ethernet Cable Power Cable Putty or SSH Softwarehttp://www.putty.org/ (http://www.putty.org/) Get the Raspberry Pi set up and running your OS. You can follow the tutorials at Adafruit. Preparing an SD Card for your Raspberry Pihttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/overview (http://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/overview) First Time Configurationhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview (http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview) Enable SSHEnable SSH (http://Enable SSH) Alright, now its time to get to the meat of the tutorial. Open putty or ssh software and connect to your Pi. From here on its copy and paste. Pretty easy. Lets start off with updating our Pi: Code: sudo apt-get update Code: git clone git://github.com/slush0/stratum-mining-proxy.git Code: cd stratum-mining-proxy Code: sudo apt-get install python-dev Code: sudo python distribute_setup.py Code: sudo nano setup.py Code: 'install_requires': ['setuptools>=0.6c11', 'twisted>=12.2.0', 'stratum>=0.2.11', 'argparse'], Code: 'install_requires': ['setuptools>=0.6c11', 'stratum>=0.2.11', 'argparse'], That will not install Twisted. You will not get an error saying you dont have enough space. Now, we install Twisted for Pi. Code: sudo apt-get install python-twisted Code: sudo python setup.py develop Code: sudo apt-get install screen Code: screen Lets get back into the directory: Code: cd stratum-mining-proxy Last but not least lets run the script*: Code: ./mining_proxy.py That’s all. All you need to do is change your miner settings. Point your miners to the Raspberry Pi ip address and port: Code: Example: 192.168.1.xx:8332 8332 is the default listen port. *The script is for Slush’s pool. Not all of us mine his pool. If you need to change it its pretty simple. Instead of running: Code: ./mining_proxy.py Run: Code: ./mining_proxy.py -o stratum.poolurl.com -p port -sp 3334 -gp 8332 Make sure you change “stratum.poolurl.com” to your pools URL and the port to the pool. For example I am on Zetpool. I am using: Code: ./mining_proxy.py -o us.stratum.zetpool.com -p 3333 -sp 3334 -gp 8332 To make it run at start up.. Code: cd stratum-mining-proxy Code: sudo nano miningserver.sh Code: #!/bin/bash The code runs the miningproxy at startup with the information for your pool... MAKE sure to change the dummy text with your pool info. Then press Code: Ctrl x. Code: Y Code: Enter This will save the file and exit the text editor. We are almost done. Now time to tell the system to start that command at startup. Code: sudo nano /etc/rc.local This is the boot file for linux. After Code: # By default this script does nothing. Code: exit 0 Type.. Code: cd stratum-mining-proxy Then press Code: ctrl-x. Code: Y Code: Enter Your pretty much done. Type... Code: sudo reboot That’s all folks. If you have any problems let me know. I will do my best to help. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: tom99 on December 28, 2013, 07:40:46 AM How to setup for Solo?
Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: novymivo on December 28, 2013, 09:42:41 AM Is this works with wifi as well >?
with minepeon i am loosing connection, and will not reconnect itself. ?? Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: vnhyp0 on December 28, 2013, 10:12:38 AM How does this method compare to using BFGMiner as the proxy for blades/cubes? I have had no issues using Minepeon + BFGMiner to make a proxy. I am just curious, as I do not fully understand the differences (does peon+bfg slow down with many units?) and have never had a reason to switch. Is it more efficient perhaps? Thank you!
Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: gigica viteazu` on December 28, 2013, 12:08:28 PM you have a lot more control with BFGMiner
tkx for the guide elmohasacoin Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: elmohasacoin on December 28, 2013, 11:44:53 PM How to setup for Solo? This is for POOLS that use stratum. Solo means no pool. So pretty much that I am aware of you can't do this solo mining. you have a lot more control with BFGMiner tkx for the guide elmohasacoin Correct. BFGMiner is modular and has more control on almost everything. The mining proxy from Slush is very basic. Its based on KISS(keep it simple stupid). It's very easy to set up. You pretty much set it and forget it. You can't really mess it up. Is this works with wifi as well >? with minepeon i am loosing connection, and will not reconnect itself.?? If your using the cheap usb wireless N adapter that is a known issue. If its not PM me. but here is a work around for that problem. In SSH Linux Wifi Tools: Code: sudo apt-get install wireless-tools Wifi Firmware: Code: apt-get install ralink-firmware Settings for adapter: Code: iwconfig Make sure power management is OFF. Code: lo no wireless extensions. Time to edit your interface settings: Code: sudo nano /etc/network/interfaces Make sure you have wireless power-off.. This is a example config: Code: iface lo inet loopback If that doesn't work do this: Code: sudo nano /usr/local/bin/wificheck.sh Copy and past this into it: Code: #!/bin/bash Give the file chmod of 755: Code: sudo chmod 755 /usr/local/bin/wificheck.sh Make sure the settings are correct for your network and adapter. Time to make it a cron job. Code: sudo crontab -e Add Code: * * * * * /usr/local/bin/wificheck.sh Code: Ctrl-O Code: Ctrl-X Let me know what happens. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: vnhyp0 on December 29, 2013, 03:33:40 AM you have a lot more control with BFGMiner tkx for the guide elmohasacoin Thank you both; nice guide and appreciate the quick response. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: greyw00lf on January 10, 2014, 01:12:35 PM Can this be used as a proxy for (remote) scrypt miners?
I have some CPU + GPU miners, can they connect via network to the RPi with that proxy? The RPi should submit their work to another scrypt-mining-pool. Is that possible? So basically: [GPU-/CPU-Scrypt-Miner] ------(Internet)------> [RPi=proxy] ------(Internet)-----> Scrypt-Mining-Pool Would that be possible with minepeon and bfgminer? Or with the option from elmohasacoin? Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: greyw00lf on January 11, 2014, 11:07:04 PM [GPU-/CPU-Scrypt-Miner] ------(Internet)------> [RPi=proxy] ------(Internet)-----> Scrypt-Mining-Pool anyone? :)Would that be possible with minepeon and bfgminer? Or with the option from elmohasacoin? Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 15, 2014, 05:49:48 PM "Enable SSH" link is wrong.
Is this? http://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh/enabling-ssh Thank you. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 15, 2014, 09:12:42 PM Preparing an SD Card for your Raspberry Pihttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/overview (http://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/overview) I tried to use Fedora ARM Installer on Windows 7 and on Ubuntu but in both cases it can't find the SD. No device appears in the menu. So i used dd command under Ubuntu and i obtained the SD with 2 partition, but when i switch on raspberry with the SD inside it doesn't work. It just doesn't run. What could be the problem? Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 16, 2014, 11:19:39 AM I solved using Raspian, instead of Occidentalis.
I have just a problem if i want to run the mining comand at the startup. I added the code to /etc/rc.local, but at every boot i get this error: Code: /etc/rc.local: 20: cd: can't cd to mining-stratum-proxy How to fix it? Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: aypro on January 16, 2014, 11:40:50 AM Try putting in the full path, like
Code: cd /home/username/mining-stratum-proxy Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 16, 2014, 03:50:04 PM I solved all my problems using absolute paths, even in miningserver.sh file.
Anyway i had to remove node command, otherwise stratum proxy doesn't start. What the node command do? Besides it was not included with Raspian and i had to install it. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 18, 2014, 03:09:15 PM That’s all folks. If you have any problems let me know. I will do my best to help. Where are you? :( Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: samcornwell on January 20, 2014, 05:47:01 PM That was one of the best tutorials for a pi I've ever followed. Everything went to plan.
I'll tip you some Dogecoin if you've got an address. Thanks. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: simpic on January 21, 2014, 09:11:25 AM Do you know what the command node do?
Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: pixl8tr on January 21, 2014, 10:33:36 AM Do you know what the command node do? I am not familiar with a bash command node, but I have heard about this node.. ...http://nodejs.org/ Title: Raspberry Pi not powerful enough Post by: utdrmac on January 26, 2014, 06:39:56 PM Hey all,
So I compiled stratum-mining-proxy on my RaspberryPi just fine. Ran into a couple of issues with bad python but was able to patch it with a couple pull requests. Problem is, I pointed two ASIC Block Erupter Cubes to the Pi proxy and CPU pegged at 99%. Neither cube was able to get higher than 28GHs. When I run the proxy on my MacBookPro, all three of my cubes reach 32GHs easy. It doesn't look like the Pi will be able to handle all that computation. :( Need to start looking for alternative to host the proxy. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: trevorh on February 23, 2014, 03:41:57 AM OK, I'm getting a deprecation message, asking me to update the stratum proxy. I tried a git pull, but it refused, telling me I'd lose local changes. How do I get around that?
Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: utdrmac on February 23, 2014, 04:47:31 PM You could just re-clone it into a different directory. I personally find git to be a major pain in the ass and the best solution (like Windows) is just to erase and start over with a fresh copy.
Title: Which PuTTY do I download? Post by: sgginc on February 28, 2014, 07:12:46 PM Which PuTTY do I download?
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Fabulous guide...Thanks!!! Ken Edit: I get it now. PuTTY runs on a Windows/Linux machine. I thought it ran on the Rpi. Dohhhhhh... Title: Re: Raspberry Pi not powerful enough Post by: BrandonMcPherson on March 05, 2014, 02:59:29 AM Hey all, So I compiled stratum-mining-proxy on my RaspberryPi just fine. Ran into a couple of issues with bad python but was able to patch it with a couple pull requests. Problem is, I pointed two ASIC Block Erupter Cubes to the Pi proxy and CPU pegged at 99%. Neither cube was able to get higher than 28GHs. When I run the proxy on my MacBookPro, all three of my cubes reach 32GHs easy. It doesn't look like the Pi will be able to handle all that computation. :( Need to start looking for alternative to host the proxy. Any insight on this from anyone? I found the same thing. It can handle one Cube just fine, but two Cubes got 70% of the hash rate when pointed at my RPi compared to being pointed at my Mac. CPU load appears to be the bottleneck. With RPis being so popular, there's got to be something I'm simply missing. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: daddyfatsax on March 05, 2014, 03:03:10 AM Hey all, So I compiled stratum-mining-proxy on my RaspberryPi just fine. Ran into a couple of issues with bad python but was able to patch it with a couple pull requests. Problem is, I pointed two ASIC Block Erupter Cubes to the Pi proxy and CPU pegged at 99%. Neither cube was able to get higher than 28GHs. When I run the proxy on my MacBookPro, all three of my cubes reach 32GHs easy. It doesn't look like the Pi will be able to handle all that computation. :( Need to start looking for alternative to host the proxy. Any insight on this from anyone? I found the same thing. It can handle one Cube just fine, but two Cubes got 70% of the hash rate when pointed at my RPi compared to being pointed at my Mac. CPU load appears to be the bottleneck. With RPis being so popular, there's got to be something I'm simply missing. Same experience here. 6 cubes pointed at a stratum proxy running on old Dell laptop was fine. More than 2 pointed at the Pi and things got weird. Never got around to trying the stratum proxy with bfgminer on the Pi. May be worth a shot. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: BrandonMcPherson on March 05, 2014, 03:30:34 AM I tried overclocking the RPi to "Medium," which is 900 MHz on the B model. It helped, but load was still at 1.24 and total hashing power was still well off the 38GH/s I get when overclocking the Cubes and running them through my Mac desktop.
I didn't up it to "High," as that was only another 50MHz in speed on the RPi, and it didn't seem worth the risk. I still feel like I'm missing something, though. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: daddyfatsax on March 05, 2014, 03:41:51 AM Most everything I have read says the RPi does not have the processing power to handle the proxy. I tried it with my cubes and no luck. Only thing that worked for me was slush's proxy. Ran the bfgminer proxy as well, and my best speeds at the pool were using slush's. Not sure of your setup, but I would try and re-purpose an old laptop to run it.
Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: BrandonMcPherson on March 05, 2014, 04:03:00 AM Good advice, daddyfatsax (that's an awesome handle, too :) ).
Thanks. Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: daddyfatsax on March 05, 2014, 04:17:39 AM Ha! Thank you.
No problem Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: bitmanaus on March 21, 2014, 03:59:37 AM How to setup for Solo? This doesn't seem to be covered and i was interested in looking at this option too, i have had a bit of a play around and it seems solo mining is theoretically possible with this. This would seem to work in theory and I have tried it with a windows based pc and it should transfer over to the Pi. I won't go into technical detail because we all know how to use Google :) 1. Install and setup bitcoin wallet on raspberry pi (you will need a larger than 16gb sd card due to the size of the blockchain, or use a usb drive and point the bitcoin-qt data directory there) - Plenty of tutorials on how to install it, Just install bitcoin-qt 2. Set Bitcoin-QT into server mode, again Google is your friend. You will need to create a bitcoin.conf file where you will be able to specify a username and password for your local worker (again Google) 3. Follow most of the above guide for installing the stratum-proxy, and then follow the extra example settings at the end and instead of setting the proxy to Slush' Pool set it to 127.0.0.1:8332 or whatever port you set the config file up for in Step 2. 4. Run your stratum proxy 5. Point your miners to your Raspberry Pi IP Address and port for the proxy as you would normally add a pool, use the username and password you created in Step 2. 6. Enjoy This should mine directly into the wallet you setup on the Pi, as i'm sure people reading this know success of solo mining depends on you actually finding a block, no block = no payment Good Luck Title: Re: Stratum Mining Proxy For Raspberry Pi Post by: vnhyp0 on March 22, 2014, 03:44:43 AM How to setup for Solo? This doesn't seem to be covered and i was interested in looking at this option too, i have had a bit of a play around and it seems solo mining is theoretically possible with this. This would seem to work in theory and I have tried it with a windows based pc and it should transfer over to the Pi. I won't go into technical detail because we all know how to use Google :) 1. Install and setup bitcoin wallet on raspberry pi (you will need a larger than 16gb sd card due to the size of the blockchain, or use a usb drive and point the bitcoin-qt data directory there) - Plenty of tutorials on how to install it, Just install bitcoin-qt 2. Set Bitcoin-QT into server mode, again Google is your friend. You will need to create a bitcoin.conf file where you will be able to specify a username and password for your local worker (again Google) 3. Follow most of the above guide for installing the stratum-proxy, and then follow the extra example settings at the end and instead of setting the proxy to Slush' Pool set it to 127.0.0.1:8332 or whatever port you set the config file up for in Step 2. 4. Run your stratum proxy 5. Point your miners to your Raspberry Pi IP Address and port for the proxy as you would normally add a pool, use the username and password you created in Step 2. 6. Enjoy This should mine directly into the wallet you setup on the Pi, as i'm sure people reading this know success of solo mining depends on you actually finding a block, no block = no payment Good Luck I presume this would work with other coins as well (i.e. Solo mining PPC or TRC, also scrypt with older versions of CGMiner?) Thanks for the quick guide! |