How to setup stratum with pushpool and VARDIFF? (litecoin) I'm trying to setup a pool for litecoin mining with support of the stratum protocol and VARDIFF (variable difficulty).

I read the answer of cdecker on the following question How to setup pushpool. This was quite helpful. I managed to setup pushpool and everthing is running quite well (at least I can see CGminer connected and doing something).

I'm just stuck in setting up startum and VARDIFF. I was searching through boards, but I can not find anything that is related to my problem. The only approach I read on bitcointalk was to use "rpc.target.bits" : 18 instead of "rpc.target.rewrite" : true in server.json to adjust the difficulty, but no success :(
For VARDIFF I can not find anything at all.

Any help would be very much appreciated!
i have come back to post up all the information i can for you.

through the last few months of working with Stratum-mining i have come to some conclusions: you need to know python well to get this working on anything but bitcoin... That being said, its possible to install stratum over a current custom pushpool installation through a project I released and am working on. (Currently it is for freicoin but there are two trivial changes you can make to get my implementation to work on litecoin). There is also another implementation of stratum-mining that you can use that was last updated on Jun 6 2013 (i would suggest using this versus my code if you are installing from scratch or using MMCFE currently. my version of the code is designed to be more friendly to version 2 getblocktemplate, where as litecoin only supports getblocktemplate version 1 at this time).

In the future it may be extremely useful to diff these two implementations as they have different database schemas...

In the mean time,
Here's how to install stratum-mining-litecoion a NEW system OR a system with MMCFE

step 1) back up your database
step 2) back up your database
step 3) back up your database

From https://github.com/Neozonz/stratum-mining-litecoin/blob/master/INSTALL

"

&gt; Installation Instructions
&gt; =========================
&gt; 
&gt; Step 0. Install litecoind     NOTE: Litecoind currently only supports
&gt; getblocktemplate version 1. This code was changed to support version
&gt; 1.    Set it up and start it!     Downloading the blockchain can take a few hours to a couple days!
&gt; 
&gt; Step 1. Install the stratum core  git pull
&gt; https://github.com/slush0/stratum.git     sudo easy_install stratum    
&gt; (or if using alternate python: sudo /usr/local/bin/easy_install
&gt; stratum)
&gt; 
&gt; Step 2. Pull a copy of the miner  git pull
&gt; https://github.com/moopless/stratum-mining-litecoin.git
&gt; 
&gt; Step 3. Configure the Miner   cp conf/config_sample.py conf/config.py
&gt;   make your changes to conf/config.py     Make sure you set the values in
&gt; BASIC SETTINGS! These are how to connect to litecoind       and where
&gt; your money goes!
&gt; 
&gt; Step 4. Run the pool  twistd -ny launcher.tac -l -    OR - using
&gt; alternate python  /usr/local/bin/twistd -ny launcher.tac -l -
&gt; 
&gt; You can now set the URL on your stratum proxy (or miner that supports
&gt; stratum) to: http://YOURHOSTNAME:3333
&gt; 
&gt; Database Setup
&gt; ========================= Table Creation: Tables are auto-created if they don't exist (I will be adding a schema file later)
&gt; 
&gt; None: Well, this doesn't do anything, so there is nothing to set up
&gt; 
&gt; Sqlite: THIS IS THE DEFAULT! Just set the file path in the config file
&gt; (or keep the default.) Support for sqlite3 is built into recent python
&gt; versions. A couple notes for Sqlite:
&gt;   - Sqlite and threading/concurancy just doesn't work right for that reason it is disabled.
&gt;   - Since threading is disabled, The server will "pause" when archiving happens, this will affect         your miners. However this will not happen
&gt; often (24 hours after finding a share)
&gt; 
&gt; Postgresql:
&gt; 1. Set up your parameters in the config file.
&gt; 2. Install the postgresql libraries in your os:   Redhat and the like:        yum install postgresql-libs postgresql-devel    Ubuntu and the like:
&gt;       apt-get install postgresql postgresql-devel
&gt; 3. Install the python bindings    easy_install psycopg2
&gt; 
&gt; Mysql:
&gt; 1. Set up your parameters in the config file.
&gt; 2. Install the mysql libraries in your os:    Redhat and the like:        yum install mysql mysql-devel   Ubuntu and the like:        apt-get install
&gt; mysql mysql-devel
&gt; 3. Install the python bindings    easy_install mysql-python
&gt; 4. Create a database and user.
&gt; 
&gt; Problems????
&gt; =========================
&gt; 
&gt; Is your firewall off? Is litecoin running?
&gt; 
&gt; TODO: are there other problems?

"


If you are already using pushpool and a custom frontend and don't want to write over your system, i have a working (but a bit buggy with MBPM due to the nature of my project) "install over" version of stratum mining for freicoin available here https://bitbucket.org/joeswhite/joes-stratum-mining-freicoin/src/8eec8a0b11c6?at=master

this is how to install my version (DO NOT INSTALL THIS VERSION UNLESS YOU HAVE EXPERIENCE CODING!), there is an added step for the litecoin implementation but it is not yet tested by me.

"

&gt; stratum-mining Basic implementation of bitcoin mining pool using
&gt; Stratum mining protocol. This fork includes a database implementation
&gt; for: None Sqlite Mysql Postgresql Basic worker stats are provided (and
&gt; updated) See the INSTALL file for install instructions. For more info
&gt; on Stratum: http://mining.bitcoin.cz/stratum-mining. Original version
&gt; by Slush Updated version by GeneralFault (Tips Welcome:
&gt; 15Zk7DoFYJ7hESpZzmix1WLkomTMGW81c2 ) This version by Joe White
&gt; http://pool.cr.rs (freicoin mining pool) Joe's Stratum Mining Freicoin
&gt; Implementation of generalfault's
&gt; https://github.com/generalfault/stratum-mining that works with Mark
&gt; Friedenbach's https://github.com/freicoin/stratum-mining This
&gt; installation can be put directly over top of your current pushpoold
&gt; Known bugs: Does not handle subscriptions properly upon connection,
&gt; but properly pushes block template and everything submits without
&gt; issue To do: add Joe's Pool front end in to implementation
&gt; (simplebtc's implementation heavily modified) add firewalls, security
&gt; services, add google authenticator, add other things like tripwire.
&gt; how to: Easy: download vmware image go to town make sure to set up any
&gt; and all firewalls, security measures, and other information. manual:
&gt; first download freicoin from freico.in/downloads install freicoin edit
&gt; your freicoin.conf file change the rpc port for security (i like to
&gt; mix it up on each server i use) nano .freicoin/freicoin.conf something
&gt; like this works (freicoin.conf file): server=1
&gt; rpcuser=changethisusername rpcpassword=changethispassword rpcport=4252
&gt; rpcallowip=127.0.0.1 test to make sure freicoind works once you are
&gt; sure of that, then get the git package git clone make the stratum log
&gt; directories mkdir /stratum mkdir /stratum/log/ touch
&gt; /stratum/log/stratum.log recurse in to the directory and edit
&gt; conf/config.py MAKE SURE TO READ AND CONFIGURE ALL SETTINGS!!!! I HAVE
&gt; DISABLED PLUG AND PLAY FOR YOUR SAFETY/SECURITY nano conf/config.py
&gt; ALWAYS BACK UP BEFORE STARTING ANYTHING!!! YOUR DATABASE COULD GET
&gt; SCREWED! I CAN NOT BE HELD LIABLE FOR ANYTHING, ESP THAT! import the
&gt; database if you are starting from scratch (it is not standard and is
&gt; not optimized, you could opt to make your own database and edit
&gt; DB_Mysql.py (or corresponding database) and edit anything that is a
&gt; sql execution (anything that has "select * from, or any other sql
&gt; statements can be easily updated without changing most or anythign on
&gt; the server side schema.sql &lt;- THIS IS THE SCHEMA FOR THIS
&gt; IMPLEMENTATION OF joe's THIS SCHEMA IS NOT OPTIMIZED AT ALL! ALWAYS
&gt; BACK UP BEFORE STARTING ANYTHING!!! YOUR DATABASE COULD GET SCREWED! I
&gt; CAN NOT BE HELD LIABLE FOR ANYTHING, ESP THAT! start a new screen so
&gt; you don't log out and stratum crashes (this is helpful for logging
&gt; too) screen

"

*litecoin specific step
At this point you need to go back and write over (at very least) the halfnode.py block_template.py and coinbasetx.py files with the files provided in stratum-mining-litecoion. most likely you will need to write over all of them. (This is the untested part i was talking about).


"

&gt; ./startjoes.sh it should load up and work, you will see one error on
&gt; submission at this time it is okay this error does not affect any pool
&gt; performance, it is tested working. please update this as there are
&gt; many probable errors. I have included the sql architecture for this
&gt; implementation as it is not standard and can plug-and-play over an
&gt; existing pushpool implementation ALWAYS BACK UP BEFORE STARTING
&gt; ANYTHING!!! YOUR DATABASE COULD GET SCREWED! I CAN NOT BE HELD LIABLE
&gt; FOR ANYTHING, ESP THAT!

"


I am trying to get an implementation up today or tomorrow and can report back any changes i need to make then.

Please let me know if this was a satisfactory answer, if not. I will update this until it is. Thanks for not bashing me ;)