mapleshadow
Member
Offline
Activity: 79
Merit: 10
|
|
February 01, 2014, 03:44:22 PM |
|
I ask, why do I write infinitecoin unable to work? IDENTIFIER and PREFIX wrong in the end there? This is my random sets of data should be written right way? infinitecoin=math.Object( P2P_PREFIX='fbc0b6db'.decode('hex'), #pchmessagestart P2P_PORT=9321, ADDRESS_VERSION=66, #pubkey_address 0xfb, 0xc0, 0xb6, 0xdb RPC_PORT=9322, RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'infinitecoinaddress' in (yield bitcoind.rpc_help()) and not (yield bitcoind.rpc_getinfo())['testnet'] )), SUBSIDY_FUNC=lambda height: 524288*100000000, POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)), BLOCK_PERIOD=30, # s SYMBOL='IFC', CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Infinitecoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Infinitecoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.infinitecoin'), 'infinitecoin.conf'), BLOCK_EXPLORER_URL_PREFIX='http://p2pool.com:2758/block/', ADDRESS_EXPLORER_URL_PREFIX='http://p2pool.com:2758/address/', TX_EXPLORER_URL_PREFIX='http://p2pool.com:2758/tx/', SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), DUMB_SCRYPT_DIFF=2**16, DUST_THRESHOLD=0.03e8, ),
infinitecoin=math.Object( PARENT=networks.nets['infinitecoin'], SHARE_PERIOD=10, # seconds target spacing-- CHAIN_LENGTH=24*60*60//10, # shares-- REAL_CHAIN_LENGTH=24*60*60//10, # shares-- TARGET_LOOKBEHIND=20, # shares coinbase maturity SPREAD=60, # blocks--- IDENTIFIER='fc656168639f686e'.decode('hex'), PREFIX='fe636f818e6c666a'.decode('hex'), P2P_PORT=10317, MIN_TARGET=0, MAX_TARGET=2**256//2**20 - 1, PERSIST=True, WORKER_PORT=9068, BOOTSTRAP_ADDRS=' '.split(' '), ANNOUNCE_CHANNEL='#p2pool-alt', VERSION_CHECK=lambda v: True, ),
|
|
|
|
mapleshadow
Member
Offline
Activity: 79
Merit: 10
|
|
February 01, 2014, 05:31:02 PM |
|
I've recently tried to port p2pool to some newer alt coins and have been hitting a brick wall. I'm pretty sure this going beyond basic network.py values but I wanted to get some opinions. I've tried setting this up for grandcoin, lottocoin, luckycoin and earthcoin. The one I'm most interested in getting to work is earthcoin, so let's take that one for example. This is the error I receive when running it. Testing bitcoind RPC connection to 'http://127.0.0.1:5555/' with username 'user'... 2013-12-30 00:24:16.668394 > Error getting work from bitcoind: 2013-12-30 00:24:16.668474 > Traceback (most recent call last): 2013-12-30 00:24:16.668509 > File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks 2013-12-30 00:24:16.668538 > current.result = callback(current.result, *args, **kw) 2013-12-30 00:24:16.668566 > File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult 2013-12-30 00:24:16.668598 > _inlineCallbacks(r, g, deferred) 2013-12-30 00:24:16.668626 > File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks 2013-12-30 00:24:16.668675 > result = result.throwExceptionIntoGenerator(g) 2013-12-30 00:24:16.668704 > File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator 2013-12-30 00:24:16.668732 > return g.throw(self.type, self.value, self.tb) 2013-12-30 00:24:16.668759 > --- <exception caught here> --- 2013-12-30 00:24:16.668785 > File "/home/x/p2pool-eac/p2pool/util/deferral.py", line 41, in f 2013-12-30 00:24:16.668812 > result = yield func(*args, **kwargs) 2013-12-30 00:24:16.668838 > File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks 2013-12-30 00:24:16.668866 > result = g.send(result) 2013-12-30 00:24:16.668892 > File "/home/x/p2pool-eac/p2pool/bitcoin/helper.py", line 49, in getwork 2013-12-30 00:24:16.668919 > transactions=map(bitcoin_data.tx_type.unpack, packed_transactions), 2013-12-30 00:24:16.668945 > File "/home/x/p2pool-eac/p2pool/util/pack.py", line 63, in unpack 2013-12-30 00:24:16.668972 > obj = self._unpack(data, ignore_trailing) 2013-12-30 00:24:16.668998 > File "/home/x/p2pool-eac/p2pool/util/pack.py", line 47, in _unpack 2013-12-30 00:24:16.669024 > raise LateEnd() 2013-12-30 00:24:16.669050 > p2pool.util.pack.LateEnd: Now, what I noticed is in the pack.py file, the functions def _unpack(self, data, ignore_trailing=False): obj, (data2, pos) = self.read((data, 0))
assert data2 is data
if pos != len(data) and not ignore_trailing: raise LateEnd()
return obj
def unpack(self, data, ignore_trailing=False): obj = self._unpack(data, ignore_trailing)
if p2pool.DEBUG: packed = self._pack(obj) good = data.startswith(packed) if ignore_trailing else data == packed if not good: raise AssertionError()
return obj is where the error is being thrown. The pos is always 1 character bigger then len(data) when the error is thrown. So setting the ignore_trailing=True eliminates the error, but when testing it against earthcoin, we hashed overnight and found a few blocks. However, none of them were actually committed to the blockchain and nothing was paid out. So I assume that is messing with the blocks submitted and they're not valid. If you don't change that variable, the error that was mentioned is thrown for a while. Eventually it will connect to the wallet daemon, and you can actually hash in the pool, however the connection to the wallet will go unstable and the errors will start again. The connection to the wallet never really stabilizes. Just for reference here are my earthcoin network.py values. earthcoin=math.Object( PARENT=networks.nets['earthcoin'], SHARE_PERIOD=10, # seconds CHAIN_LENGTH=3*60*60//5, # shares REAL_CHAIN_LENGTH=3*60*60//5, # shares TARGET_LOOKBEHIND=120, # shares SPREAD=30, # blocks IDENTIFIER='e137d5b8c6923410'.decode('hex'), PREFIX='7218c1a53ef629b0'.decode('hex'), P2P_PORT=9338, MIN_TARGET=0, MAX_TARGET=2**256//2**20 - 1, PERSIST=False, WORKER_PORT=19330, BOOTSTRAP_ADDRS=''.split(' '), ANNOUNCE_CHANNEL='#spool', VERSION_CHECK=lambda v: True, ), earthcoin=math.Object( P2P_PREFIX='c0dbf1fd'.decode('hex'), P2P_PORT=15677, ADDRESS_VERSION=93, RPC_PORT=15678, RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'earthcoinaddress' in (yield bitcoind.rpc_help()) and not (yield bitcoind.rpc_getinfo())['testnet'] )), SUBSIDY_FUNC=lambda height: 10000*100000000 >> (height + 1)//525600, POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)), BLOCK_PERIOD=60, # s SYMBOL='EAC', CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'earthcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/earthcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.earthcoin'), 'earthcoin.conf'), BLOCK_EXPLORER_URL_PREFIX='http://earthchain.info/block/', ADDRESS_EXPLORER_URL_PREFIX='http://earthchain.info/address/', TX_EXPLORER_URL_PREFIX='http://earthchain.info/tx/', SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), DUMB_SCRYPT_DIFF=2**16, DUST_THRESHOLD=1e8, ), If anyone that has better python skills than me, and a better knowledge of how p2pool works cares to help, I'd greatly appreciate it. Like I said, I don't think this is isolated to earthcoin as I've seen this behavior with several new alt coins. Also, I've posted a bug report on the official p2pool github in case anyone wants to contribute. error error error error................
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 03, 2014, 02:54:56 PM |
|
can we update the TS with all known settings and their required values and where to find those values?
|
|
|
|
|
mmininginc
|
|
February 05, 2014, 01:27:36 PM |
|
Developers of new alt-coins should also release the right p2pool config immediately when a coin is launched. This should become a standard practice, so that every p2pool node uses the exact same configuration creating one homogeneous mega pool. I've seen multiple p2pools for the same coin because multiple persons create different configurations. P2pool is pretty useless if the nodes for the same coin do not all act as one.
I like p2pool a lot but I still fail to find correct configurations for new alt-coins.
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 05, 2014, 02:01:58 PM |
|
Developers of new alt-coins should also release the right p2pool config immediately when a coin is launched. This should become a standard practice, so that every p2pool node uses the exact same configuration creating one homogeneous mega pool. I've seen multiple p2pools for the same coin because multiple persons create different configurations. P2pool is pretty useless if the nodes for the same coin do not all act as one.
I like p2pool a lot but I still fail to find correct configurations for new alt-coins.
Yes I agree completely! How can we enforce this?
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 07, 2014, 03:01:56 PM Last edit: February 09, 2014, 09:58:39 AM by tvb |
|
So, I had a little chat with forrestv! Here is some information on how to find the correct settings for the /bitcoin/networks.py file. Attention: the /bitcoin/networks.py is COIN SPECIFICSample /bitcoin/networks.py: <COINNAME>=math.Object( P2P_PREFIX='<HEX CODE>'.decode('hex'), P2P_PORT=<COIN PORT>, ADDRESS_VERSION=<X>, RPC_PORT=<RPCPORT>, RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue( '<lower case coin name>address' in (yield bitcoind.rpc_help()) and not (yield bitcoind.rpc_getinfo())['testnet'] )), SUBSIDY_FUNC=lambda height: <X>*<TOTAL COINS> >> (height + 1)//840000, POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)), BLOCK_PERIOD=<SECONDS>, # s SYMBOL='<COIN SHORTNAME>', CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], '<WINDOWS FOLDER NAME>') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/<OSX FOLDER NAME>/') if platform.system() == 'Darwin' else os.path.expanduser('~/.<LINUX FOLDER NAME>'), '<CONF FILE NAME>.conf'), BLOCK_EXPLORER_URL_PREFIX='<URL OF BLOCKCHAIN INFO>', ADDRESS_EXPLORER_URL_PREFIX='<URL OF ADDRESS INFO>', TX_EXPLORER_URL_PREFIX='<URL OF TX INFO>', SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1), DUMB_SCRYPT_DIFF=2**16, DUST_THRESHOLD=0.03e8, ), Detailed explanationP2P_PREFIX = <HEX CODE> pulled from ./src/main.ccp (search for "unsigned char pchMessageStart" and use the value between { } (remove all 0x)) P2P_PORT = <COIN PORT> pulled from ./src/protocol.h (search for "GetDefaultPort", 2nd value will be the port value.) ADDRESS_VERSION = <X> <X> pulled from ./src/base58.h (search for "PUBKEY_ADDRESS") RPC_PORT = <RPCPORT> pulled from ./src/bitcoinrpc.cpp (search for 'GetArg("-rpcport", xxxx)' where xxxx is the value of the port. RPC_CHECK change e.g. 'litecoinaddress' to '<lower case coin name>address' SUBSIDY_FUNC = <X>*<TOTAL COINS> >> (height + 1)//<HEIGHT WHERE BLOCK HALVES> <X> pulled from ./src/main.cpp (search for "nSubsidy") <HEIGHT WHERE BLOCK HALVES> pulled from ./src/main.cpp (search for "nSubsidy >>= (nHeight") note: If there is no "halfing" you should take out the ">> (height + 1)//<HEIGHT WHERE BLOCK HALVES>" BLOCK_PERIOD = <SECONDS> <SECONDS> pulled from ./src/main.cpp (search for "static const int64 nTargetSpacing") SYMBOL = <COIN SHORTNAME> Like BTC, LTC, DOGE CONF_FILE_FUNC = change <WINDOWS FOLDER NAME>, <OSX FOLDER NAME>, <LINUX FOLDER NAME> and <CONF FILE NAME> BLOCK_EXPLORER_URL_PREFIX = <URL OF BLOCKCHAIN INFO> ADDRESS_EXPLORER_URL_PREFIX = <URL OF ADDRESS INFO> TX_EXPLORER_URL_PREFIX = <URL OF TX INFO> SANE_TARGET_RANGE = (2**256//1000000000 - 1, 2**256//1000 - 1) No changes for scrypt. DUMB_SCRYPT_DIFF = 2**16 No changes for scrypt. DUST_THRESHOLD = 0.03e8 No changes for scrypt. Note about DUST_TRESHOLD: In an effort to reduce the number of very small dust payments hanging around in peoples wallets, it does this by looking at your expected block payment and adjusted the required share difficulty until this is above its DUST_THRESHOLD value (current 0.1000). Transaction fees in Litecoin have been designed to protect the network from a problem known as transaction spam (dust transactions). If someone was to setup a loop between two wallets, sending back and forth small amounts, they would grow the block chain. Fees prevent this as it becomes too expensive to do this.[/size]
|
|
|
|
roy7
|
|
February 07, 2014, 03:04:56 PM |
|
Fantastic post TVB. Only item you didn't list was SPREAD which I believe is the # of blocks worth of work to pay out, ie the PPLNS window size (N being SPREAD # of blocks of work).
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 07, 2014, 03:11:31 PM |
|
Fantastic post TVB. Only item you didn't list was SPREAD which I believe is the # of blocks worth of work to pay out, ie the PPLNS window size (N being SPREAD # of blocks of work).
I will soon follow up with details about the /networks.py file which is not coin specific but p2pool specific and thus different from /bitcoin/networks.py! /networks.py contains the SPREAD value etc.
|
|
|
|
roy7
|
|
February 07, 2014, 03:12:34 PM |
|
Fantastic post TVB. Only item you didn't list was SPREAD which I believe is the # of blocks worth of work to pay out, ie the PPLNS window size (N being SPREAD # of blocks of work).
I will soon follow up with details about the /networks.py file which is not coin specific but p2pool specific and thus different from /bitcoin/networks.py! /networks.py contains the SPREAD value etc. Ah ok, right. Two different files with different purposes and exactly the same name. One really should be coins.py.
|
|
|
|
mmininginc
|
|
February 07, 2014, 03:35:09 PM |
|
Tnx for sharing this tvb!
|
|
|
|
juiced
Newbie
Offline
Activity: 21
Merit: 0
|
|
February 07, 2014, 03:44:52 PM |
|
+1 for tvb!
|
|
|
|
CartmanSPC
Legendary
Offline
Activity: 1270
Merit: 1000
|
|
February 07, 2014, 07:33:09 PM |
|
Good stuff tvb. I have considered starting a new thread outlining the values with the OP being updated as needed but will start by making a few comments on yours. P2P_PORT = <COIN PORT> pulled from ./src/init.cpp Pulling from that location IMO is not a good idea. Better to pull from the actual code "use" than the notes field in init.cpp. You can find the P2P_PORT in the coin's source code in the protocol.h file, it's the 2nd value after GetDefaultPort. RPC_PORT = <RPCPORT> <PORT> pulled from src/init.cpp (search for "-rpcport")
Again, pulling from that location IMO is not a good idea. Better to pull from the actual code "use" than the notes field in init.cpp. You can find RPC_PORT in bitcoinrpc.cpp file, look for GetArg("-rpcport", xxxx), where xxxx is the port. DUST_THRESHOLD = 0.03e8 I understand why they want to do this for Litecoin and Bitcoin but for most alts I feel this setting is too high (or low depending on how you look at it). I think most smaller miners (which is what were really addressing here) would appreciate more consistent payments in smaller increments rather than fewer larger payments. I use DUST_THRESHOLD=1e8 Fewer (but larger) payments (I feel) puts off miners. Yes, it does increase the number of transactions in their wallet and may cost them more in fees when they try to use them but implementing coin control from newer litecoin releases can help there. They can also split up their transactions or wait for sufficient coin age. Ok, those are my inputs.
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 07, 2014, 07:52:27 PM |
|
Good stuff tvb.
I have considered starting a new thread outlining the values with the OP being updated as needed but will start by making a few comments on yours. ...
I agree, although forrestv really should add it to the p2pool wiki or p2pool.info website And you are right. 'pulling' the actual configured values from the source is better. Thanks for that! I think we can now focus on the p2pool specific networks.py values..
|
|
|
|
mmouse
|
|
February 07, 2014, 09:08:17 PM |
|
Developers of new alt-coins should also release the right p2pool config immediately when a coin is launched. This should become a standard practice, so that every p2pool node uses the exact same configuration creating one homogeneous mega pool. I've seen multiple p2pools for the same coin because multiple persons create different configurations. P2pool is pretty useless if the nodes for the same coin do not all act as one.
I like p2pool a lot but I still fail to find correct configurations for new alt-coins.
Yes I agree completely! How can we enforce this? I think https://github.com/Rav3nPL/p2pool-rav.githas the most complete network.py files for most altcoins. So if you want to add a new coin, probably the best way would be to clone that and do a merge request afterwards. That way there won't be 1001 different versions of p2pool on github, each of them working for exactly one altcoin Just my 2 cent. ... and thanks a lot @TVB for the hard facts.
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 07, 2014, 09:19:24 PM |
|
Developers of new alt-coins should also release the right p2pool config immediately when a coin is launched. This should become a standard practice, so that every p2pool node uses the exact same configuration creating one homogeneous mega pool. I've seen multiple p2pools for the same coin because multiple persons create different configurations. P2pool is pretty useless if the nodes for the same coin do not all act as one.
I like p2pool a lot but I still fail to find correct configurations for new alt-coins.
Yes I agree completely! How can we enforce this? I think https://github.com/Rav3nPL/p2pool-rav.githas the most complete network.py files for most altcoins. So if you want to add a new coin, probably the best way would be to clone that and do a merge request afterwards. That way there won't be 1001 different versions of p2pool on github, each of them working for exactly one altcoin Just my 2 cent. ... and thanks a lot @TVB for the hard facts. Yeah, only if people would submit a merge request. That would be ideal. I will probably start a new fork especially for that.
|
|
|
|
CartmanSPC
Legendary
Offline
Activity: 1270
Merit: 1000
|
|
February 07, 2014, 10:03:34 PM Last edit: February 07, 2014, 10:16:57 PM by CartmanSPC |
|
One of the problems is that coins occasionally change specs (DGC, WDC, CRCx2 and soon CSC...of the ones I track) and p2pool has to be updated to those new coin specs. It is a very hard job to keep up with everything I try to stay on top of the coins I use in my git.
|
|
|
|
tvb
Newbie
Offline
Activity: 38
Merit: 0
|
|
February 07, 2014, 10:21:12 PM |
|
Well, imo that is the responsibly of the coin developer(s). They should submit a merge request then.
|
|
|
|
CartmanSPC
Legendary
Offline
Activity: 1270
Merit: 1000
|
|
February 07, 2014, 10:37:42 PM |
|
As an example...I believe Ravs git has old specs on some of the coins.
|
|
|
|
CartmanSPC
Legendary
Offline
Activity: 1270
Merit: 1000
|
|
February 07, 2014, 10:47:57 PM |
|
SUBSIDY_FUNC = <X>*<TOTAL COINS> <X> pulled from ./src/main.cpp (search for "nSubsidy") <TOTAL COINS> total number of minable coins.
I believe this is incorrect. I think the correct way is: for litecoin: SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000, SUBSIDY_FUNC=lambda height: 'block reward' * 'satoshies' >> (height + 1)//'height where block halves'. If there is no "halfing" you take out the >> (height + 1)//'height where block halves' //840000 is the number from main.cpp in nSubsidy -> nSubsidy >>= (nHeight /
|
|
|
|
|