Bitcoin Forum

Alternate cryptocurrencies => Mining (Altcoins) => Topic started by: spoid on May 23, 2013, 09:06:31 PM



Title: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 23, 2013, 09:06:31 PM
I have read all google and forum results I could find, it appears that nobody ever mentioned how to find a few certain values for the two networks.py files in p2pool:

SUBSIDY_FUNC
ADDRESS_VERSION
P2P_PREFIX

IDENTIFIER
PREFIX

I think I pretty much understand what all the other values do. However those 5 (and especially the hex values) make no sense to me. Do you strip them somewhere from the compiled source when a new coin has arrived?

Cheers!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on May 23, 2013, 09:31:38 PM
I have read all google and forum results I could find, it appears that nobody ever mentioned how to find a few certain values for the two networks.py files in p2pool:

SUBSIDY_FUNC
ADDRESS_VERSION
P2P_PREFIX

IDENTIFIER
PREFIX

I think I pretty much understand what all the other values do. However those 5 (and especially the hex values) make no sense to me. Do you strip them somewhere from the compiled source when a new coin has arrived?

Cheers!

SUBSIDY_FUNC can be found in the source code, specifically in main.cpp, search for nSubsidy, you'll find a line that looks a lot like

nSubsidy >>= (nHeight / 8400000);

The C++ syntax is different than the python syntax, but that is where you can get the information.

For ADDRESS_VERSION, look again in the sourcecode in the file base58.h, and find the value of PUBKEY_ADDRESS.

For the other 3 values, I'm under the impression that they are not values inherent to the alt-coin, but rather values to allow various p2pool nodes for a given alt-coin to communicate with each other.  Therefore, there is no way to "look them up" in the coin itself -- you have to coordinate the values between the p2pool nodes that you want to intermesh with. 


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 23, 2013, 09:38:36 PM
thanks a lot! so if a coin was just created and I am running a solo node (remove BOOTSTRAP_ADDRS and PERSIST=False) anyways, can I just leave in the old hex values of another coin for the time being or do I have to create new values given after a certain rule?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on May 23, 2013, 09:56:07 PM
thanks a lot! so if a coin was just created and I am running a solo node (remove BOOTSTRAP_ADDRS and PERSIST=False) anyways, can I just leave in the old hex values of another coin for the time being or do I have to create new values given after a certain rule?

My experience, at least when running a "private" p2pool has been that leaving the old hex values from another coin will work in the sense that p2pool will work with the new coin.  I don't know one way or the other whether it leaves open the possibility for misbehavior or crosstalk if you have a port open where p2pools for the "other" coin find yours and mistakenly think they can talk to it.

Incidentally, what does the PERSIST flag do?   I only started tinkering with p2pool configuration about a week ago myself.






Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 23, 2013, 10:04:44 PM
I don't really know as well, just took it from a post by blastbob:

Quote
In p2pool / p2pool / networks.py:

change the
BOOTSTRAP_ADDRS='188.120.239.144 81.200.245.198 85.234.62.99 81.200.241.54 217.77.220.40'.split(' '),
to
BOOTSTRAP_ADDRS=''.split(' '),

Change PERSIST=True, to PERSIST=False,

Change P2P_PORT=9777, to something else

In p2pool / p2pool / bitcoin / networks.py

Change ADDRESS_VERSION=8, to ADDRESS_VERSION=25


Removing info in addrs and Persist=False will make your node run solo. Can be a good idea until parameter is 100%
No guarantee the above is 100% correct
Rest you need help from others


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 12:26:37 AM
I don't really know as well, just took it from a post by blastbob:

Quote
In p2pool / p2pool / networks.py:

change the
BOOTSTRAP_ADDRS='188.120.239.144 81.200.245.198 85.234.62.99 81.200.241.54 217.77.220.40'.split(' '),
to
BOOTSTRAP_ADDRS=''.split(' '),

Change PERSIST=True, to PERSIST=False,

Change P2P_PORT=9777, to something else

In p2pool / p2pool / bitcoin / networks.py

Change ADDRESS_VERSION=8, to ADDRESS_VERSION=25


Removing info in addrs and Persist=False will make your node run solo. Can be a good idea until parameter is 100%
No guarantee the above is 100% correct
Rest you need help from others

Hey man, I am doing the same research for a couple of days.

Can you tell me, how to find out, how to change those values in networks.py?

SHARE_PERIOD
CHAIN_LENGTH
SPREAD


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 09:13:35 AM
I think now i got it this far...

But the Problem ist: The RPC connection of P2Pool to bitcoind is working. But then it says testing P2P connection, and nothing happens... I set Port '3234' in the 'networks.py' '/bitcoin/networks.py' and in the .conf file for the coin to the same value.

Maybe it has somethig to do with the 'P2P_PREFIX' in the 'bitcoin/networks.py'???


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 24, 2013, 09:43:14 AM
In most working p2pool sources I downloaded the "p2pool port" was different in the bitcoin/networks.py and the networks.py - I think one is for communication between different p2pools and one is the "port=" from your .conf file ...

I tried to modify my files for a solo p2pool from feathercoin to phenixcoin but am only getting:
"Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!"

@schnebi
I did not really found out how they work exactly, but I think that
SHARE_PERIOD
CHAIN_LENGTH
don't have to be changed or only fine-tuned later since they deal with the p2pool's share system.

as for SPREAD, i read somewhere that you should adapt it to the block target time (i.e. bitcoin has SPREAD=3 and creates a block every 10 minutes, litecoin has SPREAD=12 and creates a block every 2.5 minutes, I saw BQC with SPREAD=30 and it creates a block every 1 minute I think). However there seem to be exceptions, I have no idea why I am seeing feathercoin pools with SPREAD=120.

I see that you are ready to release a Luckycoin Pool on release, so I assume you got it to work?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 10:00:13 AM
In most working p2pool sources I downloaded the "p2pool port" was different in the bitcoin/networks.py and the networks.py - I think one is for communication between different p2pools and one is the "port=" from your .conf file ...

I tried to modify my files for a solo p2pool from feathercoin to phenixcoin but am only getting:
"Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!"

@schnebi
I did not really found out how they work exactly, but I think that
SHARE_PERIOD
CHAIN_LENGTH
don't have to be changed or only fine-tuned later since they deal with the p2pool's share system.

as for SPREAD, i read somewhere that you should adapt it to the block target time (i.e. bitcoin has SPREAD=3 and creates a block every 10 minutes, litecoin has SPREAD=12 and creates a block every 2.5 minutes, I saw BQC with SPREAD=30 and it creates a block every 1 minute I think). However there seem to be exceptions, I have no idea why I am seeing feathercoin pools with SPREAD=120.

I see that you are ready to release a Luckycoin Pool on release, so I assume you got it to work?

I thouht i would be ready, to make a LuckyCoin Pool, but i think there are still some small issues. I tried setting up al Goldcoin-P2Pool for practicing purpose and everything seems fine so far. The Pool is running, and the workers can connect. But the workers can't submit shares to the Pool. SO the Hashrate stays at 0,0 KHashs......

Here are my 'networks.py' and '/bitcoin/networks.py'.... Maybe you can see my mistake


Code:
gldcoin=math.Object(
        PARENT=networks.nets['gldcoin'],
        SHARE_PERIOD=90, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=20, # blocks
        IDENTIFIER='fc70035c7a81bc6f'.decode('hex'),
        PREFIX='2472ef181efcd37b'.decode('hex'),
        P2P_PORT=8384,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**32 - 1,
        PERSIST=False,
        WORKER_PORT=8909,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,

Code:
 gldcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=8384,
        ADDRESS_VERSION=32,
        RPC_PORT=8909,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'gldcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 100*100000000 >> (height + 1)//673700,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=90, # s
        SYMBOL='GLD',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'gldcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/gldcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.gldcoin'), 'gldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://blockexplorer.com/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://blockexplorer.com/address/',
        SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

You can try to connect your Workers at crypto-coins.de:8909

Everythings seems finde... But no submitted shares...  >:(


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 24, 2013, 10:45:11 AM
hmm, so maybe those share values are important after all. did you mindless try all values from other copycoins for

SHARE_PERIOD=90, # seconds
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
TARGET_LOOKBEHIND=200, # shares

?

Also, which p2pool version did you originally set out with? Did you change everything to "gldcoin" ONLY in the networks.py files? I thought that would give some problems further down the code - f.e. "'gldcoinaddress' in (yield bitcoind.rpc_help()) and" shouldn't work without you changing that method name as well?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 10:55:54 AM
hmm, so maybe those share values are important after all. did you mindless try all values from other copycoins for

SHARE_PERIOD=90, # seconds
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
TARGET_LOOKBEHIND=200, # shares

?

Also, which p2pool version did you originally set out with? Did you change everything to "gldcoin" ONLY in the networks.py files? I thought that would give some problems further down the code - f.e. "'gldcoinaddress' in (yield bitcoind.rpc_help()) and" shouldn't work without you changing that method name as well?

I tried several combinations of the values. But it made no difference.... But i haven't tried all posible combinations yet.

I don't really know what you mean by 'Changing the methods' name.... In fact, the P2Pool server does recognize the workers, and also the standart Payout address, where to pay the fee... It also submits the Blocks to the Worker... The Worker is just not able to submit shares to the Server... It just says "New Block detected" and "server requestet work restart"


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 11:19:55 AM
hmm, so maybe those share values are important after all. did you mindless try all values from other copycoins for

SHARE_PERIOD=90, # seconds
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
TARGET_LOOKBEHIND=200, # shares

?

Also, which p2pool version did you originally set out with? Did you change everything to "gldcoin" ONLY in the networks.py files? I thought that would give some problems further down the code - f.e. "'gldcoinaddress' in (yield bitcoind.rpc_help()) and" shouldn't work without you changing that method name as well?

I tried several combinations of the values. But it made no difference.... But i haven't tried all posible combinations yet.

I don't really know what you mean by 'Changing the methods' name.... In fact, the P2Pool server does recognize the workers, and also the standart Payout address, where to pay the fee... It also submits the Blocks to the Worker... The Worker is just not able to submit shares to the Server... It just says "New Block detected" and "server requestet work restart"

Found  

Code:
return (GetTime() - nLastUpdate < 10 &&
            pindexBest->GetBlockTime() < GetTime() - 24 * 60 * 60);

in main.cpp of Goldcoin....

So i think CHAIN_LENGTH=24*60*60//10 is right


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 11:29:08 AM
I have another idea... It seems like the difficulty of the work P2Pool sends to the worker is to high. Its 0.99999

At my other P2Pools the Share difficulty is someting like 0.01....

So its simply to difficult for my Worker to get accepted share.

Does that sound reasonable? And how can I change?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 24, 2013, 11:39:34 AM
maybe try to lower SHARE_PERIOD=90, # seconds to 30?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 11:52:19 AM
Okay... I think i got it in theory....

There is a line saying DUMB_SCRYPT_DIFFICULTY which say 2**16 or 2**12 for all Altcoins.

I changed the value to "1" as it is for Bitcoin and i got hundreds of accepted shares per minute... But thats also incorrect.... So I Think we have to play with this value... I wonder, why it works with all other Coins with a value of 2**16 or 2**12


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 24, 2013, 12:20:06 PM
I'm pretty shure now, the Problem is all about the difficulty...

I modified a new networks.py again the same way i did it before, because i thougt, that somewhere i made a mistake. And now the behaviour is changing. Im getting Pretty much accepted shares, but all Shares are with a Difficulty of "0"...... I will make screenshots later that day, so maybe it will become clearer whts the Problem...


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 24, 2013, 06:24:38 PM
Okay... I think i got it in theory....

There is a line saying DUMB_SCRYPT_DIFFICULTY which say 2**16 or 2**12 for all Altcoins.

I changed the value to "1" as it is for Bitcoin and i got hundreds of accepted shares per minute... But thats also incorrect.... So I Think we have to play with this value... I wonder, why it works with all other Coins with a value of 2**16 or 2**12

However when skimming through those I found those were the same for all scrypt coins and all sha256 coins. So I only saw 2 different versions. I still don't get the RPC connection to work though. :(

Quote
   feathercoin=math.Object(
        PARENT=networks.nets['feathercoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=60*60//10, # shares
        REAL_CHAIN_LENGTH=60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=12, # blocks
        IDENTIFIER='4665617468657221'.decode('hex'),
        PREFIX='b131010ba6d4729a'.decode('hex'),
        P2P_PORT=19333,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19324,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,


Quote
   feathercoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=19333,
        ADDRESS_VERSION=56,
        RPC_PORT=6666,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'feathercoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150, # s
        SYMBOL='PXC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Phenixcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Phenixcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.phenixcoin'), 'phenixcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:5750/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://cryptocoinexplorer.com:5750/address/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,


Quote
rpcuser=toaster
rpcpassword=itsthefinaltoastdown
rpcport=6666
port=6667
rpcallowip=127.0.0.1
rpcallowip=*
server=1
daemon=1

Quote
python ./p2pool-phenixcoin/run_p2pool.py --net feathercoin -a Pn57eZyeMD93RXYxwfh6C6QYjtGJQ24BLx -f 1 --give-author 1 --w 19324 --bitcoind-p2p-port 6667 --bitcoind-rpc-port 6666 toaster itsthefinaltoastdown


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 25, 2013, 12:35:49 AM
bump. :( of despair.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on May 25, 2013, 01:11:47 AM
bump. :( of despair.

Hmm.  If I understood correctly the config files you quoted in post #17 are your attempt at modifying the feathercoin settings to get p2pool to work with phenixcoin, but you are getting an RPC connection error when you actually run p2pool after launching phenixcoin?

Two possibilities come to mind.  First, the RPC_PORT value should ordinarily be set in the bnetworks.py file to the phenixcoin peer-to-peer listening port.  My understanding (I haven't doublechecked) is that the default P2P port in phenixcoin is 9555.  Unless you've changed this port (with a port=9666 line) in your phenixcoin.conf file, you should set RPC_PORT=9555 in the bnetworks.py file.

Second, you may need to change 'feathercoinaddress' to 'phenixcoinaddress' in the RPC_CHECK entry in the bnetworks.py file...I think this may be a coin-specific call to obtain a coin address.

Hope this helps, or at least, moves you on to troubleshooting a different error code.   ;)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 26, 2013, 04:33:34 PM
I think that was it for now! Testing pool now... but with my solo hash power I will never really know if it works :D


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 26, 2013, 04:59:57 PM
I think that was it for now! Testing pool now... but with my solo hash power I will never really know if it works :D

I thought i got it running. I modifed the networks.py and i was able to create a pool for Goldcoin.... Now i tried to do the same for DragonCoin..... But Iam stuck at the point, where P2Pool says "Testing bitcoind P2P connection to 127.0.0.1:12579"

I don't understand, why it is not going on, because i unsed exactly the same settings than for Goldcoin. Just changed the Port for one Number....


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 26, 2013, 05:17:23 PM
Maybee someone can have a look at that:

This are my networks.py:

Code:
dnccoin=math.Object(
        PARENT=networks.nets['dnccoin'],
        SHARE_PERIOD=60,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=20,
        IDENTIFIER='e021a7b8c602421f'.decode('hex'),
        PREFIX='e267893ae6b8617b'.decode('hex'),
        P2P_PORT=48909,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8910,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-worldcoin',
        VERSION_CHECK=lambda v: True,
    ),

Code:
dnccoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=48909,
        ADDRESS_VERSION=62,
        RPC_PORT=9996,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'DragonCoin address' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 95*10000000 >> (height + 1)//10519200,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s targetspacing
        SYMBOL='DNC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'dragoncoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/dragoncoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.dragoncoin'), 'dragoncoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://d.evco.in/abe/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://d.evco.in/abe/address/',
        SANE_TARGET_RANGE=(2**256//100000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

This is my DragonCoin.conf

Code:
rpcuser=******
rpcpassword=*******
rpcallowip=*.*.*.*
rpcport=9996
port=12579
addnode=198.46.137.53
addnode=198.12.67.152
daemon=1
server=1

And this is what happens:

http://www.crypto-coins.de/html/unbenannt.jpg

After that it's stuck at this screen... I really don't know, what to change....


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 26, 2013, 05:40:46 PM
yeah, that's exactly where it ends for me as well. Nice catch on the "DragonCoin address". How did you guess that there was a space there? I gave up on it at that point - dragoncoinaddress, dncaddress, DragonCoinaddress, DragonCoinAddress, smallchangeaddress... nothing seemed to work.

I wonder if those nodes are really running solo anyway. Since my phenixcoin pool is still somehow connected to the feathercoin p2p network and shows some pool data. When I connect my miners to my phenixcoin pool, they connect and mine just fine, but if I do a ./phenixcoin gethashespersec on the VPS it returns 0. So it is definitely not solo mining with my wallet ...? :(

http://84.200.206.231:19324/static/


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: schnebi on May 26, 2013, 08:15:27 PM
yeah, that's exactly where it ends for me as well. Nice catch on the "DragonCoin address". How did you guess that there was a space there? I gave up on it at that point - dragoncoinaddress, dncaddress, DragonCoinaddress, DragonCoinAddress, smallchangeaddress... nothing seemed to work.

I wonder if those nodes are really running solo anyway. Since my phenixcoin pool is still somehow connected to the feathercoin p2p network and shows some pool data. When I connect my miners to my phenixcoin pool, they connect and mine just fine, but if I do a ./phenixcoin gethashespersec on the VPS it returns 0. So it is definitely not solo mining with my wallet ...? :(

http://84.200.206.231:19324/static/

Yeah.. that was a little bit tricky... I searched all the Source files of Litecoin for the Term "litecoinadress". And then i looked up the same File in DragonCoin and found the term "DragonCoin address"

I' also tried to do a luckycoin pool. The P2Pool is starting completely with this coin. But then it just sends Work with the difficulty "0" to the worker, so that the accepted shares are worth nothing.....


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: WOPR on May 28, 2013, 12:14:24 PM
Maybee someone can have a look at that:

This are my networks.py:

Code:
dnccoin=math.Object(
        PARENT=networks.nets['dnccoin'],
        SHARE_PERIOD=60,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=20,
        IDENTIFIER='e021a7b8c602421f'.decode('hex'),
        PREFIX='e267893ae6b8617b'.decode('hex'),
        P2P_PORT=48909,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8910,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-worldcoin',
        VERSION_CHECK=lambda v: True,
    ),

Code:
dnccoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=48909,
        ADDRESS_VERSION=62,
        RPC_PORT=9996,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'DragonCoin address' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 95*10000000 >> (height + 1)//10519200,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s targetspacing
        SYMBOL='DNC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'dragoncoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/dragoncoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.dragoncoin'), 'dragoncoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://d.evco.in/abe/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://d.evco.in/abe/address/',
        SANE_TARGET_RANGE=(2**256//100000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

This is my DragonCoin.conf

Code:
rpcuser=******
rpcpassword=*******
rpcallowip=*.*.*.*
rpcport=9996
port=12579
addnode=198.46.137.53
addnode=198.12.67.152
daemon=1
server=1

And this is what happens:

http://www.crypto-coins.de/html/unbenannt.jpg

After that it's stuck at this screen... I really don't know, what to change....

In bitcoin/networks.py, set:
P2P_PORT=12579
RPC_PORT=9996



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: spoid on May 28, 2013, 04:31:48 PM
yeah, that's the same problem we all 3 are having. someone enlightened has to show up. XD


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on May 28, 2013, 09:49:41 PM
I think I may have figured this out.  I had been bumping into the same problem (stalling at the P2P connection) on some coins but not others.  I finally realized I was wrong in an initial assumption...the P2P_PREFIX setting in bitcoin/networks.py is in fact a coin-specific setting -- which is logical, as the other settings in that file are coin-specific as well.   In fact, it looks like it is basically the "magic value" or "magic number" referred to in https://en.bitcoin.it/wiki/Protocol_specification, and after poking around in the code I think you can find it in main.cpp at pchMessageStart[4]=...  Using this specific value as the P2P_PREFIX fixed the problem for me.

So, for example, I haven't ever installed Dragoncoin myself, but looking quickly at the relevant line in main.cpp:

Code:
unsigned char pchMessageStart[4] = { 0xfc, 0xd9, 0xb7, 0xdd };

Thus, for Dragoncoin, try setting

Code:
P2P_PREFIX='fcd9b7dd'.decode('hex'),

and let us know if that gets you past stalling at the P2P connection.

Hope this is helpful.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: fenican on May 29, 2013, 03:16:34 PM
Any insight into why block numbers would display inaccurately?

I just set up a pool for AmericanCoin and I think I got all the settings correct but block numbers being shown for recent blocks are not accurate


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on May 31, 2013, 01:43:44 PM
i am stucked to everything... i got so confused...... but anyways if there is anyone that can train me on that thing i give him like 500 WDC to show me the way


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on May 31, 2013, 07:33:23 PM
hi guys.

after allot of seatch and all that stuff i changed the networks.py to both bolther. i also changed the main.py to agree with my worldcoin configuration. with help of this link above.

https://github.com/rbdrbd/p2pool/commit/596c7483b4d24b8e7063a68dfb1513a2120f2e52

also my settings are like this

Code:
nets = dict(
    worldcoin=math.Object(
        PARENT=networks.nets['worldcoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=24*60*60//30, # shares
        REAL_CHAIN_LENGTH=24*60*60//30, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='f982abe394923510'.decode('hex'),
        PREFIX='8208c1a53ef649b0'.decode('hex'),
        P2P_PORT=9767,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8336,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v >= 60004,
    ),
    worldcoin_testnet=math.Object(
        PARENT=networks.nets['worldcoin_testnet'],
        SHARE_PERIOD=3, # seconds
        CHAIN_LENGTH=20*60//3, # shares
        REAL_CHAIN_LENGTH=20*60//3, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=12, # blocks
        IDENTIFIER='f982abe394923510'.decode('hex'),
        PREFIX='8208c1a54ef649b0'.decode('hex'),
        P2P_PORT=19767,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=18336,
        BOOTSTRAP_ADDRS=' '.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v >= 60004,
    ),

and also this one at bitcoin folder.

Code:
    worldcoin=math.Object(
        P2P_PREFIX='aef904f3'.decode('hex'),
        P2P_PORT=7777,
        ADDRESS_VERSION=73,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=600, # s
        SYMBOL='NVC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Worldcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/worldcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//2**20//1000 - 1, 2**256//2**20 - 1),
    ),
    worldcoin_testnet=math.Object(
        P2P_PREFIX='abc3f0db'.decode('hex'),
        P2P_PORT=17777,
        ADDRESS_VERSION=111,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinadress' in (yield bitcoind.rpc_help()) and
            (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=600, # s
        SYMBOL='tNVC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Novacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/NovaCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
    ),

now i am trying to run
Code:
python run_p2pool.py help
and i get that error

  File "run_p2pool.py", line 5, in <module>
    main.run()
  File "/root/p2pool/p2pool/main.py", line 446, in run
    net = networks.nets[net_name]
KeyError: 'bitbar'

any ideas on that ?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Lebrick on May 31, 2013, 08:04:23 PM
hi guys.

after allot of seatch and all that stuff i changed the networks.py to both bolther. i also changed the main.py to agree with my worldcoin configuration. with help of this link above.

https://github.com/rbdrbd/p2pool/commit/596c7483b4d24b8e7063a68dfb1513a2120f2e52

also my settings are like this

Code:
nets = dict(
    worldcoin=math.Object(
        PARENT=networks.nets['worldcoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=24*60*60//30, # shares
        REAL_CHAIN_LENGTH=24*60*60//30, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='f982abe394923510'.decode('hex'),
        PREFIX='8208c1a53ef649b0'.decode('hex'),
        P2P_PORT=9767,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8336,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v >= 60004,
    ),
    worldcoin_testnet=math.Object(
        PARENT=networks.nets['worldcoin_testnet'],
        SHARE_PERIOD=3, # seconds
        CHAIN_LENGTH=20*60//3, # shares
        REAL_CHAIN_LENGTH=20*60//3, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=12, # blocks
        IDENTIFIER='f982abe394923510'.decode('hex'),
        PREFIX='8208c1a54ef649b0'.decode('hex'),
        P2P_PORT=19767,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=18336,
        BOOTSTRAP_ADDRS=' '.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v >= 60004,
    ),

and also this one at bitcoin folder.

Code:
    worldcoin=math.Object(
        P2P_PREFIX='aef904f3'.decode('hex'),
        P2P_PORT=7777,
        ADDRESS_VERSION=73,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=600, # s
        SYMBOL='NVC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Worldcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/worldcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//2**20//1000 - 1, 2**256//2**20 - 1),
    ),
    worldcoin_testnet=math.Object(
        P2P_PREFIX='abc3f0db'.decode('hex'),
        P2P_PORT=17777,
        ADDRESS_VERSION=111,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinadress' in (yield bitcoind.rpc_help()) and
            (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=600, # s
        SYMBOL='tNVC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Novacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/NovaCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
    ),

now i am trying to run
Code:
python run_p2pool.py help
and i get that error

  File "run_p2pool.py", line 5, in <module>
    main.run()
  File "/root/p2pool/p2pool/main.py", line 446, in run
    net = networks.nets[net_name]
KeyError: 'bitbar'

any ideas on that ?


With this one its regarding something to do with Bitbar?? possible it was around the area you edited in the main.py.

From what i have searched and tinkered with so far the only 3 files we need to touch are networks.py in p2pool folder and networks.py and helper.py in bitcoin folder.

napoleon maybe re-do your settings but dont edit the main.py just the 3 files i mentioned.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 06:15:37 AM
ok will make again the py's again and we talk in a few hours. can you tell the lines in help.py ? if that is possible ? not to read the hole code ?

Code:
SUBSIDY_FUNC=lambda height: 95*10000000 >> (height + 1)//10519200,

i also found that 95 are the coins
100000000  no idea what is this
>>(height + 1) again no idea
//10519200 is the number from main.cpp in nSubsidy


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Lebrick on June 01, 2013, 06:44:32 AM
according to your error its not in your help.py but your main.py

File "/root/p2pool/p2pool/main.py", line 446, in run
    net = networks.nets[net_name]

ok will make again the py's again and we talk in a few hours. can you tell the lines in help.py ? if that is possible ? not to read the hole code ?

Code:
SUBSIDY_FUNC=lambda height: 95*10000000 >> (height + 1)//10519200,

i also found that 95 are the coins
100000000  no idea what is this
>>(height + 1) again no idea
//10519200 is the number from main.cpp in nSubsidy

You got the same idea as me  ;D
As i understand this method:
95 = Block reward
10000000 =  ???
>> (height + 1) = this returns the current block chain length
10519200 = either was total coins or when to half rewards i can not remember

Some tips below for you as well  :D

When redoing your p2pool your only need to edit:
Code:
p2pool-main-folder\p2pool\networks.py - P2PNTWK
p2pool-main-folder\p2pool\bitcoin\networks.py - BCDNTWK
p2pool-main-folder\p2pool\bitcoin\helper.py - BCDHLP
networks.py for your coin seam to be sorted, just make sure your P2PNTWK ports are not the same as your BCDNTWK. BCDNTWK ports should be the ones used in your coin.conf.

the specific line in BCDHLP you need to edit is: (it could contain more coin names
Code:
if 'litecoin' in net.NAME or 'feathercoin' in net.NAME:

Change it to:
Code:
if 'litecoin' in net.NAME or 'feathercoin' in net.NAME or 'CoinName' in net.NAME:

Please note the coin name you put in here must also be what you use to call your coin in P2PNTWK.

This is found in P2PNTWK under "CoinName=math.Object("
Code:
PARENT=networks.nets['CoinName']

I hope that wasn't just a bunch of gibberish  ;D
I'll try do a more explained version later if you would like as I'll be heading off to work soon.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 08:02:20 AM
i am at work also now.   Will be back in like 5 hours. Maybe less. Give post more things i found when i get back


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 12:06:36 PM
i also found something about p2poolprefix. but i don't know how to chenge it to hex code the prefix is at

src\main.cpp  and it looks like this
 
Code:
pchMessageStart[0] = 0xfc;
Line 1993:         pchMessageStart[1] = 0xc1;
Line 1994:         pchMessageStart[2] = 0xb7;
Line 1995:         pchMessageStart[3] = 0xdc;

also this is "10519200" to half rewards. as i know

and may i ask something off topic that i hav problem and i can't find an obvius answer....I am trying to compile let's say worldcoin for example.. make -f makefile.unix USE_UPNP=- and i get this error on the code...

Code:
ain.cpp:17:53: fatal error: boost/random/uniform_int_distribution.hpp: No such file or directory
compilation terminated.
make: *** [obj/main.o] Error 1

if you know anything plz pm me. not to mess with the posts on this..  ;D


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Lebrick on June 01, 2013, 05:53:51 PM
i also found something about p2poolprefix. but i don't know how to chenge it to hex code the prefix is at

src\main.cpp  and it looks like this
 
Code:
pchMessageStart[0] = 0xfc;
Line 1993:         pchMessageStart[1] = 0xc1;
Line 1994:         pchMessageStart[2] = 0xb7;
Line 1995:         pchMessageStart[3] = 0xdc;

also this is "10519200" to half rewards. as i know

and may i ask something off topic that i hav problem and i can't find an obvius answer....I am trying to compile let's say worldcoin for example.. make -f makefile.unix USE_UPNP=- and i get this error on the code...

Code:
ain.cpp:17:53: fatal error: boost/random/uniform_int_distribution.hpp: No such file or directory
compilation terminated.
make: *** [obj/main.o] Error 1

if you know anything plz pm me. not to mess with the posts on this..  ;D

In regards to the p2poolprefix, are you talking about:

From BCDNTWK
Code:
P2P_PREFIX='fbc0b6db'.decode('hex'),
or
From P2PNTWK
Code:
PREFIX='b6c0601991aa19a2'.decode('hex'),

the BCDNTWK P2P_PREFIX can be found in the main.cpp at about line 2384 just search for "unsigned char pchMessageStart" it will contain some numbers and letters heres an example from MemeCoin:
Code:
unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb }; // MemeCoin: increase each by adding 2 to bitcoin's value.

you would take
Code:
0xfb, 0xc0, 0xb6, 0xdb
and change it to
Code:
fbc0b6db
this is for the BCDNTWK py.

For the other prefix from P2PNTWK, this is used (as i understand) to connect the p2pools with other p2pools, same with the identifier.
I am unsure about this setting, still looking around.

The prefix you found in main.cpp i am unsure what it is used for or if it is used at all.
Code:
pchMessageStart[0] = 0xfc;
Line 1993:         pchMessageStart[1] = 0xc1;
Line 1994:         pchMessageStart[2] = 0xb7;
Line 1995:         pchMessageStart[3] = 0xdc;

it does look similar to what i had or even could be the same thing.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 07:03:53 PM
let me check again...

any idea about the other mesage on the compile ?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 08:22:03 PM
ok this is my new code... i havent tested it yet... i am just sending you to take a look.... as i see at this pool https://github.com/hakabane/p2pool-altcoins/blob/master/p2pool/networks.py (it has many p2pools) he guy there it doen't changed many things... so i made the codes look like digitalcoi. and with no testnet on it ... (i think that it may couse some problems)

take a look at the code.

Code:
nets = dict(
    worldcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=11081,
        ADDRESS_VERSION=73,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinadress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 1*10000000 >> (height + 1)//1080000,
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=30, # s
        SYMBOL='WDC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'worldcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/worldcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//100000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,

also the other one

Code:
worldcoin=math.Object(
        PARENT=networks.nets['worldcoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=72, # blocks
        IDENTIFIER='f982abe394923510'.decode('hex'),
        PREFIX='8208c1a53ef649b0'.decode('hex'),
        P2P_PORT=25358,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=25359,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v : True,
    ),

check the files at ghub.. you will see not many changes just the basic one


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Lebrick on June 01, 2013, 08:32:45 PM
looks all good, don't forget to add worldcoin to helper.py in the bitcoind folder,

Also i forgot to add, in your P2PNTWK file change
Code:
PERSIST=True,
to
Code:
PERSIST=False,

And its gotta be capital "F",
This value tells the p2pool if it should mine solo or connect to other p2pools.

Fire it up and let us know,
In regards to your compile error i don't have a Linux box so can not help you there sorry  :(


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 01, 2013, 11:40:46 PM
i am waiting my bitcoind to sync..... i made a mistake last night... i was so tired and by accident i deleted bin folder looooooooool give me a day the codes are ready


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 03, 2013, 01:13:03 PM
ok making the pool right now... wish me luck guys lol

ok it doesn't open the screen command.. here is it.

Code:
screen -d -m -S wdcpool ~/p2pool/run_p2pool.py --net worldcoin -a Wd7Jrk6Yeaq8Ztn1umQuv2sM2mRzgyo3Ut -f 2 --give-author 0 --w 19327 --bitcoind-p2p-port 11081 --bitcoind-rpc-port 11082 walletusername walletpassword

anyideas ?

also when i pull the run_p2pool.py help i get these errors

Code:
Traceback (most recent call last):
  File "./run_p2pool.py", line 3, in <module>
    from p2pool import main
ImportError: No module named p2pool


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 04, 2013, 07:42:39 PM
ok i managed to get the pools working with worldcoin. these are the settings i used..

Code:
worldcoin=math.Object(
        PARENT=networks.nets['worldcoin'],
        SHARE_PERIOD=180, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=30, # blocks
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=20000,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=25359,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),
also

Code:
worldcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=11081,
        ADDRESS_VERSION=73,
        RPC_PORT=11082,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'worldcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 1*10000000 >> (height + 1)//1080000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=30, # s
        SYMBOL='WDC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'worldcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/worldcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.worldcoin'), 'worldcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//100000000 - 1, 2**256//1000 - 1),
DUMB_SCRYPT_DIFF=2**16,
    ),

but now i am getting this error when it starts up

Code:
2013-06-04 21:43:20.587175 >   File "run_p2pool.py", line 5, in <module>
2013-06-04 21:43:20.587319 >     main.run()
2013-06-04 21:43:20.587442 >   File "/root/p2pool-altcoins/p2pool/main.py", line 576, in run
2013-06-04 21:43:20.587566 >     reactor.run()
2013-06-04 21:43:20.587689 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
2013-06-04 21:43:20.587814 >     self.mainLoop()
2013-06-04 21:43:20.587937 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop
2013-06-04 21:43:20.588064 >     self.runUntilCurrent()
2013-06-04 21:43:20.588177 > --- <exception caught here> ---
2013-06-04 21:43:20.588326 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent
2013-06-04 21:43:20.588442 >     call.func(*call.args, **call.kw)
2013-06-04 21:43:20.588557 >   File "/root/p2pool-altcoins/p2pool/bitcoin/stratum.py", line 35, in _send_work
2013-06-04 21:43:20.588674 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2013-06-04 21:43:20.588792 >   File "/root/p2pool-altcoins/p2pool/bitcoin/worker_interface.py", line 122, in get_work
2013-06-04 21:43:20.588907 >     x, handler = self._inner.get_work(*args)
2013-06-04 21:43:20.589022 >   File "/root/p2pool-altcoins/p2pool/work.py", line 238, in get_work
2013-06-04 21:43:20.589136 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2013-06-04 21:43:20.589251 >   File "/root/p2pool-altcoins/p2pool/data.py", line 197, in generate_transaction
2013-06-04 21:43:20.589367 >     script='\x24' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(32).pack(last_txout_nonce),
2013-06-04 21:43:20.589523 >   File "/root/p2pool-altcoins/p2pool/data.py", line 221, in get_ref_hash
2013-06-04 21:43:20.589643 >     share_info=share_info,
2013-06-04 21:43:20.589756 >   File "/root/p2pool-altcoins/p2pool/util/pack.py", line 72, in pack
2013-06-04 21:43:20.589870 >     data = self._pack(obj)
2013-06-04 21:43:20.589985 >   File "/root/p2pool-altcoins/p2pool/util/pack.py", line 52, in _pack
2013-06-04 21:43:20.590099 >     f = self.write(None, obj)
2013-06-04 21:43:20.590213 >   File "/root/p2pool-altcoins/p2pool/util/pack.py", line 299, in write
2013-06-04 21:43:20.590327 >     file = type_.write(file, item[key])
2013-06-04 21:43:20.590441 >   File "/root/p2pool-altcoins/p2pool/util/pack.py", line 325, in write
2013-06-04 21:43:20.590555 >     raise ValueError('incorrect length item!')
2013-06-04 21:43:20.590669 > exceptions.ValueError: incorrect length item


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 06, 2013, 08:27:50 PM
ok guys for SPREAD this is the corect settings.


bitcoin SPREAD=3 block every 600 seconds           Baseline
litecoin SPREAD=12 block every 150 seconds         600/150=4       4x3=12
bbqcoin SPREAD=30 block every 60 seconds          600/60=10       10x3=30
digitalcoin SPREAD=90 block every 20 seconds       600/20=30       30x3=90
worldcoin SPREAD=120 block every 15 seconds      600/15=40       40x3=120

sa i found out in one post here and there.


anyone found anything for HYC?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: walf_man on June 07, 2013, 10:50:47 AM
very great!
nice!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 07, 2013, 03:47:33 PM
does anyone wanna help me making a p2pool for hypercoin ?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: WOPR on June 08, 2013, 11:27:28 AM
does anyone wanna help me making a p2pool for hypercoin ?

The main difference in HYC is a blank in 'hypercoin address':

p2pool/bitcoin/networks.py
Code:
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'hypercoin address' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),

Also must be change the P2P_PREFIX:
Code:
        P2P_PREFIX='fcd9b7dd'.decode('hex'),


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 08, 2013, 03:39:21 PM
ok how did you found this couse i was trying to find this for days.

also what about nSubsidy. at the code it should be like nSubsidy >>= (nHeight number.) but in this coin it has 25*coins and something under it. alll the rest are the sane. somehow


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: WOPR on June 08, 2013, 03:50:29 PM
ok how did you found this couse i was trying to find this for days.

also what about nSubsidy. at the code it should be like nSubsidy >>= (nHeight number.) but in this coin it has 25*coins and something under it. alll the rest are the sane. somehow

It seems that subsidy never halves (until reach max money), then:
Code:
        SUBSIDY_FUNC=lambda height: 25*10000000,

You can find the 'xcoinaddress' string in src/rpcdump.cpp, searching 'dumpprivkey <'



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: PSL on June 08, 2013, 04:05:31 PM
does anyone wanna help me making a p2pool for hypercoin ?

https://109.201.133.65/index.php?topic=222956.msg2391757#msg2391757


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 11, 2013, 03:02:45 PM
hi again guys.

i hav made a pool for WDC it's working perfecty for some days now. but still i hav a small problem. i get like 10% DOA and i am really pissed off by that.

this is the code i hav. i need to change anything couse i think i hav made a mistake somewhere

Code:
worldcoin=math.Object(
        PARENT=networks.nets['worldcoin'],
        SHARE_PERIOD=15,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=30,
        IDENTIFIER='e021a7b8c602421f'.decode('hex'),
        PREFIX='e280193ae6b8617b'.decode('hex'),
        P2P_PORT=5001,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19335,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-worldcoin',
        VERSION_CHECK=lambda v: True,
    ),


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on June 12, 2013, 08:07:35 AM
ok guys for SPREAD this is the corect settings.


bitcoin SPREAD=3 block every 600 seconds           Baseline
litecoin SPREAD=12 block every 150 seconds         600/150=4       4x3=12
bbqcoin SPREAD=30 block every 60 seconds          600/60=10       10x3=30
casinocoin SPREAD=60 block every 30 seconds      600/30=20        20x3=60
digitalcoin SPREAD=90 block every 20 seconds       600/20=30       30x3=90 (old spec)
digitalcoin SPREAD=45 block every 40 seconds       600/40=15       15x3=45  (new spec)
worldcoin SPREAD=120 block every 15 seconds      600/15=40       40x3=120 (old spec)
worldcoin SPREAD=60 block every 30 seconds       600/30=20        20x3=60  (new spec)

sa i found out in one post here and there.


anyone found anything for HYC?

I posted those settings from research but do not know if my assumptions are correct.

I use them for my pools and they seem to work correctly but it's hard to say what would happen if a bunch of other p2pools decided to connect. Brought up some other p2pools to simulate other pools connecting but without a lot of hash rate at the other nodes my results were promising but inconclusive.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 12, 2013, 03:04:26 PM
they are correct and working cartman... thx for that info it was great help for the pools :D



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 12, 2013, 06:51:47 PM
 Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!

the ports are correct. any ideas ?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on June 12, 2013, 07:05:15 PM
Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!

the ports are correct. any ideas ?

I imagine you are trying to do a pool for HyperCoin? The devs messed up on the ports being used. To make matters worse the original post for the announcement had the wrong ports as well. In that thread I pointed it out. They graciously gave me a donation :)

Look up the announcement thread for the port information. I forget off the top of my head but it is there. The default ports were something like 5 digits for one and 4 for the other.



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on June 12, 2013, 07:46:22 PM
For future reference, you can find the P2P_PORT in the coin's source code in the protocol.h file, it's the 2nd value after GetDefaultPort.

You can find RPC_PORT in the source code in the bitcoinrpc.cpp file, look for GetArg (-rpcport, xxxx), where xxxx is the port.

I'm talking about the values you would specify in the bnetworks.py file.





Title: Re: Finding p2pool networks.py values for new altcoins
Post by: whitedragon on June 13, 2013, 01:36:10 AM
For future reference, you can find the P2P_PORT in the coin's source code in the protocol.h file, it's the 2nd value after GetDefaultPort.

You can find RPC_PORT in the source code in the bitcoinrpc.cpp file, look for GetArg (-rpcport, xxxx), where xxxx is the port.

I'm talking about the values you would specify in the bnetworks.py file.





Just to confirm what I *think* I know....

These values can be specified in the *.conf file as well can't they?  (To match bnetwrks.py)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 13, 2013, 12:09:43 PM
no idea... i found the problem with that .... it wants that in linux .conf file

ipcallowip=127.0.0.1
not
rpcconnect=127.0.0.1

now i am getting a huge nubmer or errors that i can't find... i make everything like i do to most coin pools. that means:

i find the address for PUBLIC ADDRESS from base58.h
i find height or something like that from  nSubsidy >>= (nHeight / 8400000); from main.cpp
i change the port and rpc port at networks.py
i change the worker port and the other port that connect the pools.
i delete the IDENTIFY AND PREFIX i leave them like that (don't couse me any problems for solo pools)
Code:
IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),

i change the helper.py with or 'netowrkname' like this

Code:
if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'digital' in net.NAME or 'worldcoin' in net.NAME:

what else. and i run with python. (i create the screen first)

but then let's say for fastcoin i get like 2 pages errors .....

i also hav no idea what this is

Code:
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
SHARE_PERIOD=10, # seconds

and on the other networks.py this one and how i can translate it

Code:
P2P_PREFIX='f9beb4d9'.decode('hex'),


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: whitedragon on June 14, 2013, 03:00:12 AM
no idea... i found the problem with that .... it wants that in linux .conf file

ipcallowip=127.0.0.1
not
rpcconnect=127.0.0.1

now i am getting a huge nubmer or errors that i can't find... i make everything like i do to most coin pools. that means:

i find the address for PUBLIC ADDRESS from base58.h
i find height or something like that from  nSubsidy >>= (nHeight / 8400000); from main.cpp
i change the port and rpc port at networks.py
i change the worker port and the other port that connect the pools.
i delete the IDENTIFY AND PREFIX i leave them like that (don't couse me any problems for solo pools)
Code:
IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),

i change the helper.py with or 'netowrkname' like this

Code:
if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'digital' in net.NAME or 'worldcoin' in net.NAME:

what else. and i run with python. (i create the screen first)

but then let's say for fastcoin i get like 2 pages errors .....

i also hav no idea what this is

Code:
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
SHARE_PERIOD=10, # seconds

and on the other networks.py this one and how i can translate it

Code:
P2P_PREFIX='f9beb4d9'.decode('hex'),



The P2P_PREFIX was explained by Kyune here:



I think I may have figured this out.  I had been bumping into the same problem (stalling at the P2P connection) on some coins but not others.  I finally realized I was wrong in an initial assumption...the P2P_PREFIX setting in bitcoin/networks.py is in fact a coin-specific setting -- which is logical, as the other settings in that file are coin-specific as well.   In fact, it looks like it is basically the "magic value" or "magic number" referred to in https://en.bitcoin.it/wiki/Protocol_specification, and after poking around in the code I think you can find it in main.cpp at pchMessageStart[4]=...  Using this specific value as the P2P_PREFIX fixed the problem for me.

So, for example, I haven't ever installed Dragoncoin myself, but looking quickly at the relevant line in main.cpp:

Code:
unsigned char pchMessageStart[4] = { 0xfc, 0xd9, 0xb7, 0xdd };

Thus, for Dragoncoin, try setting

Code:
P2P_PREFIX='fcd9b7dd'.decode('hex'),

and let us know if that gets you past stalling at the P2P connection.

Hope this is helpful.


I can't really help with the chain length as it is confusing to me too.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Kyune on June 14, 2013, 04:24:09 AM
For future reference, you can find the P2P_PORT in the coin's source code in the protocol.h file, it's the 2nd value after GetDefaultPort.

You can find RPC_PORT in the source code in the bitcoinrpc.cpp file, look for GetArg (-rpcport, xxxx), where xxxx is the port.

I'm talking about the values you would specify in the bnetworks.py file.





Just to confirm what I *think* I know....

These values can be specified in the *.conf file as well can't they?  (To match bnetwrks.py)
That is my understanding, yes.  The above just lets you find the defaults if the coin dev doesn't accurately document the default ports, which does happen.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on June 14, 2013, 05:02:17 PM
hi again ... ok i am trying to setup a fastcoin pool ....  here are my settings..


Code:
fastcoin=math.Object(
        PARENT=networks.nets['fastcoin'],
        SHARE_PERIOD=9,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=150,
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=50010,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19328,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

Code:
fastcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9526,
        ADDRESS_VERSION=96,
        RPC_PORT=9527,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'fastcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 32*100000000 >> (height + 1)//2592000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150,
        SYMBOL='FSC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Fastcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/fastcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.fastcoin'), 'fastcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

but i always get this error when i try to run on python

Code:
2013-06-14 19:12:36.783384 > Traceback (most recent call last):
2013-06-14 19:12:36.783529 >   File "run_p2pool.py", line 5, in <module>
2013-06-14 19:12:36.783662 >     main.run()
2013-06-14 19:12:36.783774 >   File "/root/p2pool-fsc/p2pool/main.py", line 576, in run
2013-06-14 19:12:36.783888 >     reactor.run()
2013-06-14 19:12:36.784061 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
2013-06-14 19:12:36.784176 >     self.mainLoop()
2013-06-14 19:12:36.784290 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop
2013-06-14 19:12:36.784400 >     self.runUntilCurrent()
2013-06-14 19:12:36.784511 > --- <exception caught here> ---
2013-06-14 19:12:36.784659 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent
2013-06-14 19:12:36.784777 >     call.func(*call.args, **call.kw)
2013-06-14 19:12:36.784892 >   File "/root/p2pool-fsc/p2pool/bitcoin/stratum.py", line 35, in _send_work
2013-06-14 19:12:36.785004 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2013-06-14 19:12:36.785113 >   File "/root/p2pool-fsc/p2pool/bitcoin/worker_interface.py", line 122, in get_work
2013-06-14 19:12:36.785223 >     x, handler = self._inner.get_work(*args)
2013-06-14 19:12:36.785333 >   File "/root/p2pool-fsc/p2pool/work.py", line 238, in get_work
2013-06-14 19:12:36.785443 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2013-06-14 19:12:36.785549 >   File "/root/p2pool-fsc/p2pool/data.py", line 197, in generate_transaction
2013-06-14 19:12:36.785660 >     script='\x24' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(32).pack(last_txout_nonce),
2013-06-14 19:12:36.785772 >   File "/root/p2pool-fsc/p2pool/data.py", line 221, in get_ref_hash
2013-06-14 19:12:36.785881 >     share_info=share_info,
2013-06-14 19:12:36.785977 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 72, in pack
2013-06-14 19:12:36.786191 >     data = self._pack(obj)
2013-06-14 19:12:36.787330 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 52, in _pack
2013-06-14 19:12:36.787494 >     f = self.write(None, obj)
2013-06-14 19:12:36.787626 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 299, in write
2013-06-14 19:12:36.787757 >     file = type_.write(file, item[key])
2013-06-14 19:12:36.787869 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 325, in write
2013-06-14 19:12:36.787976 >     raise ValueError('incorrect length item!')
2013-06-14 19:12:36.788087 > exceptions.ValueError: incorrect length item!

i hav setted up the pass and username. on python running code. but i always get this one

any ideas ?




Title: Re: Finding p2pool networks.py values for new altcoins
Post by: sheinsha on July 15, 2013, 06:44:56 AM
hi again ... ok i am trying to setup a fastcoin pool ....  here are my settings..
Code:
fastcoin=math.Object(
        PARENT=networks.nets['fastcoin'],
        SHARE_PERIOD=9,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=150,
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=50010,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19328,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

Code:
fastcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9526,
        ADDRESS_VERSION=96,
        RPC_PORT=9527,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'fastcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 32*100000000 >> (height + 1)//2592000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150,
        SYMBOL='FSC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Fastcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/fastcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.fastcoin'), 'fastcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

but i always get this error when i try to run on python

Code:
2013-06-14 19:12:36.783384 > Traceback (most recent call last):
2013-06-14 19:12:36.783529 >   File "run_p2pool.py", line 5, in <module>
2013-06-14 19:12:36.783662 >     main.run()
2013-06-14 19:12:36.783774 >   File "/root/p2pool-fsc/p2pool/main.py", line 576, in run
2013-06-14 19:12:36.783888 >     reactor.run()
2013-06-14 19:12:36.784061 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
2013-06-14 19:12:36.784176 >     self.mainLoop()
2013-06-14 19:12:36.784290 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop
2013-06-14 19:12:36.784400 >     self.runUntilCurrent()
2013-06-14 19:12:36.784511 > --- <exception caught here> ---
2013-06-14 19:12:36.784659 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent
2013-06-14 19:12:36.784777 >     call.func(*call.args, **call.kw)
2013-06-14 19:12:36.784892 >   File "/root/p2pool-fsc/p2pool/bitcoin/stratum.py", line 35, in _send_work
2013-06-14 19:12:36.785004 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2013-06-14 19:12:36.785113 >   File "/root/p2pool-fsc/p2pool/bitcoin/worker_interface.py", line 122, in get_work
2013-06-14 19:12:36.785223 >     x, handler = self._inner.get_work(*args)
2013-06-14 19:12:36.785333 >   File "/root/p2pool-fsc/p2pool/work.py", line 238, in get_work
2013-06-14 19:12:36.785443 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2013-06-14 19:12:36.785549 >   File "/root/p2pool-fsc/p2pool/data.py", line 197, in generate_transaction
2013-06-14 19:12:36.785660 >     script='\x24' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(32).pack(last_txout_nonce),
2013-06-14 19:12:36.785772 >   File "/root/p2pool-fsc/p2pool/data.py", line 221, in get_ref_hash
2013-06-14 19:12:36.785881 >     share_info=share_info,
2013-06-14 19:12:36.785977 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 72, in pack
2013-06-14 19:12:36.786191 >     data = self._pack(obj)
2013-06-14 19:12:36.787330 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 52, in _pack
2013-06-14 19:12:36.787494 >     f = self.write(None, obj)
2013-06-14 19:12:36.787626 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 299, in write
2013-06-14 19:12:36.787757 >     file = type_.write(file, item[key])
2013-06-14 19:12:36.787869 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 325, in write
2013-06-14 19:12:36.787976 >     raise ValueError('incorrect length item!')
2013-06-14 19:12:36.788087 > exceptions.ValueError: incorrect length item!

i hav setted up the pass and username. on python running code. but i always get this one

any ideas ?

Hi napoleon, have you got it to work? Im having the same errors...
Thanks!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: markm on July 15, 2013, 07:04:35 AM
A lot of coins lately do not work out the block reward by simply dividing an original reward by a number of blocks, or like in bitcoin halve if every four years, so i expect for example the coins that use hashes of previous blocks to "randomly' decide the block reward (superblocks, lucky blocks, golden blocks) the python function for determining the block reward would need to do that exact same pseudorandom number calculations to match correctly the rewards the coin actually gives out?

Has that led to the coins that have lucky blocks being less likely to have p2pool pools due to p2pool coders maybe not wanting to correctly figure out those "random" rewards in python?

or maybe even has it led to p2pool pools for such coins tending to not figure out rewards correctly?

-MarkM-


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: PSL on July 15, 2013, 09:59:40 AM
It doesn't address your errors but I noticed that you use for Fastcoin symbol FSC; it should be FST from my point of view.

https://bitcointalk.org/index.php?topic=218852.0

SYMBOL='FST',

Block period is 12s, isn't it?

BLOCK_PERIOD=12,

Your subsidy is not correct, it is not critical...

SUBSIDY_FUNC=lambda height: 32*100000000 >> (height)//2592000,

And this is not correct and could be troublemaker:

IDENTIFIER=''.decode('hex'),
PREFIX=''.decode('hex'),


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: sheinsha on July 16, 2013, 06:40:17 AM
A lot of coins lately do not work out the block reward by simply dividing an original reward by a number of blocks, or like in bitcoin halve if every four years, so i expect for example the coins that use hashes of previous blocks to "randomly' decide the block reward (superblocks, lucky blocks, golden blocks) the python function for determining the block reward would need to do that exact same pseudorandom number calculations to match correctly the rewards the coin actually gives out?

Has that led to the coins that have lucky blocks being less likely to have p2pool pools due to p2pool coders maybe not wanting to correctly figure out those "random" rewards in python?

or maybe even has it led to p2pool pools for such coins tending to not figure out rewards correctly?

-MarkM-

Exactly, i think coins with random blocks must have their SUBSIDY_FUNC with same algorithm that the coind uses. But i cannot calculate the random part with p2pool, because it wont be the same (obviously) as the value calculated by the function in coind. So i can set it to always the normal block subsidy, but thats not correct.
Anyone know how luckycoin p2pool addresses this?? Ive seen the code, and lambda function states a fixed amount..


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: sheinsha on July 17, 2013, 04:03:22 PM
hi again ... ok i am trying to setup a fastcoin pool ....  here are my settings..


Code:
fastcoin=math.Object(
        PARENT=networks.nets['fastcoin'],
        SHARE_PERIOD=9,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=150,
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=50010,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19328,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

Code:
fastcoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9526,
        ADDRESS_VERSION=96,
        RPC_PORT=9527,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'fastcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 32*100000000 >> (height + 1)//2592000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150,
        SYMBOL='FSC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Fastcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/fastcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.fastcoin'), 'fastcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

but i always get this error when i try to run on python

Code:
2013-06-14 19:12:36.783384 > Traceback (most recent call last):
2013-06-14 19:12:36.783529 >   File "run_p2pool.py", line 5, in <module>
2013-06-14 19:12:36.783662 >     main.run()
2013-06-14 19:12:36.783774 >   File "/root/p2pool-fsc/p2pool/main.py", line 576, in run
2013-06-14 19:12:36.783888 >     reactor.run()
2013-06-14 19:12:36.784061 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
2013-06-14 19:12:36.784176 >     self.mainLoop()
2013-06-14 19:12:36.784290 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop
2013-06-14 19:12:36.784400 >     self.runUntilCurrent()
2013-06-14 19:12:36.784511 > --- <exception caught here> ---
2013-06-14 19:12:36.784659 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent
2013-06-14 19:12:36.784777 >     call.func(*call.args, **call.kw)
2013-06-14 19:12:36.784892 >   File "/root/p2pool-fsc/p2pool/bitcoin/stratum.py", line 35, in _send_work
2013-06-14 19:12:36.785004 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2013-06-14 19:12:36.785113 >   File "/root/p2pool-fsc/p2pool/bitcoin/worker_interface.py", line 122, in get_work
2013-06-14 19:12:36.785223 >     x, handler = self._inner.get_work(*args)
2013-06-14 19:12:36.785333 >   File "/root/p2pool-fsc/p2pool/work.py", line 238, in get_work
2013-06-14 19:12:36.785443 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2013-06-14 19:12:36.785549 >   File "/root/p2pool-fsc/p2pool/data.py", line 197, in generate_transaction
2013-06-14 19:12:36.785660 >     script='\x24' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(32).pack(last_txout_nonce),
2013-06-14 19:12:36.785772 >   File "/root/p2pool-fsc/p2pool/data.py", line 221, in get_ref_hash
2013-06-14 19:12:36.785881 >     share_info=share_info,
2013-06-14 19:12:36.785977 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 72, in pack
2013-06-14 19:12:36.786191 >     data = self._pack(obj)
2013-06-14 19:12:36.787330 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 52, in _pack
2013-06-14 19:12:36.787494 >     f = self.write(None, obj)
2013-06-14 19:12:36.787626 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 299, in write
2013-06-14 19:12:36.787757 >     file = type_.write(file, item[key])
2013-06-14 19:12:36.787869 >   File "/root/p2pool-fsc/p2pool/util/pack.py", line 325, in write
2013-06-14 19:12:36.787976 >     raise ValueError('incorrect length item!')
2013-06-14 19:12:36.788087 > exceptions.ValueError: incorrect length item!

i hav setted up the pass and username. on python running code. but i always get this one

any ideas ?



It doesn't address your errors but I noticed that you use for Fastcoin symbol FSC; it should be FST from my point of view.

https://bitcointalk.org/index.php?topic=218852.0

SYMBOL='FST',

Block period is 12s, isn't it?

BLOCK_PERIOD=12,

Your subsidy is not correct, it is not critical...

SUBSIDY_FUNC=lambda height: 32*100000000 >> (height)//2592000,

And this is not correct and could be troublemaker:

IDENTIFIER=''.decode('hex'),
PREFIX=''.decode('hex'),


I was able to track down that error, and  made some progress setting the identifiers to something other than '', something like:
        IDENTIFIER='adc586a5dc685cad'.decode('hex'),
        PREFIX='ef39ae959feaf397'.decode('hex'),
These are random chars.. but now the error is gone, and the node seems to work fine. I dont know if this is the same issue you have and im pretty sure this identifiers will make this p2pool node unreachable to other nodes.. Im solo mining with this for my farm, so it wont bother to me. On another coin not fastcoin though..

Hope this helps !


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on July 17, 2013, 09:59:23 PM
I forked P2Pool release 13.1 and added Digitalcoin, Worldcoin, and Craftcoin here:

https://github.com/CartmanSPC/p2pool


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on August 21, 2013, 09:58:05 AM
thx Cartman - i use it for WDC and DGC and it works very well!  ;)

i have trouble with CosmosCoin setup for p2pool:

p2pool/networks.py
Code:
    CosmosCoin=math.Object(
        PARENT=networks.nets['CosmosCoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=24*60*60//30, # shares
        REAL_CHAIN_LENGTH=24*60*60//30, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='e037d5b8c6923510'.decode('hex'),
        PREFIX='7208c1a53ef649b0'.decode('hex'),
        P2P_PORT=19995,#p2pool p2p port
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19996,#p2pool worker port
        BOOTSTRAP_ADDRS='198.211.17.160 173.254.207.107 118.250.247.107'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: v >= 60004,
    ),

p2pool/bitcoin/networks.py
Code:
def get_subsidy(nCap, nMaxSubsidy, bnTarget):		
#nSubsidy=3.5#add by ComosCoin-DEV
    return int(3.5 * 1000000)



nets = dict(
    CosmosCoin=math.Object(
        P2P_PREFIX='e4e8e9e5'.decode('hex'),
        P2P_PORT=19990,#add by ComosCoin-DEV
        ADDRESS_VERSION=27,#add by ComosCoin-DEV
        RPC_PORT=19991,#add by ComosCoin-DEV
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'CosmosCoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),
        BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s 1 minute
        SYMBOL='CMC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'CosmosCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/CosmosCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.CosmosCoin'), 'CosmosCoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://cosmoscoin.com/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://cosmoscoin.com/address/',
        SANE_TARGET_RANGE=(2**256//2**20//1000 - 1, 2**256//2**20 - 1),
    ),

the

BLOCK_EXPLORER_URL_PREFIX='http://cosmoscoin.com/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://cosmoscoin.com/address/',

this Block Explorer does not exist anymore and the new one does not provide Addresses and Blocks are in another format.
my p2pool runs on http://www.guugll.eu:10327/static/ but no payout - i am not p2pool pro/guru but i have the feeling none of the mined shares/blocks are submitted to the block chain - how could they and thus i get no payout - otherewise it would work like it did for Ahmed when the original Block Explorer was in place...

Please could any p2pool pro/guru correct me if i am wrong or help in case i am right... (we need the Block Explorer back)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: minerapia on August 21, 2013, 10:09:07 AM
p2pool does not need a blockchain explorer for anything, its just used to create links to the p2pools webpage.
Cosmoscoin seems to have some sort of modified scrypt algo, so you need to customize the powhash fuction (make module for it) and prolly alter tx creation procedures, so its not so easy task (as modifiying network.py(s))


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on August 21, 2013, 10:49:42 AM
thx minerapia

this clarifies also the other errors i get and that was something related to tx message data not beeing handled well.

i am not able to do this mod so i will wait and learn...


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on August 21, 2013, 06:05:10 PM
I forked P2Pool release 13.1 and added Digitalcoin, Worldcoin, and Craftcoin here:

https://github.com/CartmanSPC/p2pool


Updated to 13.3 and added Casinocoin:

https://github.com/CartmanSPC/p2pool


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: napoleon2121 on August 22, 2013, 10:28:16 PM
i hav lost my deticated for a month now couse of the costs. i will be back on the post in a few days :D i will add some more coins to github when i come :D also ty for the corrections on my scrypts :D


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on September 05, 2013, 09:40:03 AM
trying again PoS/PoW coin and again loosing...

using Baltazars p2pool: https://github.com/CryptoManiac/p2pool

the result looks like this: http://www.guugll.eu:15327/static/

if i mine with normal ORB address it does not look like its mining for me.
if i mine with hashed address then it look like its mining for me but i do not get anything(no payout).
after some time i get into error - to many open files on server and need to kill python(on server ubuntu 12.04).
i still not made any mods to the litecoin_scrypt but i tryed to make the newtork files again... (maybe this is the issue like in CMC case...above)

Code:
Orbitcoin=math.Object(
        PARENT=networks.nets['Orbitcoin'],
        SHARE_PERIOD=30,                                          # seconds - do i need to chenge it to 3 sec. according to the coin specs?
        CHAIN_LENGTH=24*60*60//30,                          # shares - i did not changed this
        REAL_CHAIN_LENGTH=24*60*60//30,                 # shares - i did not changed this
        TARGET_LOOKBEHIND=200,                              # shares - i did not changed this
        SPREAD=3,                                                   # blocks - i did not changed this
        IDENTIFIER='e037d5b8c6923510'.decode('hex'),  #i did not changed this
        PREFIX='7208c1a53ef649b0'.decode('hex'),        #i did not changed this
        P2P_PORT=25298,                                         #p2pool p2p port
        MIN_TARGET=0,                                           #i did not changed this
        MAX_TARGET=2**256//2**20 - 1,                 #i did not changed this
        PERSIST=False,                                          #add by guugll (solo node?)
        WORKER_PORT=25299,                              #add by guugll (some free port)
        BOOTSTRAP_ADDRS='109.157.228.106 69.85.86.195 184.155.117.207 '.split(' '), #add by guugll
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,           #add by guugll (no version check)
    ),

and

Code:
def get_subsidy(nCap, nMaxSubsidy, bnTarget):		
#nSubsidy=3.5
    return int(0.25 * 31000000)                                 #add by guugll -is this the block reward * max coins ?

nets = dict(
    Orbitcoin=math.Object(
        P2P_PREFIX='e4efdbfd'.decode('hex'),                        #add by guugll - its described in this thread
        P2P_PORT=15298,                                                 #add by guugll - coin port
        ADDRESS_VERSION=115,                                        #add by guugll - its described in this thread
        RPC_PORT=15299,                                                 #add by guugll - coin port
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'Orbitcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),                                                                 #i did not changed this
BLOCKHASH_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),    #i did not changed this
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),              #i did not changed this
        BLOCK_PERIOD=30,                                                                                                                       # s - i did not changed this
        SYMBOL='ORB',                                                                                                                             #add by guugll - coin symbol
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Orbitcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Orbitcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.Orbitcoin'), 'Orbitcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://orb.blockexplorer.com/block/',                                                    #add by guugll - dummy
        ADDRESS_EXPLORER_URL_PREFIX='http://orb.blockexplorer.com/address/',                                            #add by guugll - dummy
        SANE_TARGET_RANGE=(2**256//2**20//1000 - 1, 2**256//2**20 - 1),                                              #i did not changed this
    ),

i used all info from this thread but still missing something, apart the posibility that the issues is in the litecoin_scrypt.
i am not able to compile new litecoin_scrypt :-(


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on September 05, 2013, 08:01:01 PM
received some hint on other forum

SPREAD=60  # coin spec.
IDENTIFIER='4f72626974636f696e'.decode('hex'),   # this is new p2pool modification so i can set this - i just hope i made the right value
PREFIX='4f52424954'.decode('hex'),                         # this is new p2pool modification so i can set this - i just hope i made the right value
i had this idea in one of my test but i had the syntax wrong - thx to shakezula
SUBSIDY_FUNC=lambda height: .25*31000000 >> (height + 1)//1051200, 


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on September 05, 2013, 08:33:40 PM
ok Subsidy still wrong

so we have now this:
 
File "/p2pool/p2pool/work.py", line 248, in get_work
2013-09-05 22:29:11.796862 >     subsidy = self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['bits'].target)
2013-09-05 22:29:11.798394 >   File "/p2pool/p2pool/bitcoin/networks.py", line 84, in <lambda>
2013-09-05 22:29:11.799553 >     SUBSIDY_FUNC=lambda height: .25*31000000 >> (height + 1)//1051200,
2013-09-05 22:29:11.800727 > exceptions.TypeError: unsupported operand type(s) for >>: 'float' and 'long'
 
i am looking into this - had the same error before. but not sure how to fix it.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on September 05, 2013, 09:26:10 PM
so this is not working SUBSIDY_FUNC=lambda height: .25*31000000 >> (height + 1)//1051200,
reward is 0.25
total should be 31000000
the nSubsidy from coin source is 1051200

and we need to make it work with this:

def get_subsidy(nCap, nMaxSubsidy, bnTarget):
    bnLowerBound = 0.01
    bnUpperBound = bnSubsidyLimit = nMaxSubsidy
    bnTargetLimit = 0x00000fffff000000000000000000000000000000000000000000000000000000

    while bnLowerBound + 0.01 <= bnUpperBound:
        bnMidValue = (bnLowerBound + bnUpperBound) / 2
        if pow(bnMidValue, nCap) * bnTargetLimit > pow(bnSubsidyLimit, nCap) * bnTarget:
            bnUpperBound = bnMidValue
        else:
            bnLowerBound = bnMidValue

    nSubsidy = round(bnMidValue, 2)

    if nSubsidy > bnMidValue:
        nSubsidy = nSubsidy - 0.01

    return int(nSubsidy * 1000000)

using this:

SUBSIDY_FUNC=lambda target: get_subsidy(6, 100, target),

or i need a sleep?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: minerapia on September 10, 2013, 10:17:21 PM
SUBSIDY_FUNC=lambda height: 0.25*1000000 >> (height + 1)//1051200,
                                  so its  'block reward' * 'satoshies' >> (height + 1)//'height where block halves'.
                                                  

you only need get_subsudy func is theres some special way how the blocks rewards is calculated.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Meccup on October 13, 2013, 06:50:24 AM
Does anyone find correct settings for FastCoin?

Share please  ;)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Northwave on October 30, 2013, 05:33:01 PM
Is someone interested in making a p2pool for grandcoin ?
I dont want to mine solo all time. p2pool.org isn't working, other pools are crap :/

I tried to make my own p2pool but my linux skills seems to be to low ;)

regards
Northwave


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 01, 2013, 09:51:27 PM
Hey guys, extremely useful thread here, got p2pool-altcoins up and running only by reading it here, thanks!

I am facing one issue tho, the pool keep disconnecting from the wallet, from time to time it takes a good 3 minutes disconnected. Is it due to the cheap *** vps I am using or this is the simptom of something else?

This is what its spits on the terminal:

Code:
%) Current payout: 0.0000 NET
2013-11-01 21:50:22.944636  Pool: 4258kH/s Stale rate: 31.8% Expected time to block: 6.6 minutes
2013-11-01 21:50:23.473178 > Error getting work from bitcoind:
2013-11-01 21:50:23.473491 > Traceback (most recent call last):
2013-11-01 21:50:23.473651 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
2013-11-01 21:50:23.473805 >     current.result = callback(current.result, *args, **kw)
2013-11-01 21:50:23.473957 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
2013-11-01 21:50:23.474107 >     _inlineCallbacks(r, g, deferred)
2013-11-01 21:50:23.474289 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
2013-11-01 21:50:23.474463 >     result = result.throwExceptionIntoGenerator(g)
2013-11-01 21:50:23.474625 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
2013-11-01 21:50:23.474774 >     return g.throw(self.type, self.value, self.tb)
2013-11-01 21:50:23.475016 > --- <exception caught here> ---
2013-11-01 21:50:23.475138 >   File "/home/netcoin/p2pool-altcoins/p2pool/util/deferral.py", line 41, in f
2013-11-01 21:50:23.475252 >     result = yield func(*args, **kwargs)
2013-11-01 21:50:23.475364 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2013-11-01 21:50:23.475506 >     result = g.send(result)
2013-11-01 21:50:23.475619 >   File "/home/netcoin/p2pool-altcoins/p2pool/bitcoin/helper.py", line 49, in getwork
2013-11-01 21:50:23.475733 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2013-11-01 21:50:23.475856 >   File "/home/netcoin/p2pool-altcoins/p2pool/util/pack.py", line 63, in unpack
2013-11-01 21:50:23.476021 >     obj = self._unpack(data)
2013-11-01 21:50:23.476136 >   File "/home/netcoin/p2pool-altcoins/p2pool/util/pack.py", line 47, in _unpack
2013-11-01 21:50:23.476250 >     raise LateEnd()
2013-11-01 21:50:23.476361 > p2pool.util.pack.LateEnd:
2013-11-01 21:50:24.895071 1 tails:

Thank you very much!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 03, 2013, 04:24:21 AM
Ok new error, looks like there's something wrong in the coin settings, its Netcoin (cryptomunity.pw).

Code:
2013-11-03 04:15:08.193449 > Error in DeferredResource handler:
2013-11-03 04:15:08.193679 > Traceback (most recent call last):
2013-11-03 04:15:08.193804 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/util/deferred_resource.py", line 24, in render
2013-11-03 04:15:08.193925 >     defer.maybeDeferred(resource.Resource.render, self, request).addCallbacks(finish, finish_error)
2013-11-03 04:15:08.194044 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 134, in maybeDeferred
2013-11-03 04:15:08.194160 >     result = f(*args, **kw)
2013-11-03 04:15:08.194274 >   File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
2013-11-03 04:15:08.194388 >     return m(request)
2013-11-03 04:15:08.194501 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
2013-11-03 04:15:08.194617 >     return _inlineCallbacks(None, gen, Deferred())
2013-11-03 04:15:08.194730 > --- <exception caught here> ---
2013-11-03 04:15:08.194816 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2013-11-03 04:15:08.194900 >     result = g.send(result)
2013-11-03 04:15:08.194980 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/web.py", line 196, in render_GET
2013-11-03 04:15:08.195064 >     res = yield self.func(*self.args)
2013-11-03 04:15:08.195145 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/web.py", line 329, in <lambda>
2013-11-03 04:15:08.195259 >     new_root.putChild('best_share_hash', WebInterface(lambda: '%064x' % node.best_share_var.value))
2013-11-03 04:15:08.195375 > exceptions.TypeError: %x format: a number is required, not NoneType

My configs looks like this:
networks.py:

Code:
netcoin=math.Object(
        PARENT=networks.nets['netcoin'],
        SHARE_PERIOD=60, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=100, # shares
        SPREAD=30, # blocks
        IDENTIFIER='aeaed5b8c6923410'.decode('hex'),
        PREFIX='aeaec1a53ef629b0'.decode('hex'),
        P2P_PORT=11315,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**32 - 1,
        PERSIST=False,
        WORKER_PORT=5432,
        BOOTSTRAP_ADDRS='forre.st vps.forre.st'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

bitcoin/networks.py:

Code:
netcoin=math.Object(
        P2P_PREFIX='fdb6a5db'.decode('hex'),
        P2P_PORT=11310,
        ADDRESS_VERSION=112,
        RPC_PORT=11311,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'netcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 1024*320636160 >> (height + 1)//129600,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s
        SYMBOL='NET',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'NetCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/NetCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.netcoin'), 'netcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://frawgie.hopto.org/search?q=',
        ADDRESS_EXPLORER_URL_PREFIX='http://frawgie.hopto.org/search?q=',
SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
    ),

And the line in helper.py:

Code:
if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'net' in net.NAME:

Everything looks good but when I test mining on it I don't receive the block rewards, I get some few coins into the default address but nothing on the miners address, seems like the pool is not getting proper work from the wallet, or not what it expected.

Also the web interface trows this error every time I try to reload (F5) the page:

Code:
2013-11-03 04:20:27.208840 > Error in DeferredResource handler:
2013-11-03 04:20:27.209111 > Traceback (most recent call last):
2013-11-03 04:20:27.209257 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/util/deferred_resource.py", line 24, in render
2013-11-03 04:20:27.209402 >     defer.maybeDeferred(resource.Resource.render, self, request).addCallbacks(finish, finish_error)
2013-11-03 04:20:27.209545 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 134, in maybeDeferred
2013-11-03 04:20:27.209686 >     result = f(*args, **kw)
2013-11-03 04:20:27.209822 >   File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
2013-11-03 04:20:27.209960 >     return m(request)
2013-11-03 04:20:27.210096 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
2013-11-03 04:20:27.210235 >     return _inlineCallbacks(None, gen, Deferred())
2013-11-03 04:20:27.210452 > --- <exception caught here> ---
2013-11-03 04:20:27.210547 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2013-11-03 04:20:27.210636 >     result = g.send(result)
2013-11-03 04:20:27.210719 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/web.py", line 196, in render_GET
2013-11-03 04:20:27.210804 >     res = yield self.func(*self.args)
2013-11-03 04:20:27.210888 >   File "/home/netcoin/newpool/p2pool-altcoins/p2pool/web.py", line 329, in <lambda>
2013-11-03 04:20:27.210974 >     new_root.putChild('best_share_hash', WebInterface(lambda: '%064x' % node.best_share_var.value))
2013-11-03 04:20:27.211058 > exceptions.TypeError: %x format: a number is required, not NoneType

This also is very odd:

Code:
2013-11-03 04:24:52.773275 New work for worker! Difficulty: 0.000096 Share difficulty: 1.000000 Total block value: 1024.000000 NET including 0 transactions

Could it be something with the block height or block calculation on the wallet?
Thanks!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on November 03, 2013, 07:03:40 AM
what version and source of p2pool you use?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 03, 2013, 04:53:06 PM
what version and source of p2pool you use?

Sorry forgot to mention its https://github.com/narken/p2pool-altcoins

Latest available ;)

Thanks!!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on November 03, 2013, 06:07:56 PM
you probably need another source for PoW and PoS coin.
better look for NVC, BTB p2pool source


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 03, 2013, 08:56:46 PM
you probably need another source for PoW and PoS coin.
better look for NVC, BTB p2pool source

Hey man I think you got confused with netcoin.io, that's not it. The netcoin.pw I am talking about is this one https://cryptocointalk.com/topic/1132-netcoin-net-launched-today/ its scrypt based on litecoin ;)

It is confusing I know.

Thanks!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on November 04, 2013, 08:59:16 PM
ok 2 times Netcoin - sorry i was not aware.
then should work with that source but how you wanna payout the superblocks?

- 1024 coins per block, and a random super block each hour that has 8X the normal payout (8096 coins)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 05, 2013, 12:26:16 PM
ok 2 times Netcoin - sorry i was not aware.
then should work with that source but how you wanna payout the superblocks?

- 1024 coins per block, and a random super block each hour that has 8X the normal payout (8096 coins)

Do you think this superblock is whats breaking the web interface and trowing the errors? Honestly I have no idea how to deal with it, I thought the pool would just split whatever the miners find and keep going. I personally don't like this superblock thing and if it was up to me it would be gone by now...thanks for helping man!!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: guugll on November 06, 2013, 06:11:58 PM
i tryed to make just PoS+PoW p2pool modification from NVC/BTB source and i was not successfull - but i did not tryed yet the last advice from minerapia. (my test env. is down now and i do not have much time)
the p2pool code modifications for PoS are written in this thread but in case of any special stuff in coin you need to modify the p2pool code.
for NVC the dev. of the coin modified the coin to be able to run with p2pool and BTB is very similar coin to NVC

so you need basically very good python skills and good contact with the coin dev. in order to be able to understand the special features and python skill to make it work with p2pool.
and in case of "random" superblocks i do not see any way how to work with the 8times higher value for that coin - you need to ask the dev how you would find out that you are mining or have mined the superblock and in that case use different payout method for the miners and then again go on standard.

well maybe try first some normal PoS coin p2pool modification and then build on that knowledge - that will be my way after i will have more time... but still i will test the last advice from minerapia because i spent a lot of time on that and i am curious if it will work.

good luck man - i like the p2pool idea because i feel all that coins who are having p2pool are the most successfull coins. But only one dev. made coin and p2pool source modification at the beginning - no one else is doing it beucause they waste time on special features of the coin and then there is no power to make the p2pool working with it.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: triggermage on November 06, 2013, 08:46:30 PM
Thanks man I wish you good lucky too!

I agree with you, non standard code in the coin code only makes things harder, I will keep trying till I get the pool up!! Thanks again!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: K1773R on November 06, 2013, 08:49:25 PM
i tryed to make just PoS+PoW p2pool modification from NVC/BTB source and i was not successfull - but i did not tryed yet the last advice from minerapia. (my test env. is down now and i do not have much time)
the p2pool code modifications for PoS are written in this thread but in case of any special stuff in coin you need to modify the p2pool code.
for NVC the dev. of the coin modified the coin to be able to run with p2pool and BTB is very similar coin to NVC

so you need basically very good python skills and good contact with the coin dev. in order to be able to understand the special features and python skill to make it work with p2pool.
and in case of "random" superblocks i do not see any way how to work with the 8times higher value for that coin - you need to ask the dev how you would find out that you are mining or have mined the superblock and in that case use different payout method for the miners and then again go on standard.

well maybe try first some normal PoS coin p2pool modification and then build on that knowledge - that will be my way after i will have more time... but still i will test the last advice from minerapia because i spent a lot of time on that and i am curious if it will work.

good luck man - i like the p2pool idea because i feel all that coins who are having p2pool are the most successfull coins. But only one dev. made coin and p2pool source modification at the beginning - no one else is doing it beucause they waste time on special features of the coin and then there is no power to make the p2pool working with it.

if "randomly" superblocks would be possible (which retard introduced this? sheesh...), you could abuse this system to only create superblocks lol


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: yahma on December 24, 2013, 06:18:25 AM
There seems to be some confusion about the values for networks.py, so lets see if we can sort things out and provide a bit of clarification:

SHARE_PERIOD: How often should P2Pool generate a new share (rule of thumb: 1/5 - 1/10 of the block period)
CHAIN_LENGTH: How many shares P2Pool client keeps
REAL_CHAIN_LENGTH: The {N} value in PPLNS
Note:  REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH

SPREAD:  How long a 'share' is valid (ie. for how many block can be paid for this share)
TARGET_LOOKBEHIND: Is used for diff calculations.  (ie. how many previous shares to use in calculating difficulty) - lower values can be used to prevent a big miner from getting too many shares before diff rises
PERSIST: False (if you want to allow your server to run independently of any bootstrap nodes... but still allow syncing if they exist).  True will require other nodes on the network to run.
IDENTIFIER & PREFIX: P2Pool will only sync with other nodes who have Identifier and Prefix matching yours (and using same p2p port).. if any of the above values change, a new identifier & prefix need to be created in order to prevent problems.

Example:

Code:
      casinocoin=math.Object(
        PARENT=networks.nets['casinocoin'],
        SHARE_PERIOD=5, # seconds target spacing
        CHAIN_LENGTH=3*60*60//5, # shares
        REAL_CHAIN_LENGTH=3*60*60//5, # shares
        TARGET_LOOKBEHIND=60,
        SPREAD=60, # blocks
        IDENTIFIER='7696C5EF0B281C2F'.decode('hex'),
        PREFIX='4C2E2CD651764B9F'.decode('hex'),
        P2P_PORT=23640,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8840,
        BOOTSTRAP_ADDRS='csc.xpool.net bigiron.homelinux.com'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

CasinoCoin generates a new block every 30 seconds.  SHARE_PERIOD should be 1/5 to 1/10th of that.  In this case 5s is (1/6) share period.  Having a value above 1/5 risks more stale shares & larger inefficiency.
CHAIN_LENGTH & REAL_CHAIN_LENGTH are set up to allow for 3 Hour PPLNS.
TARGET_LOOKBEHIND is set to 60 (shares) giving a 300 second (5min) difficulty adjustment.
SPREAD is set to 60 blocks, so a share will be valid up to 60 blocks or REAL_CHAIN_LENGTH (3 hours), whichever is shorter.
P2P_PORT, IDENTIFIER & PREFIX must match the other nodes you wish to sync with... (all the above values must also match)

Hope this clears a few things up!!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: cheetah3 on December 26, 2013, 11:46:34 AM
Hi guys!

Thanks for really helpful information.
But I still can't understand or I miss something:

- How to calculate IDENTIFIER & PREFIX value adding new coin in p2pool ?

Also inside file bitcoin/helper.py I do not see that line

Quote
if 'lite' in net.NAME or 'feather' in net.NAME or 'chn' in net.NAME or 'franko' in net.NAME or 'digital' in net.NAME or 'worldcoin' in net.NAME:

Where is it? Or there already no needs to add new coin description?

Thanks!

Merry XMas and Happy New Year to all :)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on December 26, 2013, 07:37:36 PM
So I've been trying to get a few alt coin pools up lately. I've been working on lottocoin, grandcoin, earthcoin and luckycoin. None of which have i seen very much success. I'm fairly confident that through this topic, I've been able to add the correct information in the networks.py files. I can post copies of those if needed. However, what I'm really having issues with is this message that is being logged in the output of p2pool each second.

Code:
Error getting work from bitcoind:
2013-12-26 23:31:26.253079 > Traceback (most recent call last):
2013-12-26 23:31:26.253110 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
2013-12-26 23:31:26.253156 >     current.result = callback(current.result, *args, **kw)
2013-12-26 23:31:26.253189 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
2013-12-26 23:31:26.253219 >     _inlineCallbacks(r, g, deferred)
2013-12-26 23:31:26.253248 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
2013-12-26 23:31:26.253280 >     result = result.throwExceptionIntoGenerator(g)
2013-12-26 23:31:26.253321 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
2013-12-26 23:31:26.253352 >     return g.throw(self.type, self.value, self.tb)
2013-12-26 23:31:26.253378 > --- <exception caught here> ---
2013-12-26 23:31:26.253404 >   File "/home/squiggie/p2pool-eac/p2pool/util/deferral.py", line 41, in f
2013-12-26 23:31:26.253430 >     result = yield func(*args, **kwargs)
2013-12-26 23:31:26.253456 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2013-12-26 23:31:26.253483 >     result = g.send(result)
2013-12-26 23:31:26.253509 >   File "/home/squiggie/p2pool-eac/p2pool/bitcoin/helper.py", line 49, in getwork
2013-12-26 23:31:26.253536 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2013-12-26 23:31:26.253562 >   File "/home/squiggie/p2pool-eac/p2pool/util/pack.py", line 63, in unpack
2013-12-26 23:31:26.253593 >     obj = self._unpack(data, ignore_trailing)
2013-12-26 23:31:26.253620 >   File "/home/squiggie/p2pool-eac/p2pool/util/pack.py", line 47, in _unpack
2013-12-26 23:31:26.253652 >     raise LateEnd()
2013-12-26 23:31:26.253680 > p2pool.util.pack.LateEnd:

This error is logged several times a second and is happening for each one of the new coins I've tried. However, the same p2pool code is running WDC, CSC and FTC pools successfully without that error.

Also, I'm able to successfully connect to the pool and hash in it, but it seems the connection to the wallet daemon is lost every few minutes and takes a minute or two to reconnect. My miner will show that it's having issues connecting to the stratum server and then eventually connect back up and start hashing again.

Does anyone know the cause of this error? Is it just something code related to these new coins? I'd like to continue making p2pools for these new coins, but it seems the hurdle of adapting the p2pool code for these might just be too big to overcome.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: cheetah3 on December 27, 2013, 04:04:43 AM
So I've been trying to get a few alt coin pools up lately. I've been working on lottocoin, grandcoin, earthcoin and luckycoin. None of which have i seen very much success. I'm fairly confident that through this topic, I've been able to add the correct information in the networks.py files. I can post copies of those if needed. However, what I'm really having issues with is this message that is being logged in the output of p2pool each second.

Code:
Error getting work from bitcoind:
2013-12-26 23:31:26.253079 > Traceback (most recent call last):
2013-12-26 23:31:26.253110 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
2013-12-26 23:31:26.253156 >     current.result = callback(current.result, *args, **kw):

This error is logged several times a second and is happening for each one of the new coins I've tried. However, the same p2pool code is running WDC, CSC and FTC pools successfully without that error.

Also, I'm able to successfully connect to the pool and hash in it, but it seems the connection to the wallet daemon is lost every few minutes and takes a minute or two to reconnect. My miner will show that it's having issues connecting to the stratum server and then eventually connect back up and start hashing again.

Does anyone know the cause of this error? Is it just something code related to these new coins? I'd like to continue making p2pools for these new coins, but it seems the hurdle of adapting the p2pool code for these might just be too big to overcome.


Same here but I have another error :)
I always have an error "Authorisation required" after running pool
Quote
run_p2pool.py bituser bitpassw --net lottocoin
I have feeling its because of incorrect IDENTIFIER and  PREFIX values.
How did you calculate them?

btw, did you found line where to add new coin name in bitcoin/helper.py (about what talking here at the top of topic ? Something like that:
Quote
if 'lite' in net.NAME



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on December 27, 2013, 02:08:55 PM

Same here but I have another error :)
I always have an error "Authorisation required" after running pool
Quote
run_p2pool.py bituser bitpassw --net lottocoin
I have feeling its because of incorrect IDENTIFIER and  PREFIX values.
How did you calculate them?

btw, did you found line where to add new coin name in bitcoin/helper.py (about what talking here at the top of topic ? Something like that:
Quote
if 'lite' in net.NAME



The IDENTIFIER and PREFIX in the network.py are only used to identify your p2pool node with others of the same coin. Technically, if you want to run a p2pool node with others, these values must be the same across all nodes. If you don't want to run the p2pool with others, then you can create these yourself and keep them private so no nodes can connect with you.

However, if you're referring to the P2P_PREFIX in the bitcoin/networks.py, then yes, that is coin specific. I believe that is mentioned earlier in this thread on where to find it, so read up a little, but I know you'll be looking in the coins source in the main.cpp file. Lool for pchMessageStart[4] and you'll see the hex codes that you need to pull out there.

As far as the helper.py file, I don't think that needs to be modified anymore. At least I haven't been modifying it and have been able to successfully create some pools. I don't think the line that is referenced above exists anymore.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: helloword2013 on December 27, 2013, 02:11:43 PM
useful


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: cheetah3 on December 27, 2013, 02:21:51 PM

The IDENTIFIER and PREFIX in the network.py are only used to identify your p2pool node with others of the same coin. Technically, if you want to run a p2pool node with others, these values must be the same across all nodes. If you don't want to run the p2pool with others, then you can create these yourself and keep them private so no nodes can connect with you.

However, if you're referring to the P2P_PREFIX in the bitcoin/networks.py, then yes, that is coin specific. I believe that is mentioned earlier in this thread on where to find it, so read up a little, but I know you'll be looking in the coins source in the main.cpp file. Lool for pchMessageStart[4] and you'll see the hex codes that you need to pull out there.

As far as the helper.py file, I don't think that needs to be modified anymore. At least I haven't been modifying it and have been able to successfully create some pools. I don't think the line that is referenced above exists anymore.

Thank you, very useful. Yes about P2P_PREFIX  I got it and found how to create it.

Ok, let's say I want to run p2pool node with others. But for some new coin, that still do not have much nodes, how to generate IDENTIFIER and PREFIX ?
If I writing random string, its not working, pool return me exception.

Can I take ready values from some other coin? And will it conflict with existing coins inside networks.py?
Let's say I have FST and want to add LOTOCoin. Should that values (IDENTIFIER ) to be unique for each coin listed in networks.py or unique values per coin doesn't required?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on December 27, 2013, 02:42:14 PM
Thank you, very useful. Yes about P2P_PREFIX  I got it and found how to create it.

Ok, let's say I want to run p2pool node with others. But for some new coin, that still do not have much nodes, how to generate IDENTIFIER and PREFIX ?
If I writing random string, its not working, pool return me exception.

Can I take ready values from some other coin? And will it conflict with existing coins inside networks.py?
Let's say I have FST and want to add LOTOCoin. Should that values (IDENTIFIER ) to be unique for each coin listed in networks.py or unique values per coin doesn't required?


I have always just slightly modified them from another coin already in network.py. Yes, it has to be unique within network.py or I think you'll get an error. So for example, if the litecoin IDENTIFIER is
Code:
IDENTIFIER='e037d5b8c6923410'.decode('hex')
, then just take that and slightly modify a few numbers. Make it something like
Code:
IDENTIFIER='e037d5b8c6923415'.decode('hex')
and see if that works (just changed the last digit). I'm pretty sure that will be fine, as it's what I've done, but if there is someone else who thinks I'm off, please speak up.


However, if you want other to be able to connect to you, it will need to be unique and posted online so others can follow. If you want to fork the original p2pool code or forkl Rav3n or Cartman's code in github and add your own entries, then report back if you're successful, then others will know and be able to obtain your values and run their own nodes for your coin. That's how most of the entries in network.py get shares, through github forks.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on December 27, 2013, 07:07:12 PM
To generate unique values for IDENTIFIER and PREFIX create a random string of 19 numbers and convert to Hex.

I use the windows Programmer Calculator to do the conversion (View menu).

Example:
5486237465184378845 = 4C2307E841C11FDD


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: cheetah3 on December 27, 2013, 07:19:37 PM
To generate unique values for IDENTIFIER and PREFIX create a random string of 19 numbers and convert to Hex.

I use the windows Programmer Calculator to do the conversion (View menu).

Example:
5486237465184378845 = 4C2307E841C11FDD

FINALLY LOL!

Thanks so much, testing now...


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: cheetah3 on December 28, 2013, 09:16:16 AM
To generate unique values for IDENTIFIER and PREFIX create a random string of 19 numbers and convert to Hex.

I use the windows Programmer Calculator to do the conversion (View menu).

Example:
5486237465184378845 = 4C2307E841C11FDD

Cartman, thank you looks like I almost done with config settings :)
But now... I trying to run your version of p2pool, for craftcoin.
Craftcoin without pool for solo working good.

When I do
Quote
run_p2pool.py bituser bitpwd --net craftcoin

I getting error "twisted.web.error.Error: 401 Authorization Required"
 

And funny thing - with NameCoin error too:
Quote
run_p2pool.py --net namecoin namecoinuser namecoinpwd
>Testing bitcoind RPC connection to 'http://127.0.0.1:8336/
>Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
Maybe someonehad same error  and  have an idea?

Thanks!
Found several things:
RPC_PORT in the bitcoinrpc.cpp - but updated wallets have only constants DEF_RPC_PORT etc there, real values can be found in the protocol.h file.
Also there values for testnet:
DEF_PORT
const int DEF_RPCPORT
const int DEF_TESTNET_PORT
const int DEF_TESTNET_RPCPORT

All testnet and other ports are correct now, but still same error "Check failed".
That strange, some coins working good with p2pool, some have that error.





Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on December 29, 2013, 09:22:13 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.

Code:
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
Code:
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.
Code:
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,
    ),

Code:
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 (https://github.com/forrestv/p2pool/issues/151) on the official p2pool github in case anyone wants to contribute.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: seocrow on December 30, 2013, 03:42:15 PM
Guys. Is anyone interested in opening a Skype Chat group to discuss P2Pool configurations.

I have setup several coins that are working perfectly now on P2Pool.

These include Dogecoin, Worldcoin, Feathercoin, Casinocoin

I have configured Grandcoin and Frankocoin but have a few issues getting these up and running. The process runs ok but all my stats are blank.

If anyone wants to trade coin settings or work on this together let me know. Lets work on expanding ALT coins available on P2Pool sites. It benefits us all.

Im also hoping to roll out Earthcoin soon.

If you want to discuss further PM me or hit me up on Skype. My Skype ID is SEOCrow


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on December 30, 2013, 08:57:26 PM
Guys. Is anyone interested in opening a Skype Chat group to discuss P2Pool configurations.

I have setup several coins that are working perfectly now on P2Pool.

These include Dogecoin, Worldcoin, Feathercoin, Casinocoin

I have configured Grandcoin and Frankocoin but have a few issues getting these up and running. The process runs ok but all my stats are blank.

If anyone wants to trade coin settings or work on this together let me know. Lets work on expanding ALT coins available on P2Pool sites. It benefits us all.

Im also hoping to roll out Earthcoin soon.

If you want to discuss further PM me or hit me up on Skype. My Skype ID is SEOCrow

I certainly would be interested in doing that. Timing is key though. I too have tried to get earthcoin going but there is an issue with the p2pool code and the wallet. I've been running into sporadic disconnects. The post above me details that, but I'm sure with the right people, this can be overcome.

I'm in CST time and cane be available during the day tues and thur or perhaps on a weekend or late weeknight.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: kh4n on December 31, 2013, 12:32:23 PM
Hey

Also interested in this... skype: kh4n2k8
Maybe we can get some interest / support from rav3n or cartman in maintaing a GIT for as many cryptos as we can manage.

I can help with providing stable/high-speed hosting for the nodes... as well as tinkering with the source files.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on December 31, 2013, 11:43:45 PM
For those having problems I was curious as to what version of the p2pool source you were trying to use? Have seen that the latest version of p2pool (13.4) requires later versions of BTC and LTC wallets. Perhaps the ALT coin wallets you are using may not be compatible with 13.4. Try p2pool version 13.3 or earlier.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: seocrow on January 01, 2014, 12:36:16 AM
Hi Cartman

Im using this version currently. Im willing to try some older versions if you think this could be why we are hitting these issues

3.3-96-g7f43101-dirty


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: yahma on January 01, 2014, 01:59:40 AM
rav3n git is on 13.4 and cartman-git is on 13.3

Found that syncing casino coin using (13.4) to 13.3 nodes does not work, unless you first copy the data from an existing 13.3 to 13.4 install.

@squiggie I think everyone here would be interested in syncing to common optimized configurations.  Could you please post your settings for grandcoin and other?  if you need to skype: gururise1


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CarPro on January 03, 2014, 07:13:05 AM
stop guessing. what does the code say?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on January 03, 2014, 02:36:24 PM
stop guessing. what does the code say?

If you know C++ or Python perhaps you would like to help contribute? We have some skype rooms going and some other discussions. Bring your expertise if you would like to be constructive.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on January 08, 2014, 06:29:48 AM
removed


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: aynstein on January 09, 2014, 07:15:50 AM
Guys. Is anyone interested in opening a Skype Chat group to discuss P2Pool configurations.

I have setup several coins that are working perfectly now on P2Pool.

These include Dogecoin, Worldcoin, Feathercoin, Casinocoin

I have configured Grandcoin and Frankocoin but have a few issues getting these up and running. The process runs ok but all my stats are blank.

If anyone wants to trade coin settings or work on this together let me know. Lets work on expanding ALT coins available on P2Pool sites. It benefits us all.

Im also hoping to roll out Earthcoin soon.

If you want to discuss further PM me or hit me up on Skype. My Skype ID is SEOCrow

Did you make any progress with this? I would do a Skype conf also, but we should post the results on the forum. I read at least 3 people up for skyping...lets try and do it in the next day or so?

Skype address aynstein


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on January 09, 2014, 02:04:23 PM
Guys. Is anyone interested in opening a Skype Chat group to discuss P2Pool configurations.

I have setup several coins that are working perfectly now on P2Pool.

These include Dogecoin, Worldcoin, Feathercoin, Casinocoin

I have configured Grandcoin and Frankocoin but have a few issues getting these up and running. The process runs ok but all my stats are blank.

If anyone wants to trade coin settings or work on this together let me know. Lets work on expanding ALT coins available on P2Pool sites. It benefits us all.

Im also hoping to roll out Earthcoin soon.

If you want to discuss further PM me or hit me up on Skype. My Skype ID is SEOCrow

Did you make any progress with this? I would do a Skype conf also, but we should post the results on the forum. I read at least 3 people up for skyping...lets try and do it in the next day or so?

Skype address aynstein

There are a few of us on skype and we have started a chat room. I've requested that screenname and I'll add you to the chat room.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on January 09, 2014, 09:37:59 PM
Why not IRC?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on January 09, 2014, 10:40:57 PM
Why not IRC?

I don't really have a issue with communicating in both. However I do feel like the irc #p2pool and #p2pool-alt channels get a little crowded with the block announcements and make it hard to have a conversation sometimes, especially if the conversation spans for a while or if people afk for a bit and then come back into it.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on January 09, 2014, 11:35:48 PM
Why not IRC?

I don't really have a issue with communicating in both. However I do feel like the irc #p2pool and #p2pool-alt channels get a little crowded with the block announcements and make it hard to have a conversation sometimes, especially if the conversation spans for a while or if people afk for a bit and then come back into it.

Ok, well my Skype name is CartmanSPC...how do I join?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: taken2 on January 29, 2014, 05:20:39 PM
Hey guys
I try create p2pool for VACoin but got problem with this:

2014-01-29 18:20:21.056813 p2pool (version 13.3-179-g17cf290-dirty)
2014-01-29 18:20:21.056883
2014-01-29 18:20:21.056923 Testing bitcoind RPC connection to 'http://127.0.0.1:5583/' with username 'taken'...
2014-01-29 18:20:21.063174     ...success!
2014-01-29 18:20:21.063218     Current block hash: 13856ea321024ccc6994943458797e352fdc18597cdb218fe8514a2e3
2014-01-29 18:20:21.063247     Current block height: 5497
2014-01-29 18:20:21.063268
2014-01-29 18:20:21.063294 Testing bitcoind P2P connection to '127.0.0.1:7980'...
2014-01-29 18:20:21.144818     ...success!
2014-01-29 18:20:21.144883
2014-01-29 18:20:21.144955 Determining payout address...
2014-01-29 18:20:21.145108     ...success! Payout address: VQUJa6Rsra21ScoJjNLVdtJX7pPFDWP7vh
2014-01-29 18:20:21.145146
2014-01-29 18:20:21.145166 Loading shares...
2014-01-29 18:20:21.145273     ...done loading 0 shares (0 verified)!
2014-01-29 18:20:21.145335
2014-01-29 18:20:21.145371 Initializing work...
2014-01-29 18:20:26.147994 > Error while requesting best block header:
2014-01-29 18:20:26.148044 > Traceback (most recent call last):
2014-01-29 18:20:26.148060 > Failure: twisted.internet.defer.TimeoutError: in ReplyMatcher
2014-01-29 18:20:26.148852 > Unhandled error in Deferred:
2014-01-29 18:20:26.148902 > Unhandled Error
2014-01-29 18:20:26.148923 > Traceback (most recent call last):
2014-01-29 18:20:26.148944 > Failure: twisted.internet.defer.TimeoutError: in ReplyMatcher



Anyone see that and know what is wrong?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: paniczklos on January 30, 2014, 03:15:46 PM
Hi guys do have any idea what went wrong here ? ;/ I've aaded noblecoin to both networks.py files:

Code:
    noblecoin=math.Object(
        PARENT=networks.nets['noblecoin'],
        SHARE_PERIOD=8, # seconds
        CHAIN_LENGTH=6*60*60//8, # shares
        REAL_CHAIN_LENGTH=6*60*60//8, # shares
        TARGET_LOOKBEHIND=20, # shares
        SPREAD=30, # blocks
        IDENTIFIER='6e6f626c656e6f62'.decode('hex'),
        PREFIX='626e6f626c656e6f'.decode('hex'),
        P2P_PORT=8999,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=8998,
        BOOTSTRAP_ADDRS='p2pool-eu.gotgeeks.com p2pool-us.gotgeeks.com rav3n.dtdns.net p2pool.gotgeeks.com p2pool.dtdns.net solidpool.org'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

Code:
    noblecoin=math.Object(
        P2P_PREFIX='c0dbf1fd'.decode('hex'),
        P2P_PORT=55884,
        ADDRESS_VERSION=21, #pubkey_address
        RPC_PORT=55883,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'noblecoin' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 5000*100000000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=60, # s
        SYMBOL='NOBL',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'noblecoin')
                if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/noblecoin/')
                if platform.system() == 'Darwin' else os.path.expanduser('~/.noblecoin'), 'noblecoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://cryptexplorer.com/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://cryptexplorer.com/address/',
        TX_EXPLORER_URL_PREFIX='http://cryptexplorer.com/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0,
    ),

and that's what I get, sorry for the screenshot but I wasn't able to copy it properly;)
http://freebtc.eu/Untitled.jpg

and also this:

Code:
2014-01-30 10:20:19.333057 >     result = result.throwExceptionIntoGenerator(g)
2014-01-30 10:20:19.333247 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-01-30 10:20:19.333430 >     return g.throw(self.type, self.value, self.tb)
2014-01-30 10:20:19.333618 > --- <exception caught here> ---
2014-01-30 10:20:19.333800 >   File "/root/p2pool-rav/p2pool/util/deferral.py", line 41, in f
2014-01-30 10:20:19.333978 >     result = yield func(*args, **kwargs)
2014-01-30 10:20:19.334080 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
2014-01-30 10:20:19.334179 >     result = g.send(result)
2014-01-30 10:20:19.334279 >   File "/root/p2pool-rav/p2pool/bitcoin/helper.py", line 49, in getwork
2014-01-30 10:20:19.334377 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2014-01-30 10:20:19.334454 >   File "/root/p2pool-rav/p2pool/util/pack.py", line 63, in unpack
2014-01-30 10:20:19.334552 >     obj = self._unpack(data, ignore_trailing)
2014-01-30 10:20:19.334660 >   File "/root/p2pool-rav/p2pool/util/pack.py", line 47, in _unpack
2014-01-30 10:20:19.334757 >     raise LateEnd()
2014-01-30 10:20:19.334853 > p2pool.util.pack.LateEnd:
2014-01-30 10:20:26.735934 [b]Handshake timed out, disconnecting from 87.206.175.139:8333[/b]
2014-01-30 10:20:31.709938 P2Pool: 1 shares in chain (1 verified/1 total) Peers: 0 (0 incoming)
2014-01-30 10:20:31.710135  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???

Where is the 8333 port coming from ? ;/

When I tried to mine :

Code:
0 11:26:46.756220 >     raise LateEnd()
2014-01-30 11:26:46.756395 > p2pool.util.pack.LateEnd:
2014-01-30 11:26:48.160877 > ########################################
2014-01-30 11:26:48.161671 > >>> Warning: LOST CONTACT WITH BITCOIND for 1.3 minutes! Check that it isn't frozen or dead!
2014-01-30 11:26:48.162145 > ########################################
2014-01-30 11:26:48.162636 P2Pool: 6 shares in chain (9 verified/9 total) Peers: 0 (0 incoming)
2014-01-30 11:26:48.163076  Local: 206kH/s in last 2.8 minutes Local dead on arrival: ~1.9% (0-4%) Expected time to share: 2.1 minutes
2014-01-30 11:26:48.163523  Shares: 8 (2 orphan, 1 dead) Stale rate: ~37.5% (13-70%) Efficiency: ~83.3% (40-116%) Current payout: 5000.0000 NOBL
2014-01-30 11:26:48.163781  Pool: 335kH/s Stale rate: 25.0% Expected time to block: 19.3 hours
2014-01-30 11:26:49.763698 > Error getting work from bitcoind:
2014-01-30 11:26:49.764641 > Traceback (most recent call last):
2014-01-30 11:26:49.765142 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks
2014-01-30 11:26:49.765615 >     current.result = callback(current.result, *args, **kw)
2014-01-30 11:26:49.766081 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1155, in gotResult
2014-01-30 11:26:49.766568 >     _inlineCallbacks(r, g, deferred)
2014-01-30 11:26:49.766818 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
2014-01-30 11:26:49.767073 >     result = result.throwExceptionIntoGenerator(g)
2014-01-30 11:26:49.767315 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-01-30 11:26:49.767574 >     return g.throw(self.type, self.value, self.tb)
2014-01-30 11:26:49.767810 > --- <exception caught here> ---
2014-01-30 11:26:49.768042 >   File "/root/p2pool-rav/p2pool/util/deferral.py", line 41, in f
2014-01-30 11:26:49.768370 >     result = yield func(*args, **kwargs)
2014-01-30 11:26:49.768640 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
2014-01-30 11:26:49.768895 >     result = g.send(result)
2014-01-30 11:26:49.769128 >   File "/root/p2pool-rav/p2pool/bitcoin/helper.py", line 49, in getwork
2014-01-30 11:26:49.769839 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2014-01-30 11:26:49.770090 >   File "/root/p2pool-rav/p2pool/util/pack.py", line 63, in unpack
2014-01-30 11:26:49.770442 >     obj = self._unpack(data, ignore_trailing)
2014-01-30 11:26:49.770689 >   File "/root/p2pool-rav/p2pool/util/pack.py", line 47, in _unpack
2014-01-30 11:26:49.770930 >     raise LateEnd()
2014-01-30 11:26:49.771158 > p2pool.util.pack.LateEnd:
2014-01-30 11:26:51.168902 > ########################################
2014-01-30 11:26:51.169504 > >>> Warning: LOST CONTACT WITH BITCOIND for 1.4 minutes! Check that it isn't frozen or dead!
2014-01-30 11:26:51.169964 > ########################################
2014-01-30 11:26:51.170314 P2Pool: 6 shares in chain (9 verified/9 total) Peers: 0 (0 incoming)
2014-01-30 11:26:51.170716  Local: 205kH/s in last 2.9 minutes Local dead on arrival: ~1.9% (0-4%) Expected time to share: 2.1 minutes
2014-01-30 11:26:51.171046  Shares: 8 (2 orphan, 1 dead) Stale rate: ~37.5% (13-70%) Efficiency: ~83.3% (40-116%) Current payout: 5000.0000 NOBL
2014-01-30 11:26:51.171328  Pool: 335kH/s Stale rate: 25.0% Expected time to block: 19.3 hours




Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on January 30, 2014, 06:39:38 PM
Code:
    bitcoin=math.Object(
        PARENT=networks.nets['bitcoin'],
        SHARE_PERIOD=30, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
...
    litecoin=math.Object(
        PARENT=networks.nets['litecoin'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares

Trying to lock down two settings for p2pool.

The first is the last number in CHAIN_LENGTH and REAL_CHAIN_LENGTH. I hear that it should equal SHARE_PERIOD but see that both Bitcoin and Litecoin have both moved away from that keeping it at 10.

Second is TARGET_LOOKBEHIND. Can anyone explain that setting? I hear that it is the number of shares back p2pool uses to adjust the share diff. and have seen some people starting to use lower values to cause the share diff to adjust faster. I am not sure if that is a good idea since 200 shares is already rather low.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on February 01, 2014, 02:30:57 PM
I am going to join this topic and added cartmanspc and CryptoCrow to skype. Hope you guys will add me so I can join the discussion there as well.
It annoys me hugely that there isn't a proper post or guide which explains all the various networks.py settings in detail.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmininginc on February 01, 2014, 02:55:18 PM
8<
It annoys me hugely that there isn't a proper post or guide which explains all the various networks.py settings in detail.

Exactly. And then everybody's wondering why p2pool isn't used more.
I've been trying to get some p2pool nodes up and running for new coins, but it's a pain...


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mapleshadow on 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?

Code:
    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,
    ),

Code:
    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,
    ),


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mapleshadow on 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.

Code:
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
Code:
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.
Code:
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,
    ),

Code:
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 (https://github.com/forrestv/p2pool/issues/151) on the official p2pool github in case anyone wants to contribute.

error error error error................


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on February 05, 2014, 12:53:57 PM
2 days - no reaction. p2pool really looks like it is left for dead.
This post sums it all up for me how I feel about p2pool atm: https://bitcointalk.org/index.php?topic=441415.msg4884203#msg4884203


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmininginc on 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on February 07, 2014, 03:01:56 PM
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 SPECIFIC

Sample /bitcoin/networks.py:

Code:
 
<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 explanation

P2P_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]


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on 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).


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmininginc on February 07, 2014, 03:35:09 PM
Tnx for sharing this tvb!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: juiced on February 07, 2014, 03:44:52 PM
+1 for tvb!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on 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.

Quote
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.

Quote
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.

Quote
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. :)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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..


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmouse on 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.git
has 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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.git
has 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 07, 2014, 10:03:34 PM
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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on 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.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 07, 2014, 10:37:42 PM
As an example...I believe Ravs git has old specs on some of the coins.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on 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 /


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 07, 2014, 11:21:47 PM
For SPREAD I use the following formula:

SPREAD=
600/[block time]=x
x*3=spread


Not saying that it is right but it's what I use.

Code:
bitcoin SPREAD=3 block every 600 seconds         Baseline
litecoin SPREAD=12 block every 150 seconds       600/150=4       4x3=12
bbqcoin SPREAD=30 block every 60 seconds         600/60=10       10x3=30
casinocoin SPREAD=60 block every 30 seconds      600/30=20       20x3=60
digitalcoin SPREAD=90 block every 20 seconds     600/20=30       30x3=90  (old spec)
digitalcoin SPREAD=45 block every 40 seconds     600/40=15       15x3=45  (new spec)
worldcoin SPREAD=120 block every 15 seconds      600/15=40       40x3=120 (old spec)
worldcoin SPREAD=60 block every 30 seconds       600/30=20       20x3=60  (new spec)
globalcoin SPREAD=45 block every 40 seconds      600/40=15       15x3=45
dogecoin SPREAD=30 block every 60 seconds        600/60=10       10x3=30
potcoin SPREAD=45 block every 40 seconds         600/40=15       15x3=45
craftcoin SPREAD=6 block every 300 seconds       600/300=2        2x3=6  (old spec)
craftcoin SPREAD=30 block every 60 seconds       600/60=10       10x3=30 (new spec)


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 07, 2014, 11:23:41 PM
Sadly when we did the first vertcoin nodes, we used spread=3 because we just copied litecoin. It really should have been 12-15... would avoid so much confusion for small miners right now. Doh.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmouse on February 08, 2014, 03:52:00 AM
Sadly when we did the first vertcoin nodes, we used spread=3 because we just copied litecoin. It really should have been 12-15... would avoid so much confusion for small miners right now. Doh.

You can lower your share difficulty by appending /diff to your p2pool username. That should generate more shares and more regular payouts, but of course you get paid less per share. I'm trying
Code:
VTCPayoutAddress+0.001465/0.55
at the moment. I can tell tomorrow, if this makes things better or worse...


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 08, 2014, 03:54:02 AM
You can lower your share difficulty by appending /diff to your p2pool username. That should generate more shares and more regular payouts, but of course you get paid less per share. I'm trying
Code:
VTCPayoutAddress+0.001465/0.55
at the moment. I can tell tomorrow, if this makes things better or worse...

address/diff won't let you set diff below the minimum share diff for the pool though. It's intended more to raise diff for giant miners than to lower diff, I thought?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mmouse on February 08, 2014, 04:42:31 PM
You can lower your share difficulty by appending /diff to your p2pool username. That should generate more shares and more regular payouts, but of course you get paid less per share. I'm trying
Code:
VTCPayoutAddress+0.001465/0.55
at the moment. I can tell tomorrow, if this makes things better or worse...

address/diff won't let you set diff below the minimum share diff for the pool though. It's intended more to raise diff for giant miners than to lower diff, I thought?

First, I've to admit that I'm not completely sure about how p2pool handle diffs and so on, just my own code reading + try and error.

That said, pool minimum share diff (what you get e.g. with http://vtc.coinpools.de:9171/difficulty) is not what p2pool gives out to your miner as share difficulty (main reason, why the "share difficulty" displayed on the standard web client page is nonsense). p2pool uses a quite complicated algorithm to compute pseudo_share_difficulty (work.py lines 265-) and share_difficulty (data.py lines 111-) specifically for your miner client (see debug.log "New work for worker" entries).

IMHO the main problem with this is, that p2pool tries to dish out share difficulties so that it expects no more than one solved share per minute from all connected clients. So as my VTC node has about 6 MH/s local rate at the moment, the log shows a standard share difficulty of 1.39 given to clients. Minimum share difficulty for the pool is 0.063 on the other hand. So it seems perfectly legit to specify a custom share difficulty of 0.55 for my miner. (If you specify it too low, p2pool seems to use the minimum pool difficulty anyway).

Quote
I can tell tomorrow, if this makes things better or worse...

Did work perfectly for me during the last 12 hours, by the way ;)



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 08, 2014, 06:37:22 PM
Hmmm. Even if I try to set /.00001 I can't see it changing anything on my miner's end. Using + of course submits diff 1 pseudo-shares constantly which is a waste of resources.

Looking at all of the New Work messages, they aren't all being set to the same difficulty. On my pool most are set to 0.00244 but one is .000812 and one is .000244. I assume those are the pseduo share difficulties and the tiny ones are the two slowest miners in pool?

Because yes, there is also the "Share difficulty: 1.918" which is going to all but 2 miners. One is me with my /.000001 forcing it down to match share difficulty. That other must be you or someone like you, setting a lower share difficulty with ADDR/ which means you'll actually have reduced variance since the difficulty chosen is still over the minimum.

Is it really 1 share total from all miners combined, or 1 share per minute from each miner individually? The latter would make more sense to me, but I'm thinking of it from a "running a pool-like public node" perspective. p2pool is designed from a "run it as a reduced variance solo mining operation" perspective.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 08, 2014, 06:44:41 PM
IMHO the main problem with this is, that p2pool tries to dish out share difficulties so that it expects no more than one solved share per minute from all connected clients. So as my VTC node has about 6 MH/s local rate at the moment, the log shows a standard share difficulty of 1.39 given to clients. Minimum share difficulty for the pool is 0.063 on the other hand. So it seems perfectly legit to specify a custom share difficulty of 0.55 for my miner. (If you specify it too low, p2pool seems to use the minimum pool difficulty anyway).

Interesting. I kept assuming small miner variance was due to large share difficulty but that's not the case at all for VTC right now, if you are a small miner using a big public node.

2014-02-08 18:41:03.086159 New work for worker! Difficulty: 0.001676 Share difficulty: 1.505790
2014-02-08 18:41:03.287006 New work for worker! Difficulty: 0.001676 Share difficulty: 0.058060

I have a couple dozen lines similar to the first. The 2nd is my testing with difficultly forced as low as it can go. Being a single GPU miner, 1.5 (98683) will take me far far longer to get 1 share than .058 (3805) would.

Edit: Apologies for the thread hijack. mmouse we should move this to the P2Pool main thread or to the VTC thread.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tvb on February 09, 2014, 10:00:05 AM
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 /

Thank you! I have updated my post to reflect your corrections.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 10, 2014, 03:14:06 AM
Started a new thread detailing the values. Work in progress. Will update as time allows:

https://bitcointalk.org/index.php?topic=457574.0


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: primeblock on February 14, 2014, 02:29:41 PM
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 14, 2014, 02:57:22 PM
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.

Someone say getting work with 0 diff causes errors but I have no idea if it is HW errors or something else. Try connecting to your node with /.00001+.00001 if you use a scrypt based coin. (/1+1 if a SHA based coin). That will make sure you never get anything below 1 diff.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 14, 2014, 07:38:18 PM
Thank you all for this useful thread!

But I found if use p2pool setup by myself the HW error is very high from the output of CGMiner.

I can say I have seen this several times myself, unfortunately not 100% sure the cause of it quite yet and has not happened everytime so have not found the pattern yet.

Have seen this happen on the first miner to join a node. I forget the exact message but also notice something like "unidentified stratum" in the console when this happens.

Simple quick fix (for me) is to restart the miner.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: SuperSta on February 25, 2014, 07:56:47 PM
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Q2) I have done the settings (except for prefix and identifier) to the best of my ability with the aid of this thread for Litebar network.py in both P2Pool locations. Can some bright spark actually post the correct settings for Litebar please. I have spent 12 hours trying figuring it out and could use any help.

Code:
   litebar=math.Object(
        PARENT=networks.nets['litebar'],
        SHARE_PERIOD=15,
        CHAIN_LENGTH=24*60*60//10,
        REAL_CHAIN_LENGTH=24*60*60//10,
        TARGET_LOOKBEHIND=200,
        SPREAD=10,
        IDENTIFIER=''.decode('hex'),
        PREFIX=''.decode('hex'),
        P2P_PORT=19065,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=true,
        WORKER_PORT=19055,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='',
        VERSION_CHECK=lambda v: True,

    ),

 


    litebar=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=9065,
        ADDRESS_VERSION=48,
        RPC_PORT=9055,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'litebaraddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 2*100000000 >> (height + 1)//438000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=180,
        SYMBOL='LTB',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'litebar') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/litebar/') if platform.system() == 'Darwin' else os.path.expanduser('~/.litebar'), 'litebar.conf'),
        BLOCK_EXPLORER_URL_PREFIX='',
        ADDRESS_EXPLORER_URL_PREFIX='',
        TX_EXPLORER_URL_PREFIX='',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
DUMB_SCRYPT_DIFF=0.03e8,
    ),

I know some of these settings are ball park figures, and some of these setting might be completely wrong. Any help would be appreciated. Thanks


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 25, 2014, 10:51:29 PM
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: SuperSta on February 26, 2014, 12:33:08 AM
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.

Thank you for that!

This is what happens when I run it - I get all Succcesses at the top but then I get this repeatedly:

2014-02-25 19:31:06.817362 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-02-25 19:31:06.817451  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???


Any ideas?

EDIT: Its works I think, I just pointed my miner at it. I'm getting a bunch of HW issues but I'll sort that out.

When I tried starting a Litecoin p2pool earlier I wasnt getting the above messages that I am getting with Litebar. Not sure why.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: SuperSta on February 26, 2014, 01:19:49 AM
Q1) Can someone let me know how to get the Prefix and the Identifier for a new coin? (specifically litebar)

Added it to my guide..it is also here earlier in this thread.

Thank you for that!

This is what happens when I run it - I get all Succcesses at the top but then I get this repeatedly:

2014-02-25 19:31:06.817362 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-02-25 19:31:06.817451  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???


Any ideas?

EDIT: Its works I think, I just pointed my miner at it. I'm getting a bunch of HW issues but I'll sort that out.

When I tried starting a Litecoin p2pool earlier I wasnt getting the above messages that I am getting with Litebar. Not sure why.

Right I have this kinda working, finally.

I was getting a bunch of hardware issues until I put +16 after my username in my cgminer conf file. However I dont think this is the permanent solution. I think its a setting on the server that needs to be corrected to may be allocate the difficulty better. I think its one (or more) of the settings to do with ~/P2Pool/P2Pool/Network.py

I will tweak them, however if anyone has any ideas on which ones I should be fiddling around with, please let me know.

Muchos gracias amigos.

UPDATE: This is it: New Litebar P2Pool: http://lifeforce.info:24323 - To add to your collection! Use as your main or as a back up - VPS Hosted - London Based - Fee: 0.5% Going to do some more tweaking first.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 26, 2014, 01:26:49 PM
When you first connect to a new node and there are no stats at all you will get served DIFF 0 work which will cause HWs in some types of miners. If you mine for a while with any + it will get some stats stored, then you can disconnect and reconnect without the + and you should be fine, with vardiff giving you pseudoshare targets above 0. I just put in a suggestion to the p2pool repo that the minimum work ever served should be 1 (for sha256) or 1/X where X is the scrypt adjustment to the difficulty figure for that coin (it's in bitcoin/networks.py).


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 26, 2014, 06:54:33 PM
When you first connect to a new node and there are no stats at all you will get served DIFF 0 work which will cause HWs in some types of miners. If you mine for a while with any + it will get some stats stored, then you can disconnect and reconnect without the + and you should be fine, with vardiff giving you pseudoshare targets above 0. I just put in a suggestion to the p2pool repo that the minimum work ever served should be 1 (for sha256) or 1/X where X is the scrypt adjustment to the difficulty figure for that coin (it's in bitcoin/networks.py).

I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on February 26, 2014, 06:57:36 PM
I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.

The danger is like the guy who replied here

https://github.com/forrestv/p2pool/issues/183

You probably recognize him from irc. :) If he falls over to a backup pool then much later back to his own node, it might do nothing but HWs all day until he can manually fix it because of the 0 diff issue.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on February 27, 2014, 07:10:15 PM
I just immediately reconnect when that happens. Have not had to use + anything but then again I have 5 Mh/s so it may be adjusting higher faster for me so when I reconnect the pseudo diff is already primed to be higher.

The danger is like the guy who replied here

https://github.com/forrestv/p2pool/issues/183

You probably recognize him from irc. :) If he falls over to a backup pool then much later back to his own node, it might do nothing but HWs all day until he can manually fix it because of the 0 diff issue.
Yes, that is a problem  :-\
Perhaps using cgwatcher can help. Not sure (haven't looked) but it may have a setting to watch for # of HW errors and restart the miner. If not then maybe we can make a feature suggestion.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Hyacin on March 07, 2014, 08:01:42 AM
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.

<snip>

Now, what I noticed is in the pack.py file, the functions
<snip>
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.
<snip>

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 (https://github.com/forrestv/p2pool/issues/151) on the official p2pool github in case anyone wants to contribute.


Anyone have any updates/more information on this?  The bug report hasn't been updated in quite a while it appears.  I recall reading somewhere (probably this thread) that it has something to do with transaction comments in some coins.  I tried setting ignore_trailing to True as mentioned above, and that resolves my "Error getting work from bitcoind" errors, and p2pool will accept and work on block with transactions, but when they're solved it is unable to submit them ...

Successful block since making the change (which showed up in my wallet moments later) -

Code:
2014-03-07 02:39:16.574778 New work for worker! Difficulty: 0.001344 Share difficulty: 0.013897 Total block value: 1000.000000 GDC including 0 transactions
2014-03-07 02:39:16.577876 New work for worker! Difficulty: 0.000750 Share difficulty: 0.013897 Total block value: 1000.000000 GDC including 0 transactions
<snip>
2014-03-07 02:39:32.021422 GOT BLOCK FROM MINER! Passing to bitcoind! http://grandcoin.org/blocks/63e787bf697863ca4657ce95fac4f7c72ac37963b6969343c00b9ecbfbc5d44b
2014-03-07 02:39:32.021524
2014-03-07 02:39:32.029135 GOT BLOCK FROM PEER! Passing to bitcoind! fbc5d44b bitcoin: http://grandcoin.org/blocks/63e787bf697863ca4657ce95fac4f7c72ac37963b6969343c00b9ecbfbc5d44b

Unsuccessful block since making the change -

Code:
2014-03-07 02:46:05.004488 New work for worker! Difficulty: 0.001263 Share difficulty: 0.015175 Total block value: 1000.000000 GDC including 1 transactions
2014-03-07 02:46:05.007726 New work for worker! Difficulty: 0.000750 Share difficulty: 0.015175 Total block value: 1000.000000 GDC including 1 transactions
<snip>
2014-03-07 02:46:05.869605 GOT BLOCK FROM MINER! Passing to bitcoind! http://grandcoin.org/blocks/a0cf1b50837d2c59dab244ad472879ef1de9e93ff961f05a530d09abb32c0fef
2014-03-07 02:46:05.875186 > GOT INCOMPLETE BLOCK FROM PEER! b32c0fef bitcoin: http://grandcoin.org/blocks/a0cf1b50837d2c59dab244ad472879ef1de9e93ff961f05a530d09abb32c0fef
<snip>
2014-03-07 02:46:05.892902 > Error submitting block: (will retry)
2014-03-07 02:46:05.892947 > Traceback (most recent call last):
2014-03-07 02:46:05.892983 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks
2014-03-07 02:46:05.893016 >     current.result = callback(current.result, *args, **kw)
2014-03-07 02:46:05.893051 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in gotResult
2014-03-07 02:46:05.893083 >     _inlineCallbacks(r, g, deferred)
2014-03-07 02:46:05.893118 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893149 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893182 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893213 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893246 > --- <exception caught here> ---
2014-03-07 02:46:05.893277 >   File "/home/rob/p2pool/p2pool/util/deferral.py", line 41, in f
2014-03-07 02:46:05.893307 >     result = yield func(*args, **kwargs)
2014-03-07 02:46:05.893338 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893368 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893400 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893431 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893463 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 76, in submit_block_rpc
2014-03-07 02:46:05.893494 >     result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex')))
2014-03-07 02:46:05.893526 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 02:46:05.893558 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 02:46:05.893635 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 02:46:05.893665 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 02:46:05.893699 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 133, in _http_do
2014-03-07 02:46:05.893729 >     raise Error_for_code(resp['error']['code'])(resp['error']['message'], resp['error'].get('data', None))
2014-03-07 02:46:05.893771 > p2pool.util.jsonrpc.NarrowError: -1 CDataStream::read() : end of data

It retries a few times and then gives up.  I've switched back to solo mining right off the wallet (so, no merged  :() until I can figure this out, but I don't know where to begin, and half a day of reading everything I could find online hasn't yielded a solution  :(


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Hyacin on March 07, 2014, 09:58:01 AM
ok, I think I've got it looking for a comment now by modifying the transaction stuff in p2pool/data.py and p2pool/bitcoin/data.py, but now I'm getting EarlyEnd, I'm guessing when there isn't a comment present -

Code:
2014-03-07 04:55:02.756009 > Error getting work from bitcoind:
2014-03-07 04:55:02.756092 > Traceback (most recent call last):
2014-03-07 04:55:02.756140 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks
2014-03-07 04:55:02.756183 >     current.result = callback(current.result, *args, **kw)
2014-03-07 04:55:02.756223 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in gotResult
2014-03-07 04:55:02.756263 >     _inlineCallbacks(r, g, deferred)
2014-03-07 04:55:02.756301 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
2014-03-07 04:55:02.756341 >     result = result.throwExceptionIntoGenerator(g)
2014-03-07 04:55:02.756432 >   File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
2014-03-07 04:55:02.756478 >     return g.throw(self.type, self.value, self.tb)
2014-03-07 04:55:02.756517 > --- <exception caught here> ---
2014-03-07 04:55:02.756554 >   File "/home/rob/p2pool/p2pool/util/deferral.py", line 41, in f
2014-03-07 04:55:02.756591 >     result = yield func(*args, **kwargs)
2014-03-07 04:55:02.756648 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
2014-03-07 04:55:02.756721 >     result = g.send(result)
2014-03-07 04:55:02.756791 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 49, in getwork
2014-03-07 04:55:02.756861 >     transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
2014-03-07 04:55:02.756932 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 63, in unpack
2014-03-07 04:55:02.757004 >     obj = self._unpack(data, ignore_trailing)
2014-03-07 04:55:02.757077 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 42, in _unpack
2014-03-07 04:55:02.757135 >     obj, (data2, pos) = self.read((data, 0))
2014-03-07 04:55:02.757175 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 295, in read
2014-03-07 04:55:02.757212 >     item[key], file = type_.read(file)
2014-03-07 04:55:02.757249 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 310, in read
2014-03-07 04:55:02.757286 >     value, file = self.inner.read(file)
2014-03-07 04:55:02.757323 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 218, in read
2014-03-07 04:55:02.757360 >     data, file = read(file, self.bytes)
2014-03-07 04:55:02.757396 >   File "/home/rob/p2pool/p2pool/util/pack.py", line 16, in read
2014-03-07 04:55:02.757433 >     raise EarlyEnd()
2014-03-07 04:55:02.757468 > p2pool.util.pack.EarlyEnd:

This I am not sure how to deal with.  If there are any python ninjas out there that could point me in the right direction that would be great.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Hyacin on March 07, 2014, 05:40:14 PM
I won't be around much for the weekend so a summary of my efforts so far in case anyone stumbles upon this and wants to have a crack at it or is already working on it -

p2pool/networks.py -

Code:
    grandcoin=math.Object(
        PARENT=networks.nets['grandcoin'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=50, # shares
        SPREAD=40, # blocks
        IDENTIFIER='4665617468657212'.decode('hex'),
        PREFIX='b131010ba6d472a9'.decode('hex'),
        P2P_PORT=12377,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=19327,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-alt',
        VERSION_CHECK=lambda v: True,
    ),

p2pool/bitcoin/networks.py -

Code:
    grandcoin=math.Object(
        P2P_PREFIX='fdc1a5db'.decode('hex'),
        P2P_PORT=12377,
        ADDRESS_VERSION=97,
        RPC_PORT=12378,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'grandcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 1000*100000000 >> (height + 1)//700800,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=45, # s
        SYMBOL='GDC',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Grandcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Grandcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.grandcoin'), 'grandcoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://grandcoin.org/blocks/',
        ADDRESS_EXPLORER_URL_PREFIX='http://grandcoin.org/blocks/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=1e8,
    ),

This alone of course yields LateEnd errors anytime work comes in with transactions due to the extra field (tx comment).


That error points to the unpack function in p2pool/util/pack.py where as already discussed in this thread, we can set ignore_trailing to True.  If we do that in both places it is set to False, p2pool will accept and work on blocks with transactions, but fails when trying to submit the solved block with -

Code:
2014-03-07 02:46:05.893463 >   File "/home/rob/p2pool/p2pool/bitcoin/helper.py", line 76, in submit_block_rpc
2014-03-07 02:46:05.893494 >     result = yield bitcoind.rpc_getblocktemplate(dict(mode='submit', data=bitcoin_data.block_type.pack(block).encode('hex')))
2014-03-07 02:46:05.893526 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks
<snip>
2014-03-07 02:46:05.893771 > p2pool.util.jsonrpc.NarrowError: -1 CDataStream::read() : end of data

I played around in helper.py with the submit function to no avail, so instead I went after the transaction format (realizing full well that this might break coins that do not have a transaction comment, including possibly the merged coins I am working on, but if I can get it working *with* comments, I can then figure out how to make it deal with stuff without comments) -

p2pool/data.py (search for lock_time) -

Code:
        gentx = dict(
            version=1,
            tx_ins=[dict(
                previous_output=None,
                sequence=None,
                script=share_data['coinbase'],
            )],
            tx_outs=[dict(value=amounts[script], script=script) for script in dests if amounts[script] or script == DONATION_SCRIPT] + [dict(
                value=0,
                script='\x6a\x28' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(64).pack(last_txout_nonce),
            )],
            lock_time=0,
            txcomment=0,
        )

p2pool/bitcoin/data.py (search again for lock_time) -

Code:
tx_type = pack.ComposedType([
    ('version', pack.IntType(32)),
    ('tx_ins', pack.ListType(pack.ComposedType([
        ('previous_output', pack.PossiblyNoneType(dict(hash=0, index=2**32 - 1), pack.ComposedType([
            ('hash', pack.IntType(256)),
            ('index', pack.IntType(32)),
        ]))),
        ('script', pack.VarStrType()),
        ('sequence', pack.PossiblyNoneType(2**32 - 1, pack.IntType(32))),
    ]))),
    ('tx_outs', pack.ListType(pack.ComposedType([
        ('value', pack.IntType(64)),
        ('script', pack.VarStrType()),
    ]))),
    ('lock_time', pack.IntType(32)),
    ('txcomment', pack.IntType(256),
])

and this of lead me to the EarlyEnd in my previous post.  I also tried ('txcomment', pack.PossiblyNoneType(2**32 - 1, pack.IntType(256))), which lead to the same.

I did try a varstrtype for txcomment but that lead to some strange errors -

Code:
2014-03-07 04:29:06.554275 > Squelched JSON error:
2014-03-07 04:29:06.554367 > Traceback (most recent call last):
2014-03-07 04:29:06.554453 >   File "/usr/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 464, in dataReceived
2014-03-07 04:29:06.554525 >     self.lineReceived(line)
2014-03-07 04:29:06.554593 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 164, in lineReceived
2014-03-07 04:29:06.554666 >     _handle(line, self, response_handler=self._matcher.got_response).addCallback(lambda line2: self.sendLine(line2) if line2 is not None else None)
2014-03-07 04:29:06.554737 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1213, in unwindGenerator
2014-03-07 04:29:06.554807 >     return _inlineCallbacks(None, gen, Deferred())
2014-03-07 04:29:06.554869 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
2014-03-07 04:29:06.554931 >     result = g.send(result)
2014-03-07 04:29:06.554990 > --- <exception caught here> ---
2014-03-07 04:29:06.555051 >   File "/home/rob/p2pool/p2pool/util/jsonrpc.py", line 85, in _handle
2014-03-07 04:29:06.555112 >     result = yield method_meth(*list(preargs) + list(params))
2014-03-07 04:29:06.555173 >   File "/home/rob/p2pool/p2pool/bitcoin/stratum.py", line 74, in rpc_submit
2014-03-07 04:29:06.555235 >     return got_response(header, worker_name, coinb_nonce)
2014-03-07 04:29:06.555295 >   File "/home/rob/p2pool/p2pool/bitcoin/worker_interface.py", line 136, in <lambda>
2014-03-07 04:29:06.555357 >     lambda header, user, coinbase_nonce: handler(header, user, pack.IntType(self._my_bits).pack(nonce) + coinbase_nonce),
2014-03-07 04:29:06.555420 >   File "/home/rob/p2pool/p2pool/work.py", line 389, in got_response
2014-03-07 04:29:06.555481 >     share = get_share(header, last_txout_nonce)
2014-03-07 04:29:06.555542 >   File "/home/rob/p2pool/p2pool/data.py", line 213, in get_share
2014-03-07 04:29:06.555604 >     hash_link=prefix_to_hash_link(bitcoin_data.tx_type.pack(gentx)[:-32-8-4], cls.gentx_before_refhash),
2014-03-07 04:29:06.555667 >   File "/home/rob/p2pool/p2pool/data.py", line 24, in prefix_to_hash_link
2014-03-07 04:29:06.555726 >     assert prefix.endswith(const_ending), (prefix, const_ending)
2014-03-07 04:29:06.555799 > exceptions.AssertionError: ('\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff8\x03\xec~\x05,\xfa\xbemm\x97y\x13T\xf7\x80\'\xefW\x13^\x1cO[}in"\x13\x0bO(D\xe8\xfd\xdb(\x15R\x1cK|\x04\x00\x00\x00\x00\x00\x00\x00\x06/P2SH/\xff\xff\xff\xff\x03\x00\xe8vH\x17\x00\x00\x00\x19v\xa9\x14\xe5\xbd\xd9\xb6\x7f\n\x80\xdcHD\xb4U\x15Mc\xce.\x8d\xbc\x86\x88\xac\x00\x00\x00\x00\x00\x00\x00\x00CA\x04\xff\xd0=\xe4Jn\x11\xb9\x91\x7f:)\xf9D2\x83\xd9\x87\x1c\x9dt>\xf3\r^\xdd\xcd7\tKd\xd1\xb3\xd8\t\x04\x96\xb52Vxk\xf5\xc8)2\xec#\xc3\xb7M\x9f\x05\xa6\xf9Z\x8bU)5&VfK\xac\x00\x00\x00\x00\x00\x00\x00\x00*j(\xa8', 'CA\x04\xff\xd0=\xe4Jn\x11\xb9\x91\x7f:)\xf9D2\x83\xd9\x87\x1c\x9dt>\xf3\r^\xdd\xcd7\tKd\xd1\xb3\xd8\t\x04\x96\xb52Vxk\xf5\xc8)2\xec#\xc3\xb7M\x9f\x05\xa6\xf9Z\x8bU)5&VfK\xac\x00\x00\x00\x00\x00\x00\x00\x00*j(')

I realize it's a string in the grandcoin code, but I'm guessing and hoping it's converted to something else before it's sent over, if it's not I may be barking up the wrong tree though.  I also tried PossiblyNoneType/VarStrType and got the same AssertionError.

Any help, tips, pointers, code, genie wishes used towards this, online python tutorials, or anything else that could be of use would be GREATLY appreciated!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: IvanGrozniy on March 18, 2014, 03:03:26 AM
Hi,

I am trying to set up p2pool mining for the new crypto money called CrimeaCoin.
I tried connecting miners (CGMiner and SGminer) from my local computer and I am getting these error messages:
1. Locally:
Code:
C:\Program Files\sgminer-4.1.0-windows>sgminer -o http://54.84.97.75:29399 -u CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9 -p 34523523324tertewgdsgsdfgsd -T
[22:31:41] Started sgminer 4.1.0
[22:31:41] Loaded configuration file sgminer.conf
[22:31:42] Probing for an alive pool
[22:31:52] Waiting for work to be available from pools.
[22:32:12] Pool 1 slow/down or URL or credentials invalid
[22:32:12] Pool 0 slow/down or URL or credentials invalid
[22:32:42] No servers were found that could be used to get work from.

[22:32:42] Please check the details from the list below of the servers you have input
[22:32:42] Most likely you have input the wrong URL, forgotten to add a port, or have not set up workers
[22:32:42] Pool: 0  URL: http://54.84.97.75:29399  User: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9  Password: 34523523324tertewgdsgsdfgsd
[22:32:42] Pool: 1  URL: http://54.84.97.75:29399  User: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9  Password: CYSP8gb4T2aGRNyNRPkDVG3HMNctZL7cD9
[22:32:42] No servers could be used! Exiting.
C:\Program Files\sgminer-4.1.0-windows>
2. On the server I am getting the following:
Code:
2014-03-18 02:57:20.294056 Determining payout address...
2014-03-18 02:57:20.294181     Getting payout address from bitcoind...
2014-03-18 02:57:20.297373     ...success! Payout address: CKAfhTtX6CudCANCKVSa8nuVxnhNowAu2d
2014-03-18 02:57:20.322358
2014-03-18 02:57:20.322559 Loading shares...
2014-03-18 02:57:20.322967     ...done loading 0 shares (0 verified)!
2014-03-18 02:57:20.323142
2014-03-18 02:57:20.323331 Initializing work...
2014-03-18 02:57:20.480716     ...success!
2014-03-18 02:57:20.480976
2014-03-18 02:57:20.481190 Joining p2pool network using port 29399...
2014-03-18 02:57:20.483070     ...success!
2014-03-18 02:57:20.486045
2014-03-18 02:57:20.488709 Listening for workers on '' port 29499...
2014-03-18 02:57:20.613184     ...success!
2014-03-18 02:57:20.613422
2014-03-18 02:57:20.613631 Started successfully!
2014-03-18 02:57:20.613830 Go to http://127.0.0.1:29499/ to view graphs and statistics!
2014-03-18 02:57:20.614045 Donating 0.0% of work towards P2Pool's development. Please donate to encourage further development of P2Pool!
2014-03-18 02:57:20.614227
2014-03-18 02:57:21.157642 Peer 0.0.0.0:29399 misbehaving, will drop and ban. Reason: was connected to self
2014-03-18 02:57:21.157994 Bad peer banned: ('0.0.0.0', 29399)
2014-03-18 02:57:21.158759 Peer 127.0.0.1:50571 misbehaving, will drop and ban. Reason: was connected to self
2014-03-18 02:57:21.158971 Bad peer banned: ('127.0.0.1', 50571)
2014-03-18 02:57:23.636639 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:23.636797  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:38.647482 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:38.647646  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:53.656534 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:57:53.656703  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
2014-03-18 02:57:54.953175 Handshake timed out, disconnecting from 108.50.228.148:12901
2014-03-18 02:57:54.953522 Handshake timed out, disconnecting from 108.50.228.148:12900
2014-03-18 02:58:05.056238 Handshake timed out, disconnecting from 108.50.228.148:12902
2014-03-18 02:58:05.056584 Handshake timed out, disconnecting from 108.50.228.148:12903
2014-03-18 02:58:08.680911 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
2014-03-18 02:58:08.681080  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???

I am stuck with this error message "Handshake timed out, disconnecting from". Tried searching on Internet but nothing helpful.
My code is
p2pool/p2pool/networks.py
Code:
    
    crimeacoin=math.Object(
        PARENT=networks.nets['crimeacoin'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='7c45630909c3eb49'.decode('hex'),
        PREFIX='3f6a2b46c49d15ef'.decode('hex'),
        P2P_PORT=29399,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=29499,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#cma',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.9.0.0!' if v < 80501 else None,
    ),
    crimeacoin_testnet=math.Object(
        PARENT=networks.nets['crimeacoin_testnet'],
        SHARE_PERIOD=15, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=3, # blocks
        IDENTIFIER='e037d5b8c6923410'.decode('hex'),
        PREFIX='7208c1a53ef629b0'.decode('hex'),
        P2P_PORT=29699,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=29799,
        BOOTSTRAP_ADDRS=''.split(' '),
        ANNOUNCE_CHANNEL='#cma',
        VERSION_CHECK=lambda v: True,
        VERSION_WARNING=lambda v: 'Upgrade Litecoin to >=0.9.0.0!' if v < 80501 else None,
    ),
p2pool/p2pool/bitcoin/networks.py
Code:
    crimeacoin=math.Object(
        P2P_PREFIX='fbc0b6db'.decode('hex'),
        P2P_PORT=29342,
        ADDRESS_VERSION=28,
        RPC_PORT=29332,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'crimeacoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 125*100000000 >> (height + 1)//5100000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150, # s
        SYMBOL='CMA',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Crimeacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Crimeacoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.crimeacoin'), 'crimeacoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/address/',
        TX_EXPLORER_URL_PREFIX='http://explorer.crimeacoin.org/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=0.03e8,
    ),
    crimeacoin_testnet=math.Object(
        P2P_PREFIX='fcc1b7dc'.decode('hex'),
        P2P_PORT=29343,
        ADDRESS_VERSION=28,
        RPC_PORT=29333,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'crimeacoinaddress' in (yield bitcoind.rpc_help()) and
            (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 125*100000000 >> (height + 1)//5100000,
        POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
        BLOCK_PERIOD=150, # s
        SYMBOL='tCMA',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Crimeacoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Crimeacoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.crimeacoin'), 'crimeacoin.conf'),
        BLOCK_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/block/',
        ADDRESS_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/address/',
        TX_EXPLORER_URL_PREFIX='http://nonexistent-litecoin-testnet-explorer/tx/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256 - 1),
        DUMB_SCRYPT_DIFF=2**16,
        DUST_THRESHOLD=1e8,
    ),

Does anybody know what is wrong? I will appreciate any help. Thanks!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: tagged on March 19, 2014, 12:48:41 AM
Hi all!  I am trying to start a p2pool for GPUCoin, got a lot father that i thought i might on the first night!  self teaching and doing this on a linux vps.

I am getting this error when launching the run_p2pool.py:

Code:
2014-03-18 20:46:28.221623 > --- <exception caught here> ---
2014-03-18 20:46:28.221653 >   File "/root/p2pool-gpuc/p2pool/util/deferral.py", line 41, in f
2014-03-18 20:46:28.221682 >     result = yield func(*args, **kwargs)
2014-03-18 20:46:28.221710 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
2014-03-18 20:46:28.221740 >     result = g.send(result)
2014-03-18 20:46:28.221768 >   File "/root/p2pool-gpuc/p2pool/node.py", line 218, in poll_header
2014-03-18 20:46:28.221797 >     handle_header((yield self.factory.conn.value.get_block_header(self.bitcoind_work.value['previous_block'])))
2014-03-18 20:46:28.221833 >   File "/root/p2pool-gpuc/p2pool/node.py", line 200, in handle_header
2014-03-18 20:46:28.221870 >     if not (self.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(new_header)) <= self.bitcoind_work.value['bits'].target):
2014-03-18 20:46:28.221895 >   File "/root/p2pool-gpuc/p2pool/bitcoin/networks.py", line 243, in <lambda>
2014-03-18 20:46:28.221914 >     POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('vtc_scrypt').getPoWHash(data)),
2014-03-18 20:46:28.221947 > exceptions.ImportError: No module named vtc_scrypt
2014-03-18 20:46:28.321285 > Unhandled error in Deferred:
2014-03-18 20:46:28.321478 > Unhandled Error
2014-03-18 20:46:28.321517 > Traceback (most recent call last):
2014-03-18 20:46:28.321539 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 362, in callback
2014-03-18 20:46:28.321561 >     self._startRunCallbacks(result)
2014-03-18 20:46:28.321581 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
2014-03-18 20:46:28.321601 >     self._runCallbacks()
2014-03-18 20:46:28.321621 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
2014-03-18 20:46:28.321641 >     current.result = callback(current.result, *args, **kw)
2014-03-18 20:46:28.321660 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
2014-03-18 20:46:28.321680 >     _inlineCallbacks(r, g, deferred)
2014-03-18 20:46:28.321698 > --- <exception caught here> ---

Would love to figure out what i am doing wrong. Thanks for the help!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: squiggie on March 19, 2014, 01:05:56 AM
You need to get the vertcoin p2pool code. Sorry I'm on mobile or I would post a link. Google will get you to the proper github fork for scrypt-n p2pool. Also, I'm pretty sure that fork already has settings for gpucoin. Good luck.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: roy7 on March 19, 2014, 02:17:56 PM
You need to get the vertcoin p2pool code. Sorry I'm on mobile or I would post a link. Google will get you to the proper github fork for scrypt-n p2pool. Also, I'm pretty sure that fork already has settings for gpucoin. Good luck.

Yup, here it is

https://github.com/donSchoe/p2pool-n


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: sergey_negodin on March 20, 2014, 06:32:16 AM
hi all i sow an error like my. help me please

i bild maxcoind, wait some tome for update wallet. then start p2pool.

2014-03-20 10:25:23.539717 p2pool (version 13.4-21-g890b935-dirty)
2014-03-20 10:25:23.540108
2014-03-20 10:25:23.540413 Testing bitcoind RPC connection to 'http://127.0.0.1:18108/' with username 'maxuser'...
2014-03-20 10:25:23.582045     ...success!
2014-03-20 10:25:23.582319     Current block hash: 31bfd6fb4d5b33c9db81da6424b78227ee75bf429747de3db154
2014-03-20 10:25:23.582499     Current block height: 118752
2014-03-20 10:25:23.582649
2014-03-20 10:25:23.582840 Testing bitcoind P2P connection to '127.0.0.1:18109'...
2014-03-20 10:25:28.583272     ...taking a while. Common reasons for this include all of bitcoind's connection slots being used...


my maxcoin.conf


server=1
rpcuser=maxuser
rpcpassword=maxpass
rpcport=18108
port=18109
addnode=maxcoin.cloudapp.net
addnode=maxcoinus.cloudapp.net
addnode=maxcoinasia.cloudapp.net
addnode=maxexplorer.cloudapp.net
addnode=144.76.238.140:8668
addnode=148.251.11.196:8668
addnode=162.251.118.42:8668
addnode=187.104.154.105:8668


my p2pool/networks.py
   maxcoin=math.Object(
        PARENT=networks.nets['maxcoin'],
        SHARE_PERIOD=10,
        NEW_SHARE_PERIOD=10, # seconds target spacing
        CHAIN_LENGTH=24*60*60//30,
        REAL_CHAIN_LENGTH=24*60*60//30,
        TARGET_LOOKBEHIND=200,
        SPREAD=15,
        NEW_SPREAD=15, # blocks
        IDENTIFIER='8c75636b79212121'.decode('hex'),
        PREFIX='8a60193ab8b9617f'.decode('hex'),
        P2P_PORT=8560,
        MIN_TARGET=0,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=False,
        WORKER_PORT=9560,
        BOOTSTRAP_ADDRS='us-east1.cryptovein.com'.split(' '),
        ANNOUNCE_CHANNEL='#cryptovein',
        VERSION_CHECK=lambda v: True,
    ),


my p2pool/bitcoin/networks.py

    maxcoin=math.Object(
        P2P_PREFIX='f9bebbd2'.decode('hex'),
        P2P_PORT=8668,
        ADDRESS_VERSION=110,
        RPC_PORT=8108,
        RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
            'maxcoinaddress' in (yield bitcoind.rpc_help()) and
            not (yield bitcoind.rpc_getinfo())['testnet']
        )),
        SUBSIDY_FUNC=lambda height: 96*100000000 >> (height + 1)//1036800,
        POW_FUNC=data.sha3,
        BLOCK_PERIOD=30,
        SYMBOL='MAX',
        CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'],$
        BLOCK_EXPLORER_URL_PREFIX='http://max.cryptoexplore.com/block/',
        TX_EXPLORER_URL_PREFIX='http://max.cryptoexplore.com/tx/',
        ADDRESS_EXPLORER_URL_PREFIX='http://max.cryptoexplore.com/address/',
        SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
        DUMB_SCRYPT_DIFF=1,
        DUST_THRESHOLD=0.001e8,
    ),


i try chenge ports in than conf files but it no result
can you help me? pls. my os is debian.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: AcidSplash on April 02, 2014, 03:35:38 AM
I'm getting this error when trying to start the DigitalCoin P2pool node:
Bitcoin version too old! Upgrade to v0.5 or newer!

Any ideas?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: SpainCoinDev on April 30, 2014, 10:20:53 AM

New: NewYorkCoin p2pool (this coin is going to relaunch soon!):
https://github.com/NewYorkCoin/p2pool-nyc


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Doom4535 on May 11, 2014, 04:19:03 PM
How do you create new sharechain for a coin?  I am trying to make a second chain for execoin (partially to learn how and partially to see if I can make it more friendly toward high intensity settings); however, from what I can tell, it is having issues because I don't have share chain (I am trying to run this inbetween two vm's) for either p2pool to connect to.  The code I am trying to use is:

Code:

execoin2=math.Object(
        PARENT=networks.nets['execoin'],
        SHARE_PERIOD=22, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=55, # blocks
        IDENTIFIER='657865636f696e65'.decode('hex'),
        PREFIX='65657865636f696e'.decode('hex'),
        P2P_PORT=25000,
        MIN_TARGET=4,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=9173,
        BOOTSTRAP_ADDRS='216.249.119.195'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-exe2',
        VERSION_CHECK=lambda v: True,
    ),


What are your thoughts?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on May 12, 2014, 08:54:24 AM
How do you create new sharechain for a coin?

Change IDENTIFIER & PREFIX and delete the data directory. Although not necessary consider changing the P2P_PORT as well. Change persist to false(?).


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: ads2003uk on May 12, 2014, 01:13:40 PM
I followed a guide on here to mine solo with an S1, it works perfect for BTC but when trying to mine another sha coin (frc) it returns the following:

"Couldn't link returned work's merkle root with its handler. This should only happen if this process was recently restarted!"

what would cause it?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Doom4535 on May 13, 2014, 02:14:14 AM
How do you create new sharechain for a coin?

Change IDENTIFIER & PREFIX and delete the data directory. Although not necessary consider changing the P2P_PORT as well. Change persist to false(?).

Ok, I've changed the identifier to IDENTIFIER='657865636fe89f61'.decode('hex'), PREFIX='656578656398ed71'.decode('hex'), I've already changed the p2pool port (default is 9986).  I would like to have the share chain persist if possible.  Does it matter if I use a different announce channel or would it be beneficial if I used the default announce channel (#p2pool-exe)?  I also removed my execoin2 data directory, I am still getting code like this when I point a miner at one of the pools (if no miners are on the pool it looks fine, except that is doesn't display an entry for pool stats or shares)...

Quote
P2Pool: 0 shares in chain (0 verified/0 total) Peers: 1 (0 incoming)
2014-05-12 21:04:28.303093  Local: 0H/s in last 0.0 seconds Local dead on arrival: ??? Expected time to share: ???
> Unhandled Error
> Traceback (most recent call last):
>   File "/opt/zen2pool2/zen2pool/p2pool/main.py", line 578, in run
>     reactor.run()
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
>     self.mainLoop()
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1178, in mainLoop
>     self.runUntilCurrent()
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 800, in runUntilCurrent
>     call.func(*call.args, **call.kw)
> --- <exception caught here> ---
>   File "/opt/zen2pool2/zen2pool/p2pool/bitcoin/stratum.py", line 38, in _send_work
>     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
>   File "/opt/zen2pool2/zen2pool/p2pool/bitcoin/worker_interface.py", line 129, in get_work
>     x, handler = self._inner.get_work(*args)
>   File "/opt/zen2pool2/zen2pool/p2pool/work.py", line 207, in get_work
>     raise jsonrpc.Error_for_code(-12345)(u'p2pool is downloading shares')
> p2pool.util.jsonrpc.NarrowError: -12345 p2pool is downloading shares
> Error while calling merged getauxblock on http://127.0.0.1:26888/:
> Traceback (most recent call last):
> Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

edit: well it used ?.?.? without periods instead of ???



Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Doom4535 on May 14, 2014, 01:47:03 AM
@CartmanSPC and everybody else

I am happy to say I got the exechain to work.  I am not yet 100% sure why it wasn't working before, but am planning to dig into it.  I was first using the zen2pool version of p2pool and am now using donSchoe's version of it.  I started the chain on a fresh vm and then connected to it with my other systems and it worked without a hitch (first vm started with persistant set to false and then added the others with true (not sure if this matters, but that is what I did)).

The code I used

Code:
execoin2=math.Object(
        PARENT=networks.nets['execoin'],
        SHARE_PERIOD=22, # seconds
        CHAIN_LENGTH=24*60*60//10, # shares
        REAL_CHAIN_LENGTH=24*60*60//10, # shares
        TARGET_LOOKBEHIND=200, # shares
        SPREAD=55, # blocks
        IDENTIFIER='657865636fe89f61'.decode('hex'),
        PREFIX='656578656398ed71'.decode('hex'),
        P2P_PORT=25000,
        MIN_TARGET=4,
        MAX_TARGET=2**256//2**20 - 1,
        PERSIST=True,
        WORKER_PORT=9173,
        BOOTSTRAP_ADDRS='216.249.119.195 216.249.119.194 216.249.119.112'.split(' '),
        ANNOUNCE_CHANNEL='#p2pool-exe2',
        VERSION_CHECK=lambda v: True,
    ),

I will report back later on how the results fair after I've had some more time to test it.  Your welcome to test it for your selves to see if the longer block time works better for your gpu's.  You can connect to any of my nodes (current bootstrap_addrs's) or make your own.

CartmanSPC, do you have an EXE address?

*edit: grammer


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on May 14, 2014, 03:18:27 AM
Thanks Doom4535. No need to send me anything...happy to help.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: ads2003uk on May 14, 2014, 06:16:47 AM
I followed a guide on here to mine solo with an S1, it works perfect for BTC but when trying to mine another sha coin (frc) it returns the following:

"Couldn't link returned work's merkle root with its handler. This should only happen if this process was recently restarted!"

what would cause it?

Anyone?


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: zhongfangcai on May 25, 2014, 04:47:52 PM
2014-05-25 14:57:11.421000 p2pool (version unknown 7032706f6f6c26d6173742)
2014-05-25 14:57:11.421000
2014-05-25 14:57:11.421000 Testing bitcoind RPC connection to 'http://127.0.0.1:
9555/' with username 'abc'...
2014-05-25 14:57:11.500000     ...success!
2014-05-25 14:57:11.500000     Current block hash: 21ef191b72def9e327ab89
04f3b08d955eec3e3d77a9f4693bd6
2014-05-25 14:57:11.500000     Current block height: 0
2014-05-25 14:57:11.500000
2014-05-25 14:57:11.500000 Testing bitcoind P2P connection to '127.0.0.1:19999'.
..
2014-05-25 14:57:16.515000     ...taking a while. Common reasons for this includ
e all of bitcoind's connection slots being used...
The above,I installing p2pool to a new coin, encounter this problem.How to set the parameters in networks.py.

Help me to see what is wrong.Thank you for help me.


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: infernoman on July 01, 2014, 09:56:34 PM
hey cartmanspc or anyone else who may be able to help. there is a 200k fuelcoin bounty out to help with the p2pool for fuel. i currently have the sharechain bootsrapped and am the only node for p2pool. so i would like to get everything working properly before more people start hopping on.
https://bitcointalk.org/index.php?topic=673469.new#new


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Cassey on July 15, 2014, 06:14:46 PM
Hi all...

I'm the dev for 1Credit and YACCoin.  Started fooling around with hosting p2pools for each last night and it was pretty straight forward.  Thought everything was fine when I left at 3am - pools were hashing, 99.5% credits were being paid out (0.5% to the author), etc.

Looking at the web interface, I would see a single user - me, which was as I expected.

Per my coin log, around 7am this morning, while I was soundly asleep, something changed.  Instead of receiving 99.5% of the coins, I started ONLY receiving the 0.5% associated with discovering a block. The rest was going to a valid, but totally unknown, coin address.  I checked the /users webpage and for this:

http://puu.sh/acBhT/aed46ecb76.png
 (http://puu.sh/acBhT/aed46ecb76.png)

Those all appear to be valid YACCoin addresses, although I don't see any of them hashing in the p2pool log.  I have also not publicly advertised the pool (until now) nor the connection port, so am surprised by this.

Any thoughts?

FYI:  ADDRESS_VERSION is set to 31, which is correct for my coin, and matches the leading digit in those in the link above.

Possibly related:  I failed to find definitions for IDENTIFER and PREFIX and left those the same as in the litecoin.py?  Should I have randomized those to avoid coin conflicts?

Unrelated:  Can someone tell me what PERSIST does?  I had to set it to False to get things hashing...

Thanks in advance!

Cassey


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: CartmanSPC on July 16, 2014, 11:24:09 PM
Cassey,

Couple recommendations. Set the author donation to 0 as the payout address is most likely not valid. Make sure you have a unique IDENTIFER and PREFIX. If you like I can generate some for you but directions on how to do it are in the p2pool settings post I made somewhere on this board. Do not leave them the same or you may end up working on a different chain...

Edit: Found the post https://bitcointalk.org/index.php?topic=457574.0


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: Cassey on July 17, 2014, 03:14:46 AM
Wow!  That sure would have saved me a few hours.  Looks like I still have a bit of cleanup to do.

Thanks!!!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: scratchy on October 18, 2014, 06:43:53 PM
Please help me out if you can : https://bitcointalk.org/index.php?topic=457574.msg9247565#msg9247565

Thank you !


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: mannyg on October 26, 2014, 05:48:51 PM
I've managed to create network.py settings for OSC and TAK, but both give me errors relating to the SUBSIDY_FUNC.

This is what i get with both, cant find any answers to it:

Code:
2014-10-26 13:46:12.367000 > Unhandled Error
2014-10-26 13:46:12.373000 > Traceback (most recent call last):
2014-10-26 13:46:12.380000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\main.py", line 595, in run
2014-10-26 13:46:12.387000 >     reactor.run()
2014-10-26 13:46:12.404000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1192, in run
2014-10-26 13:46:12.413000 >     self.mainLoop()
2014-10-26 13:46:12.423000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1201, in mainLoop
2014-10-26 13:46:12.430000 >     self.runUntilCurrent()
2014-10-26 13:46:12.436000 >   File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 824, in runUntilCurrent
2014-10-26 13:46:12.464000 >     call.func(*call.args, **call.kw)
2014-10-26 13:46:12.470000 > --- <exception caught here> ---
2014-10-26 13:46:12.478000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\bitcoin\stratum.py", line 38, in _send_work
2014-10-26 13:46:12.486000 >     x, got_response = self.wb.get_work(*self.wb.preprocess_request('' if self.username is None else self.username))
2014-10-26 13:46:12.493000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\bitcoin\worker_interface.py", line 129, in get_work
2014-10-26 13:46:12.501000 >     x, handler = self._inner.get_work(*args)
2014-10-26 13:46:12.514000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\work.py", line 310, in get_work
2014-10-26 13:46:12.561000 >     base_subsidy=self.node.net.PARENT.SUBSIDY_FUNC(self.current_work.value['height']),
2014-10-26 13:46:12.567000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\data.py", line 222, in generate_transaction
2014-10-26 13:46:12.575000 >     script='\x6a\x28' + cls.get_ref_hash(net, share_info, ref_merkle_link) + pack.IntType(64).pack(last_txout_nonce),
2014-10-26 13:46:12.584000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\data.py", line 246, in get_ref_hash
2014-10-26 13:46:12.591000 >     share_info=share_info,
2014-10-26 13:46:12.601000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\util\pack.py", line 74, in pack
2014-10-26 13:46:12.608000 >     data = self._pack(obj)
2014-10-26 13:46:12.615000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\util\pack.py", line 52, in _pack
2014-10-26 13:46:12.691000 >     f = self.write(None, obj)
2014-10-26 13:46:12.700000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\util\pack.py", line 301, in write
2014-10-26 13:46:12.707000 >     file = type_.write(file, item[key])
2014-10-26 13:46:12.712000 >   File "C:\Users\Manny\Downloads\p2pool-rav-master\p2pool\util\pack.py", line 327, in write
2014-10-26 13:46:12.718000 >     raise ValueError('incorrect length item!')
2014-10-26 13:46:12.728000 > exceptions.ValueError: incorrect length item!


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: lahlor on June 21, 2015, 08:50:30 PM
Hi all,

just downloaded the current p2pool from git.
Cannot find any networks.py and it seems that something changed at all.
Do you have a new manual/how-to add new altcoins?

Cheers


Title: Re: Finding p2pool networks.py values for new altcoins
Post by: lahlor on June 22, 2015, 12:57:42 PM
Hi all,

just downloaded the current p2pool from git.
Cannot find any networks.py and it seems that something changed at all.
Do you have a new manual/how-to add new altcoins?

Cheers

Hi,

got an Error after running ./run_p2pool.py
Any ideas?

Traceback (most recent call last):
File "run_p2pool.py", line 3, in
from p2pool import main
File "/root/p2pool/p2pool/main.py", line 25, in
from . import networks, web, work
File "/root/p2pool/p2pool/networks/init.py", line 4, in
for module_loader, name, ispkg in pkgutil.iter_modules(path))
File "/root/p2pool/p2pool/networks/init.py", line 4, in
for module_loader, name, ispkg in pkgutil.iter_modules(path))
File "/root/p2pool/p2pool/networks/bitcoin.py", line 1, in
from p2pool.bitcoin import networks
File "/root/p2pool/p2pool/bitcoin/networks/init.py", line 4, in
for module_loader, name, ispkg in pkgutil.iter_modules(path))
File "/root/p2pool/p2pool/bitcoin/networks/init.py", line 4, in
for module_loader, name, ispkg in pkgutil.iter_modules(path))
File "/root/p2pool/p2pool/bitcoin/networks/magicoin.py", line 1, in
from p2pool.bitcoin import networks
ImportError: cannot import name networks

my two files are
import os
import platform

from twisted.internet import defer

from .. import data, helper
from p2pool.util import pack

P2P_PREFIX = ' f0b9b3d6 '.decode('hex')
P2P_PORT = 8233
ADDRESS_VERSION = 20
RPC_PORT = 8232
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'magicoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
))
SUBSIDY_FUNC = lambda height: 100100000000 >> (height + 1)//1051200
POW_FUNC = data.hash256
BLOCK_PERIOD = 1800 # s
SYMBOL = 'XMG'
CONF_FILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Magi') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Magi/') if platform.system() == 'Darwin' else os.path.expanduser('~/.magi'), 'magi.conf')
BLOCK_EXPLORER_URL_PREFIX = 'http://explorer.dot-bit.org/b/'
ADDRESS_EXPLORER_URL_PREFIX = 'http://explorer.dot-bit.org/a/'
TX_EXPLORER_URL_PREFIX = 'http://explorer.dot-bit.org/tx/'
SANE_TARGET_RANGE = (2256//232 - 1, 2256//2*32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 0.2e8

from p2pool.bitcoin import networks

PARENT = networks.nets['magicoin']
SHARE_PERIOD = 45 # seconds
CHAIN_LENGTH = 246060//30 # shares
REAL_CHAIN_LENGTH = 246060//30 # shares
TARGET_LOOKBEHIND = 200 # shares
SPREAD = 10 # blocks
IDENTIFIER = ''.decode('hex')
PREFIX = ''.decode('hex')
P2P_PORT = 8233
MIN_TARGET = 0
MAX_TARGET = 2256//232 - 1
PERSIST = True
WORKER_PORT = 9322
BOOTSTRAP_ADDRS = ''.split(' ')
ANNOUNCE_CHANNEL = '#p2pool-alt'
VERSION_CHECK = lambda v: 80002 <= v
VERSION_WARNING = lambda v: 'Upgrade Terracoin to >= 0.8.0.4!' if v < 80004 else None