Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: Pentium100 on December 14, 2013, 01:19:01 AM



Title: Multi pool stratum proxy - how to do it?
Post by: Pentium100 on December 14, 2013, 01:19:01 AM
Hi, is there a way to have a stratum proxy server for multi pool mining? The idea is to have one place where I could specify the pool (with user/password) and not have to reconfigure each miner in order to switch pools (or coins) - I could just switch it in the proxy and all my miners would start working for the new pool.


Title: Re: Multi pool stratum proxy - how to do it?
Post by: nwoolls on December 14, 2013, 02:34:48 AM
Hi, is there a way to have a stratum proxy server for multi pool mining? The idea is to have one place where I could specify the pool (with user/password) and not have to reconfigure each miner in order to switch pools (or coins) - I could just switch it in the proxy and all my miners would start working for the new pool.

Take a look at MultiMiner: http://multiminerapp.com


Title: Re: Multi pool stratum proxy - how to do it?
Post by: Pentium100 on December 14, 2013, 04:00:27 AM
Take a look at MultiMiner: http://multiminerapp.com

I do not see a way to use it as a proxy server. The mining devices are connected to a Linux PC that runs bfgminer (for a BFL device) and a modified cgminer (for Technobit HEX16B - no bfgminer support for it). I cannot move the devices to a Windows PC.

I need a simpler daemon. One that just sits between the stratum client (cgminer, bfgminer) and the actual pool, just gets the work from pool and sends it to the miner. Then I could just switch the pool manually or write a script to do it for me.


Title: Re: Multi pool stratum proxy - how to do it?
Post by: nwoolls on December 14, 2013, 04:15:55 AM
I do not see a way to use it as a proxy server.

It's in there. It's shown in a couple of the screenshots. Install it, click Settings, Advanced miner settings. There's an option to enable the proxy there:

https://github.com/nwoolls/MultiMiner/raw/master/Screenshots/Advanced%20Miner%20Settings.png

Then you can switch the coin it mines via the context menu.


Title: Re: Multi pool stratum proxy - how to do it?
Post by: Pentium100 on December 15, 2013, 01:25:06 AM
I tried MultiMiner. bfgminer seems to work well with it, but cgminer gets h-not-zero errors for all shares.

I then found out that MultiMiner uses bfgminer as stratum proxy. Compiled a new version of bfgminer and ran it on the mining PC - same result - bfgminer works with it, but cgminer gets h-not-zero errors.

Both bfgminer and cgminer work properly when connected to an actual pool.


Title: Re: Multi pool stratum proxy - how to do it?
Post by: nwoolls on December 15, 2013, 01:32:30 AM
I tried MultiMiner. bfgminer seems to work well with it, but cgminer gets h-not-zero errors for all shares.

I then found out that MultiMiner uses bfgminer as stratum proxy. Compiled a new version of bfgminer and ran it on the mining PC - same result - bfgminer works with it, but cgminer gets h-not-zero errors.

Both bfgminer and cgminer work properly when connected to an actual pool.

Yes, Luke knows about this issue and is looking into it. In the meantime either use bfgminer rather than cgminer (to connect to the proxy) or use the GetWork port rather than the Stratum port. And maybe pop over to the bfgminer thread to mention this as well so Luke knows there are several users running into it:

https://bitcointalk.org/index.php?topic=168174.0


Title: Re: Multi pool stratum proxy - how to do it?
Post by: frankenmint on February 24, 2014, 01:13:22 AM
Sorry to hijack this so much later but I found that using the standard stratum mining proxy program from slush's pool let me do this.  Using a host machine that is configured with a static IP, I point all miners to this machine and the stratum proxy feeds them work.  Details of how to do this with linux were answered here: http://bitcoin.stackexchange.com/questions/22476/i-have-8-antminers-is-there-a-way-i-could-change-their-pool-credentials-all-at/22551?noredirect=1#22551 which was answered by mcstar.

particularly:

Quote
Here are the instructions for setting a mining proxy which allows all your miners to connect via the proxy instead of via their own config. This way you only have to stop then start a single process on the proxy to change pools instead of messing with each miner to do the switch.

Setup mining_proxy.py on a linux machine
pont slush's mining_proxy.py at a pool of your choosing using a bash script file (remember to chmod 755 so you can run the bash script with ./)
setup each pool you want to mine with it's own script (same -sp (port) for each )
point all your miners at the proxy server with the port you are using
make sure all pools use the same worker names and passwords (since this is setup on the miners)
start your chosen bash script (best to use screen so you can exit the session and leave it running)
miners can be switched by ssh via screen -d -r , then ctrl-c (to kill the proxy), now just run the correct bash script to switch to the next pool.

I found this thread because I was looking for a fancy way to have a script read coinchoose api for the most profitable coin and to then turn on that stratum proxy,  So that I'm mining a group of profitable coins and not just the one I have configured.  I have my miners themselves setup to mine a failover pool if the alt-coin pool is down.


Title: Re: Multi pool stratum proxy - how to do it?
Post by: kenshirothefist on February 24, 2014, 05:49:22 PM
I'm also looking for some advanced stratum proxy. MultiMiner is problematic, because it uses BFGminer as the proxy, which has problems with various cgminers. The famous mining-proxy (from here: http://mining.bitcoin.cz/mining-proxy-howto) is somehow useless, since I can only define one pool and thus I don't have any backup/failover pools.

So, is there any decent advanced stratum proxy? By "advanced" I mean:
- it should have support for mutiple pools (primary, backup/failover ...)
- it should work with various cgminers, sgminers and other forks of them (vertminer...)

Basically what I want is to have a single machine as a proxy, and all my miners would connect to this machine, and then to the actual pools. Miners can be configured for various coins (regular scrypt, vertcoin, scrypt-jane, keccak ... of course all miners would mine the same type of coin at once).

Any suggestions?


Title: Re: Multi pool stratum proxy - how to do it?
Post by: corsaro on March 18, 2014, 06:01:57 AM
I'm also looking for some advanced stratum proxy. MultiMiner is problematic, because it uses BFGminer as the proxy, which has problems with various cgminers. The famous mining-proxy (from here: http://mining.bitcoin.cz/mining-proxy-howto) is somehow useless, since I can only define one pool and thus I don't have any backup/failover pools.

So, is there any decent advanced stratum proxy? By "advanced" I mean:
- it should have support for mutiple pools (primary, backup/failover ...)
- it should work with various cgminers, sgminers and other forks of them (vertminer...)

Basically what I want is to have a single machine as a proxy, and all my miners would connect to this machine, and then to the actual pools. Miners can be configured for various coins (regular scrypt, vertcoin, scrypt-jane, keccak ... of course all miners would mine the same type of coin at once).

Any suggestions?

I successfully experimented a very simple approach pointing some of my scrypt mining machines to stratum_proxy.exe  taken from here https://www.wemineltc.com/gettingstarted

I pointed the stratum proxy to a single pool using

stratum_proxy.exe -o POOL_SERVERNAME -p 3333 -cu workerusername -cp password

and then all single miners are pointed (using fake credentials) to the stratum_proxy using getwork 8332 port and http:// protocol (i do not know why, but only only getwork works to connect scrypt miner to the stratum_proxy).

Then, when you need to switch all mining rigs, simple launch a new batch with taskkill /f /im stratum_proxy.exe and with the new credentials to a different more profitable pool...

taskkill /f /im stratum_proxy.exe
stratum_proxy.exe -o SERVERNAME -p 3333 -cu workerusername -cp password

But this very simple approach will not solve the lost shares when switching from one pool to another...  It could be great if someone could point us to a better solution to avoid losing shares when switching from a pool to an other


Title: Re: Multi pool stratum proxy - how to do it?
Post by: dimeguy on March 19, 2014, 03:51:45 AM
So, is there any decent advanced stratum proxy? By "advanced" I mean:
- it should have support for mutiple pools (primary, backup/failover ...)
- it should work with various cgminers, sgminers and other forks of them (vertminer...)

..

Any suggestions?

I would like to know too; but until then there is a simple trick you could do.

First just get a simple tcp port forwarder, like this: http://jtcpfwd.sourceforge.net/ or maybe even ssh.

Then open set up some forwards on different ports, just an example:

Port 4001 points to multipool:7777
Port 40002 points to middlecoin, etc
... Port 4010 points to wafflepool

Then in your cgminer/bfgminer coinfigs, just setup it up to point to all 10 ports on your proxy server : mylocalproxy:4000, mylocalproxy:4001, ... mylocalhost:4010


So all miners connect to all pools.  Just bring down (or up) the pools you want on any of those 10 ports.  It works good.  That is, if pool 7 is most profitable, then kill all other forwarders but the one running on 4007.  All your miners will "fail over" to that pool/port since it's the only one up.


Or the other way, instead of having 10 ports; just have one and switch it around to point it to whatever you want.

This works good, the only problem is making sure you have the correct workers.




Title: Re: Multi pool stratum proxy - how to do it?
Post by: ndonnard on March 20, 2014, 05:13:26 PM
I took a look at MultiMiner. Very useful site, thanks!


Title: Re: Multi pool stratum proxy - how to do it?
Post by: corsaro on March 21, 2014, 06:26:16 AM
I solved definitively using my linux machine and installing on it CryptoManiac / stratum-mining-proxy. Using already compiled exe on windows machine was too unstable (disconnected after 1 hour of work)

Now I can point all my scrypt rigs to one unique proxy.

installation instructions on ubuntu are very simple:
# Python and libssl development packages are required
sudo apt-get install -y git-core python-dev libssl-dev
git clone https://github.com/CryptoManiac/stratum-mining-proxy.git
cd stratum-mining-proxy

# This will upgrade setuptools package
sudo python distribute_setup.py

# Build and install LTC scrypt extension
cd litecoin_scrypt
sudo python setup.py install
cd ..

# This will install required dependencies (namely Twisted and Stratum libraries), but don't install the package into the system.
sudo python setup.py develop

to launch the stratum proxy for scrypt mining, just use:
ulimit -n 4096 | ./mining_proxy.py -pa scrypt -o your_pool_address -p port_of_your_pool -cu user.worker -cp worker_password -sp 3333 -gp 8332

replace your_pool_address, port_of_your_pool, user.worker and worker_password with proper values

your_pool_address --> address of your pool (example, ltc.ghash.io)
port_of_your_pool -->  the port of your pool, (example 3333)
user.worker --> the worker
worker_password --> password of the worker

before launching the stratum proxy, I set ulimit -n 4096 due to the fact using too many rigs, you can receive python error message "OSError: [Errno 24] Too many open files" after few hours of work...


Title: Re: Multi pool stratum proxy - how to do it?
Post by: fasbit on March 24, 2014, 10:29:56 PM

# This will install required dependencies (namely Twisted and Stratum libraries), but don't install the package into the system.
sudo python setup.py develop


1.  What?  Don't install into the system?
2. I got an error here.

conquest@conquest-desktop:~$ sudo python setup.py develop
python: can't open file 'setup.py': [Errno 2] No such file or directory


3. help!

Edit >   got that figure out.

What I dont know is this:  When you go into CGminer and point it at the new stratum server, do you use "stratum+tcp://192.168.1.121:3333" or "x:8333" or "http://x "
I cant get it to work... says my pool is dead on cgminer, but listening on the stratum server....


Edit >  got that figured out.

4. WTF... all the shares are rejected

2014-03-24 18:14:30,399 INFO proxy stratum_listener.submit # [91ms] Share from 'fasbit.1' REJECTED: (23, u'Low difficulty share', None)


Any ideas?