cd src
sudo gedit chainparams.cpp
|
static Checkpoints::MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 11111, uint256("0x00223155*****"));
|
( 0, uint256("0x001"));
|
1397080064, // * UNIX timestamp of last checkpoint block
36544669, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
60000.0 // * estimated number of transactions per day after checkpoint
|
date +%s
|
openssl ecparam -genkey -name secp256k1 -out alertkey.pem
openssl ec -in alertkey.pem -text > alertkey.hex
openssl ecparam -genkey -name secp256k1 -out testnetalert.pem
openssl ec -in testnetalert.pem -text > testnetalert.hex
openssl ecparam -genkey -name secp256k1 -out genesiscoinbase.pem
openssl ec -in genesiscoinbase.pem -text > genesiscoinbase.hex
|
const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
|
txNew.vout[0].scriptPubKey = CScript() << ParseHex("...") << OP_CHECKSIG;
|
assert(hashGenesisBlock == uint256("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"));
assert(genesis.hashMerkleRoot == uint256("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
|
sudo gedit main.cpp
|
CBlock &block = const_cast |
// Start new block file
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
|
uint256 bnTarget;
bool fNegative;
bool fOverflow;
uint256 hashGenesisBlock;
block.nBits = 0x1f00ffff;
bnTarget.SetCompact(block.nBits, &fNegative, &fOverflow);
LogPrintf("ProofOfWorkLimit %s\n", Params().ProofOfWorkLimit().ToString());
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > Params().ProofOfWorkLimit()) {
error("InitBlockIndex CheckProofOfWork() : nBits below minimum work");
}else {
block.nTime = GetTime();//1231006505;
LogPrintf("block.nTime %d\n", block.nTime);
LogPrintf("bnTarget %s\n", bnTarget.ToString());
block.nNonce = 0;
while (true) {
if (block.nNonce%1000000000 == 0)
LogPrintf("block.nNonce--- %d\n", block.nNonce);
hashGenesisBlock = block.GetHash();
if (hashGenesisBlock <= bnTarget)
break;
block.nNonce++;
}
LogPrintf("block.nNonce******** %d\n", block.nNonce);
LogPrintf("hashGenesisBlock******** %s\n", hashGenesisBlock.ToString());
LogPrintf("hashMerkleRoot******** %s\n", block.hashMerkleRoot.ToString());
}
|
cd ..
make
|
tail ~/.bitcoin/debug.log
|
2016-04-11 21:16:20 ProofOfWorkLimit 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
2016-04-11 21:16:20 block.nTime 1460410772
2016-04-11 21:16:20 bnTarget 0000ffff00000000000000000000000000000000000000000000000000000000
2016-04-11 21:16:20 block.nNonce--- 0
2016-04-11 21:16:20 block.nNonce******** 43973
2016-04-11 21:16:20 hashGenesisBlock******** 0000f51a735d0f7da96f10797ad76e00e53614422987f2b6056aaf61857e165e
2016-04-11 21:16:20 hashMerkleRoot******** d5c218da6f5c257709c0d59177ae4527ea5049f15baf26260a071c2e212154ac
2016-04-11 21:16:20 Pre-allocating up to position 0x1000000 in blk00000.dat
2016-04-11 21:16:20 Pre-allocating up to position 0x100000 in rev00000.dat
|
hashGenesisBlock = genesis.GetHash();
|
genesis
.
nTime
=
1460410772;
genesis
.
nBits
=
0x1f00ffff
;
genesis
.
nNonce
=
43973;
hashGenesisBlock
=
genesis
.
GetHash
();
assert
(
hashGenesisBlock
==
uint256
(
"
0000f51a735d0f7da96f10797ad76e00e53614422987f2b6056aaf61857e165e
"
));
assert
(
genesis
.
hashMerkleRoot
==
uint256
(
"
d5c218da6f5c257709c0d59177ae4527ea5049f15baf26260a071c2e212154ac
"
));
|
cd ..
sudo make
rm -rf ~/.newcoin
|