chaeplin
Well-known member
p2pool need hard fork.
As pchMessage switched, p2pool-drk need to change P2P_PREFIX of bitcoin/networks.py at 1400094580; //Wed, 14 May 2014 19:09:40 GMT.
https://github.com/darkcoinproject/darkcoin/blob/master/src/protocol.cpp#L16-L35
p2pool changes.
https://github.com/chaeplin/p2pool-drk/commit/3ffb8c55da6702cc0522f4d925ce13c03a7f45fe
https://github.com/chaeplin/p2pool-drk/commit/c27ef50ad6c2f68d224e92fd1077082269629115
EDIT)
How to update.
(sad, Masternode payment is not patched yet)
As pchMessage switched, p2pool-drk need to change P2P_PREFIX of bitcoin/networks.py at 1400094580; //Wed, 14 May 2014 19:09:40 GMT.
https://github.com/darkcoinproject/darkcoin/blob/master/src/protocol.cpp#L16-L35
Code:
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ascii, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
// Public testnet message start
static unsigned char pchMessageStartTestOld[4] = { 0xfc, 0xc1, 0xb7, 0xdc };
static unsigned char pchMessageStartTestNew[4] = { 0xce, 0xe2, 0xca, 0xff };
static unsigned int nMessageStartTestSwitchTime = 1398869551+(60*5);
// Darkcoin message start (switch from Litecoin's)
static unsigned char pchMessageStartLitecoin[4] = { 0xfb, 0xc0, 0xb6, 0xdb };
static unsigned char pchMessageStartDarkcoin[4] = { 0xbf, 0x0c, 0x6b, 0xbd };
static unsigned int nMessageStartSwitchTime = 1400094580; //Wed, 14 May 2014 19:09:40 GMT
void GetMessageStart(unsigned char pchMessageStart[], bool fPersistent)
{
if (fTestNet)
memcpy(pchMessageStart, (fPersistent || GetAdjustedTime() > nMessageStartTestSwitchTime)? pchMessageStartTestNew : pchMessageStartTestOld, sizeof(pchMessageStartTestNew));
else
memcpy(pchMessageStart, (fPersistent || GetAdjustedTime() > nMessageStartSwitchTime)? pchMessageStartDarkcoin : pchMessageStartLitecoin, sizeof(pchMessageStartDarkcoin));
}
p2pool changes.
https://github.com/chaeplin/p2pool-drk/commit/3ffb8c55da6702cc0522f4d925ce13c03a7f45fe
https://github.com/chaeplin/p2pool-drk/commit/c27ef50ad6c2f68d224e92fd1077082269629115
Code:
https://github.com/chaeplin/p2pool-drk/blob/master/p2pool/bitcoin/networks.py#L23
from
P2P_PREFIX='fbc0b6db'.decode('hex'),
to
P2P_PREFIX='bf0c6bbd'.decode('hex'),
https://github.com/chaeplin/p2pool-drk/blob/master/p2pool/bitcoin/networks.py#L46
from
P2P_PREFIX='fcc1b7dc'.decode('hex'),
to
P2P_PREFIX='cee2caff'.decode('hex'),
and
https://github.com/chaeplin/p2pool-drk/blob/master/p2pool/networks.py
from
IDENTIFIER='496247d46a00c115'.decode('hex'),
PREFIX='5685a273806675db'.decode('hex'),
to
IDENTIFIER='492672d64a12c515'.decode('hex'),
PREFIX='4574a162705565bd'.decode('hex'),
EDIT)
How to update.
Code:
1) upgrade darkcoind before 1400094580; //Wed, 14 May 2014 19:09:40 GMT
(compile, restart darkcoind)
Code:
2) update p2pool-drk, do not restart
git pull https://github.com/chaeplin/p2pool-drk
- changes : p2pool/network.py, p2pool/bitcoin/network.py
- do not restart p2pool-drk, after git pull, before 1400094580; //Wed, 14 May 2014 19:09:40 GMT
- if you need to restart p2pool-drk, you should modify p2pool/network.py, p2pool/bitcoin/network.py
Code:
3) do restart p2pool-drk after 1400094580; //Wed, 14 May 2014 19:09:40 GMT
choose a or b.
(a) manual restart
- stop p2pool-drk
- remove data/darkcoin ( rm -rf data/darkcoin )
- run p2pool-drk
(b) auto restart using cron / use at your own risk
- download https://gist.githubusercontent.com/chaeplin/e6157be59d5f9a94d580/raw/159d9b9bb327989e244bafae10da8fe772899992/p2pool_hardfork.py
- rename to p2pool_hardfork.py, chmod 755 p2pool_hardfork.py
- edit p2pool_hardfork.py: p2pool_directory, p2pool_pid, p2pool_runcmd
- add to cron(use p2pool owner account) : */1 * * * * /pathto_scripts/p2pool_hardfork.py
* if you need to restart p2pool-drk, first you should modify p2pool/network.py, p2pool/bitcoin/network.py, then restart.
after restart, modify p2pool_pid of p2pool_hardfork.py.
(sad, Masternode payment is not patched yet)
Last edited by a moderator: