Bitcoin Forum
November 01, 2024, 02:13:43 AM *
News: Bitcoin Pumpkin Carving Contest
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 9 10 »  All
  Print  
Author Topic: Finding p2pool networks.py values for new altcoins  (Read 38078 times)
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 23, 2013, 09:06:31 PM
 #1

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!

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
Kyune
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250


View Profile
May 23, 2013, 09:31:38 PM
 #2

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. 

BTC:  1K4VpdQXQhgmTmq68rbWhybvoRcyNHKyVP
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 23, 2013, 09:38:36 PM
 #3

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?

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
Kyune
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250


View Profile
May 23, 2013, 09:56:07 PM
 #4

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.





BTC:  1K4VpdQXQhgmTmq68rbWhybvoRcyNHKyVP
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 23, 2013, 10:04:44 PM
 #5

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

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 12:26:37 AM
 #6

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
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 09:13:35 AM
 #7

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'Huh
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 24, 2013, 09:43:14 AM
 #8

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?

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 10:00:13 AM
 #9

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...  Angry
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 24, 2013, 10:45:11 AM
 #10

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?

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 10:55:54 AM
 #11

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"
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 11:19:55 AM
 #12

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
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 11:29:08 AM
 #13

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?
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 24, 2013, 11:39:34 AM
 #14

maybe try to lower SHARE_PERIOD=90, # seconds to 30?

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 11:52:19 AM
 #15

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
schnebi
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
May 24, 2013, 12:20:06 PM
 #16

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...
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 24, 2013, 06:24:38 PM
Last edit: May 26, 2013, 03:10:04 PM by spoid
 #17

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

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

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 25, 2013, 12:35:49 AM
 #18

bump. Sad of despair.

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
Kyune
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250


View Profile
May 25, 2013, 01:11:47 AM
 #19

bump. Sad 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.   Wink

BTC:  1K4VpdQXQhgmTmq68rbWhybvoRcyNHKyVP
spoid (OP)
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


bearded, drunk, fat, naked


View Profile
May 26, 2013, 04:33:34 PM
 #20

I think that was it for now! Testing pool now... but with my solo hash power I will never really know if it works Cheesy

with great beard comes great liver. Reputation Thread: https://bitcointalk.org/index.php?topic=195803.0
Pages: [1] 2 3 4 5 6 7 8 9 10 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!