<p>i have come back to post up all the information i can for you.</p>

<p>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).</p>

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

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

<p>step 1) back up your database
step 2) back up your database
step 3) back up your database</p>

<p>From <a href="https://github.com/Neozonz/stratum-mining-litecoin/blob/master/INSTALL" rel="nofollow">https://github.com/Neozonz/stratum-mining-litecoin/blob/master/INSTALL</a></p>

<p>"</p>

<pre><code>&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?

"
</code></pre>

<p>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 <a href="https://bitbucket.org/joeswhite/joes-stratum-mining-freicoin/src/8eec8a0b11c6?at=master" rel="nofollow">https://bitbucket.org/joeswhite/joes-stratum-mining-freicoin/src/8eec8a0b11c6?at=master</a></p>

<p>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.</p>

<pre><code>"

&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!

"
</code></pre>

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

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

CC BY-SA 3.0
2013-06-20T15:40:19.283Z
2013-06-20T15:40:19.283Z
Joe White
<p>You may want to try this version of stratum:</p>

<p><a href="https://github.com/ahmedbodi/stratum-mining" rel="nofollow">https://github.com/ahmedbodi/stratum-mining</a></p>

<p><a href="https://github.com/ahmedbodi/stratum" rel="nofollow">https://github.com/ahmedbodi/stratum</a></p>

<p>Which come with litecoin parts built in.  Also you may wish to consider a currently maintained pool as pushpool is not maintained according to the bitcoin wiki:</p>

<p><a href="https://en.bitcoin.it/wiki/Software" rel="nofollow">https://en.bitcoin.it/wiki/Software</a></p>

<p>I would recommend either P2Pool if your a beginner, and if you have a bit more experience then try Eloipool. </p>

CC BY-SA 3.0
2014-03-04T12:21:31.873Z
2014-03-04T12:21:31.873Z
hafnero
<p>I'm trying to setup a pool for litecoin mining with support of the stratum protocol and VARDIFF (variable difficulty).</p>

<p>I read the answer of cdecker on the following question <a href="https://bitcoin.stackexchange.com/questions/4303/how-to-setup-pushpool">How to setup pushpool</a>. 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).</p>

<p>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 <code>"rpc.target.bits" : 18</code> instead of <code>"rpc.target.rewrite" : true</code> in <code>server.json</code> to adjust the difficulty, but no success :(
For VARDIFF I can not find anything at all.</p>

<p>Any help would be very much appreciated!</p>

CC BY-SA 3.0
2013-04-23T08:56:30.307Z
It is not in the pushpool package, that's true, but it can be added custom. I'm asking for any ideas how to do this.
Aley
CC BY-SA 3.0
2013-05-19T15:00:29.440Z
Update? Any luck on this @Aley? I'm looking for a solution that can match stratum's difficulty and pushpools.
Robin Jonsson
<mining-pools><litecoin><stratum><pushpool>
How to setup stratum with pushpool and VARDIFF? (litecoin)
Aley
# How to setup stratum with pushpool and VARDIFF? (litecoin)

(Asked by: username_0 on 2013-04-20)

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](https://bitcoin.stackexchange.com/questions/4303/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!

**Tags:** mining-pools, litecoin, stratum, pushpool

> **Comments:**
> **username_0**: It is not in the pushpool package, that's true, but it can be added custom. I'm asking for any ideas how to do this.  
> **username_1**: Update? Any luck on this @username_0? I'm looking for a solution that can match stratum's difficulty and pushpools.  

---

## 2 answers

### Answer by username_2 on 2013-06-20. Score: 1

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>

"

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

```
"

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

"

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


---

### Answer by username_3 on 2014-03-04. Score: 1

You may want to try this version of stratum:

<https://github.com/ahmedbodi/stratum-mining>

<https://github.com/ahmedbodi/stratum>

Which come with litecoin parts built in. Also you may wish to consider a currently maintained pool as pushpool is not maintained according to the bitcoin wiki:

<https://en.bitcoin.it/wiki/Software>

I would recommend either P2Pool if your a beginner, and if you have a bit more experience then try Eloipool.


---

