Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: ocminer on March 12, 2013, 06:29:10 PM



Title: Using eloipool with litecoind
Post by: ocminer on March 12, 2013, 06:29:10 PM
Hey !

I'm trying to set up eloipool with the latest git release of litecoind.

I've got litecoind running, eloipool starts but it seems there is something wrong with the network id..

I've set eloipool to:

UpstreamNetworkId = b'\xFB\xC0\xB6\xDB'

which should be litecoin's network ID:

When I start eloipool i get in litecoinds logfile:

>>

accepted connection 127.0.0.1:48523
accepted connection 127.0.0.1:48524
send version message: version 60001, blocks=312567, us=1.2.3.4:9333, them=0.0.0.0:0, peer=127.0.0.1:48523
receive version message: version 60000, blocks=0, us=[::]:0, them=[::]:0, peer=127.0.0.1:48523


PROCESSMESSAGE MESSAGESTART NOT FOUND

<<<<

and eloipool gives me:

>>>

2013-03-12 19:28:51,853 merkleMaker     CRITICAL        Traceback (most recent call last):
  File "/home/user/eloipool/merklemaker.py", line 689, in run
    self.merkleMaker_I()
  File "/home/user/eloipool/merklemaker.py", line 679, in merkleMaker_I
    self.merkleMaker_II()
  File "/home/user/eloipool/merklemaker.py", line 645, in merkleMaker_II
    return self._updateMerkleTree()
  File "/home/user/eloipool/merklemaker.py", line 545, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/home/user/eloipool/merklemaker.py", line 509, in _updateMerkleTree_I
    r = self._updateMerkleTree_fromTS(TS)
  File "/home/user/eloipool/merklemaker.py", line 474, in _updateMerkleTree_fromTS
    MP = self._CallGBT(TS)
  File "/home/user/eloipool/merklemaker.py", line 324, in _CallGBT
    MP = access.getblocktemplate(self.GBTReq)
  File "/home/user/eloipool/bitcoinrpc/authproxy.py", line 100, in __call__
    httpresp = self.__conn.getresponse()
  File "/usr/lib/python3.2/http/client.py", line 1052, in getresponse
    response.begin()
  File "/usr/lib/python3.2/http/client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.2/http/client.py", line 308, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.2/socket.py", line 287, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

<<<

so obviously litecoind is not responding..


Anyone got an idea what to change ?


Title: Re: Using eloipool with litecoind
Post by: dreamwatcher on March 12, 2013, 09:44:00 PM
You will need to find or write a scrypt module to work with eloipool.

Luke-jr is not a fan of the alt coins, so do not count on him to release a scrypt update for eliopool.

If you want to use stratum, a proper GBT patch for the litecoin daemon will need to be written, or released if already written.

I have been working with eloipool to adapt it to the alt-coins, but it is not my primary project at the moment.  ;)




Title: Re: Using eloipool with litecoind
Post by: ocminer on March 12, 2013, 09:49:06 PM
Hey dreamwatcher,

thanks for your answer, I'm aware of luke being no fan of alt coins, i tried eloipool once with bitcoins and liked it very much because it is written in python and i know some basic steps in python.

is there other pool software available which can be used "out-of-the-box" with litecoind ? preferably also written in python ?

frontend is not needed, I'll come up with that myself, just a good backend, in python or c++.

thanks

oc


Title: Re: Using eloipool with litecoind
Post by: dreamwatcher on March 13, 2013, 01:27:49 AM
Although a bit on the older side..The old work horse pushpool does have a couple of scrypt based coin forks.

 Artforz fork originally written for Tenebrix

https://github.com/ArtForz/pushpool (https://github.com/ArtForz/pushpool)

alexhz's fork with a recent commit by CryptoManiac which was in general for scrypt based coins.

https://github.com/alexhz/pushpool (https://github.com/alexhz/pushpool)


It has been awhile since I have experimented with scrypt based pushpool. For the most part I have been trying to get stratum support for scrypt coins when I have worked on scrypt based pooling.

I would try alexhz'a fork first, the worst that could happen is that it wont work. There are a number of litecoin pools out there and I suspect they are using some form of these forks.

I might start experimenting with pool software again over the next few days. However there are quite a few litecoin pools out there and after the DDoS problems coinotron has had lately, I am a bit gun shy about attempting a Novacoin pool.

Getting some alt-coin pools going has been on my list for some time.  It just seems the cryptocoin explorer has a tendency to push those projects down the list... :D


Title: Re: Using eloipool with litecoind
Post by: ocminer on March 13, 2013, 03:59:33 PM
Hey dream,

I tried alexhz's  fork, compiled it, installed it and ran it against the recent git litecoind

Both daemons run, they also connect, my client also connects but always solves the same work..

In the mysql-db there is also aways the same "solution" saved, as if the pool always "sends the same question"..

I'll try further, maybe its not working correctly with litecoind.. Novacoin might also be interesting, or Terracoin..


Title: Re: Using eloipool with litecoind
Post by: ocminer on March 13, 2013, 08:28:30 PM
Got it working fine now, it just seems that pushpool has no vardiff integrated ..

Does someone know of a patch ?


Title: Re: Using eloipool with litecoind
Post by: dreamwatcher on March 13, 2013, 09:28:10 PM
I do not know of a patch, but variable difficulty is one of the things I have looked in to.

It did not appear that it would be that hard to implement.

I was thinking of a non-registered login where miners would use whatever payout address they want as the username and the password would be the difficulty the miner wanted.Perhaps coded like Bitparking pools (d=xx) anything else in the password field would just be ignored.


In the sever.c code it is fairly easy to find and enable/disable the  password/username check and/or add whatever code you wanted to run at miner login.
Code:
 /* password database authentication check */
        pass_db = pwdb_lookup(user);
        if (!pass_db || (strcmp(pass, pass_db) && *pass_db != '\0'))
                goto out;

        rc = true;
        strncpy(username_out, user, 64);
        username_out[64] = 0;

out:
        free(pass_db);
        free(bin);
        free(t_type);
        free(t_b64);
        free(t_userpass);
        return rc;
Perhaps a check to make sure the address is a valid address for the chain, then place the payout address in the pool_worker database along with the password(difficulty desired).

One could just as easy use a registered system and add a difficulty field to the pool_worker table.

Either way, the simplicity of the pushpool code, makes alterations easier then with some of the newer pool software.

Quick hint: if using the native blkmond for long poll trips, there are two places in the blkmond code that directly contain and use the "magic" number for the chain:

Code:
 def got_data(self):
                while True:
                        if len(self.recvbuf) < 4:
                                return
                        if self.recvbuf[:4] != "\xFC\xC1\xB7\xDC":
                                raise ValueError("got garbage %s" % repr(self.recvbuf))
                        if self.ver_recv < 209:
                                if len(self.recvbuf) < 4 + 12 + 4:
                                        return

Code:
 def send_message(self, message, pushbuf=False):
                if self.state != "connected" and not pushbuf:
                        return
                print "send %s" % repr(message)
                command = message.command
                data = message.serialize()
                tmsg = "\xFC\xC1\xB7\xDC"
                tmsg += command
                tmsg += "\x00" * (12 - len(command))
                tmsg += struct.pack("<I", len(data))

I sometimes think that the pool software developers purposely bury things like "magic numbers" instead of having them defined in the config file in order to make it more of a "challenge" to adapt the software to other coins.. :D

Some of the new daemons have a block notify feature that could be used to completely remove the need for a complex block monitor.

I also found this simple little block monitor quite useful:

Code:
#!/usr/bin/env python
from jsonrpc.authproxy import AuthServiceProxy
import sys
import os

access = AuthServiceProxy("http://RPCUSER:RPCPASS@127.0.0.1:8332")
blockcount = access.getblockcount()
from time import sleep
while(True):
        newcount = access.getblockcount()
        if newcount > blockcount:
                os.system("killall -s SIGUSR1 pushpoold")
                sys.stdout.write("B")
                sys.stdout.flush()
                blockcount = newcount
                sleep(1)
        else:
                sleep(0.1)
Thanks to metonymous

Bitcointalk thread:

https://bitcointalk.org/index.php?topic=8797.0 (https://bitcointalk.org/index.php?topic=8797.0)



Title: Re: Using eloipool with litecoind
Post by: Balthazar on March 13, 2013, 10:32:50 PM
Like the origin, alexhz's fork uses 10s timer and SIGUSR1 as a trigger events to request new work template from upstream. Litecoind has getworkex integrated, so this daemon can work with unpatched litecoind, but blknotify script is required.

I also found this simple little block monitor quite useful:
-blknotify option will be simplier and more reliable.


Title: Re: Using eloipool with litecoind
Post by: ocminer on March 13, 2013, 11:02:07 PM
Thanks a lot, I've got the block monitor script up an running, it willingly sends the signal when a new block is found on the network.

blkmon was doing nothing :-/

Where in the code is difficulty defined ? All I see is EASY_TARGET in config.c .. Which is

Code:
define EASY_TARGET "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000"

in original code.

Would that need to be defined for each worker separately ?


Title: Re: Using eloipool with litecoind
Post by: Balthazar on March 14, 2013, 12:13:37 AM
It's quite simple, and I have implementation of this feature for btc. I'll try to find my sources tomorrow.


Title: Re: Using eloipool with litecoind
Post by: gusti on March 15, 2013, 12:16:53 PM
OP, can you please reply to my PM's ?
Thanks.


Title: Re: Using eloipool with litecoind
Post by: ocminer on March 15, 2013, 06:53:41 PM
Balthazar, got that code for me ? Still looking for vardiff code


Title: Re: Using eloipool with litecoind
Post by: Balthazar on March 15, 2013, 07:36:40 PM
Balthazar, got that code for me ? Still looking for vardiff code
Oh, I'm sorry because I forget about it. :-[ But I found the sources, and can send it to you. Give me your e-mail in PM. :)


Title: Re: Using eloipool with litecoind
Post by: dreamwatcher on March 31, 2013, 05:21:03 AM
Like the origin, alexhz's fork uses 10s timer and SIGUSR1 as a trigger events to request new work template from upstream. Litecoind has getworkex integrated, so this daemon can work with unpatched litecoind, but blknotify script is required.

I also found this simple little block monitor quite useful:
-blknotify option will be simplier and more reliable.

You are 100% correct. I have been using the blocknotify option for a number of things, including some experiments with the explorers and tripping database updates..

Using blocknotify for pushpool I set blocknotify to run this script:

Code:
#!/usr/bin/env python

import sys
import os

os.system("killall -s SIGUSR1 pushpoold")


I seem to find more uses for blocknotify in every project I am working on... :D


Title: Re: Using eloipool with litecoind
Post by: Balthazar on March 31, 2013, 05:37:36 AM
Using blocknotify for pushpool I set blocknotify to run this script:

Code:
#!/usr/bin/env python

import sys
import os

os.system("killall -s SIGUSR1 pushpoold")


I seem to find more uses for blocknotify in every project I am working on... :D
This variant is acceptable only if pushpoold and bitcoind runned by the same account. Configurations like this not recommended for security reasons.

The preferred option is:

1) run litecoind and pushpoold using separated accounts (I usually using accounts named like "litecoin" and "pushpool")
2) simple C program for notify event handling:

Code:
#include <stdlib.h>

int main(void)
{
    system("ps -ef | grep pushpoold | grep -v grep | awk '{print $2}' | xargs kill -s SIGUSR1 > /dev/null 2> /dev/null");

    return 0;
}

Code:
gcc -o blocknotify blocknotify.c 
chown pushpool:pushpool ./blocknotify
chmod ug+s ./blocknotify
and then in litecoin.conf:
Code:
blocknotify='/opt/blocknotify'


Title: Re: Using eloipool with litecoind
Post by: ocminer on April 12, 2013, 06:50:49 PM
Did anyone tried this:

https://github.com/Tydus/eloipool-litecoin

?

Works ?


Title: Re: Using eloipool with litecoind
Post by: flound1129 on April 26, 2013, 12:02:56 AM
Did anyone tried this:

https://github.com/Tydus/eloipool-litecoin

?

Works ?


I tried it, can't get it to work.

I'm currently hung up on the following error:

Traceback (most recent call last):
  File "./eloipool.py", line 80, in <module>
    from bitcoin.txn import Txn
  File "/home/ltc/eloipool-litecoin/bitcoin/txn.py", line 146, in <module>
    _test()
  File "/home/ltc/eloipool-litecoin/bitcoin/txn.py", line 124, in _test
    assert t.txid == b"C\xeczW\x9fUa\xa4*~\x967\xadAVg'5\xa6X\xbe'R\x18\x18\x01\xf7#\xba3\x16\xd2"
AssertionError


Title: Re: Using eloipool with litecoind
Post by: nearmiss on April 29, 2013, 02:59:30 PM
I'm currently trying to get this implemented as well.  I bypassed the failing tests for the moment, and the program seems to startup and listen for connections, but when trying to connect to the stratum port I get:

AttributeError: 'StratumServer' object has no attribute 'JobBytes'


Continuing to dig into it.


Title: Re: Using eloipool with litecoind
Post by: costcoin on August 23, 2013, 11:41:15 PM
Someone found a solution which allows eloipool to work with  litcoin?
I can not believe that this is an impossible task!


Title: Re: Using eloipool with litecoind
Post by: Balthazar on August 24, 2013, 12:53:44 AM
https://github.com/CryptoManiac/eloipool-scrypt


Title: Re: Using eloipool with litecoind
Post by: costcoin on August 24, 2013, 05:48:58 AM
https://github.com/CryptoManiac/eloipool-scrypt

This solution is 100% working?


Title: Re: Using eloipool with litecoind
Post by: minerapia on August 24, 2013, 06:27:10 AM
I have been testing around with https://github.com/moopless/stratum-mining-litecoin.git
Support vardiff and stratum from the box, and was very easy to get running. Dunno about performance tho, only have ran it with 1-2 users. Getting mmcfe run the way you want is the 'B'.


Title: Re: Using eloipool with litecoind
Post by: costcoin on September 02, 2013, 06:09:22 AM
I have been testing around with https://github.com/moopless/stratum-mining-litecoin.git
Support vardiff and stratum from the box, and was very easy to get running. Dunno about performance tho, only have ran it with 1-2 users. Getting mmcfe run the way you want is the 'B'.

Who knows why the link is not working?


Title: Re: Using eloipool with litecoind
Post by: bitzcointalk on September 22, 2014, 06:35:34 PM
Cheers, I got this working: https://github.com/CryptoManiac/eloipool-scrypt
 :P  :D But my princess is in another castle.  :(


Title: Re: Using eloipool with litecoind
Post by: cinnamon_carter on September 23, 2014, 03:27:01 AM
thanks for posting this link

https://github.com/CryptoManiac/eloipool-scrypt


Title: Re: Using eloipool with litecoind
Post by: bitzcointalk on September 24, 2014, 12:50:22 AM
Sure, not a problem, want directions with that?
BAM: https://bitcointa.lk/threads/how-to-start-your-own-mining-pool-using-bitcoind-eloipool.272362/