3

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!

4
  • AFAIK vardiff isn't supported by pushpool.
    – user4587
    Commented Apr 23, 2013 at 0:05
  • 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
    Commented Apr 23, 2013 at 8:56
  • Update? Any luck on this @Aley? I'm looking for a solution that can match stratum's difficulty and pushpools. Commented May 19, 2013 at 15:00
  • I am in the process of setting up stratumn and vardiff for my freicoin pool, come over to the freicoin.org forums and contact me. We'll work together to get stratum for litecoin (two different coins i know, but support the alt community), you can use your same database/cronjobs/frontend with stratum and pushpool (and stratum is python so easy to convert over pseudo code).
    – user5253
    Commented May 26, 2013 at 16:07

2 Answers 2

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 Joe White
> 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 ;)

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.