Skip to content

Commit

Permalink
Merge pull request #112 from duality-solutions/genesis
Browse files Browse the repository at this point in the history
Genesis & Seeds
  • Loading branch information
spencerlievens committed Dec 18, 2017
2 parents daf2864 + e219418 commit 01356fa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
47 changes: 23 additions & 24 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void MineGenesis(CBlockHeader& genesisBlock, const uint256& powLimit, boo
*/
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "Sunday 10th Dec 2017: Phase 2 Testing";
const char* pszTimestamp = "NY Times Monday 18th Dec 2017: Google Thinks I’m Dead";
const CScript genesisOutputScript = CScript() << ParseHex("") << OP_CHECKSIG;
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
Expand All @@ -112,9 +112,9 @@ class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nRewardsStart = 10; // PoW Rewards begin on block 5137 // TODO: (Amir) Change back to 5137
consensus.nDynodePaymentsStartBlock = 10; // Dynode Payments begin on block 10273
consensus.nMinCountDynodesPaymentStart = 1; // Dynode Payments begin once 500 Dynodes exist or more.
consensus.nRewardsStart = 5137; // PoW Rewards begin on block 5137
consensus.nDynodePaymentsStartBlock = 10273; // Dynode Payments begin on block 10273
consensus.nMinCountDynodesPaymentStart = 500; // Dynode Payments begin once 500 Dynodes exist or more.
consensus.nInstantSendKeepLock = 24;
consensus.nBudgetPaymentsStartBlock = 2055; // actual historical value
consensus.nBudgetPaymentsCycleBlocks = 20545; //Blocks per month
Expand All @@ -129,7 +129,6 @@ class CMainParams : public CChainParams {
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");

consensus.nPowTargetTimespan = 30 * 64; // Dynamic: 1920 seconds
consensus.nPowTargetSpacing = DEFAULT_AVERAGE_POW_BLOCK_TIME;
consensus.nUpdateDiffAlgoHeight = 10; // Dynamic: Algorithm fork block
Expand All @@ -147,8 +146,8 @@ class CMainParams : public CChainParams {

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1512900600; // Dec 10th 2017 10:10:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1544443200; // Dec 10th 2018 12:00:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1513591800; // Dec 18th 2017 10:10:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1545134400; // Dec 18th 2018 12:00:00

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand All @@ -166,14 +165,14 @@ class CMainParams : public CChainParams {
nPruneAfterHeight = 20545;
startNewChain = false;

genesis = CreateGenesisBlock(1512927456, 189357, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
genesis = CreateGenesisBlock(1513619300, 626614, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
if(startNewChain == true) { MineGenesis(genesis, consensus.powLimit, true); }

consensus.hashGenesisBlock = genesis.GetHash();

if(!startNewChain) {
assert(consensus.hashGenesisBlock == uint256S("0x0000047d98c8a65e6f558d1f6d38416fc844f6954ac6ffbd064ee73d34efb8b4"));
assert(genesis.hashMerkleRoot == uint256S("0x3e924e261a371e799520120a67c24209fa087c78506f046ef61f1527b08d451b"));
assert(consensus.hashGenesisBlock == uint256S("0x00000e140b0c3028f898431890e9dea79ae6ca537ac9362c65b45325db712de2"));
assert(genesis.hashMerkleRoot == uint256S("0xfa0e753db5a853ebbc52594eb62fa8219155547b426fba8789fa96dbf07e6ed5"));
}

vSeeds.push_back(CDNSSeedData("dnsseeder.io", "dyn2.dnsseeder.io"));
Expand Down Expand Up @@ -208,8 +207,8 @@ class CMainParams : public CChainParams {

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x0000047d98c8a65e6f558d1f6d38416fc844f6954ac6ffbd064ee73d34efb8b4")),
1512927456, // * UNIX timestamp of last checkpoint block
( 0, uint256S("0x00000e140b0c3028f898431890e9dea79ae6ca537ac9362c65b45325db712de2")),
1513619300, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
2000 // * estimated number of transactions per day after checkpoint
Expand Down Expand Up @@ -260,8 +259,8 @@ class CTestNetParams : public CChainParams {

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1512900600; // Dec 10th 2017 10:10:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1544443200; // Dec 10th 2018 12:00:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1513591800; // Dec 18th 2017 10:10:00
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1545134400; // Dec 18th 2018 12:00:00

pchMessageStart[0] = 0x2f;
pchMessageStart[1] = 0x32;
Expand All @@ -274,16 +273,16 @@ class CTestNetParams : public CChainParams {
nPruneAfterHeight = 100;
startNewChain = false;

genesis = CreateGenesisBlock(0, 0, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
genesis = CreateGenesisBlock(1513619864, 43629, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
if(startNewChain == true) {
MineGenesis(genesis, consensus.powLimit, true);
}

consensus.hashGenesisBlock = genesis.GetHash();

if(!startNewChain) {
//assert(consensus.hashGenesisBlock == uint256S("0x"));
//assert(genesis.hashMerkleRoot == uint256S("0x"));
assert(consensus.hashGenesisBlock == uint256S("0x0000f2b9ae3231d031e6f5c1e3a5dc1eb936c9ffc61f36c52946ac10f4cf7dae"));
assert(genesis.hashMerkleRoot == uint256S("0xfa0e753db5a853ebbc52594eb62fa8219155547b426fba8789fa96dbf07e6ed5"));
}
vFixedSeeds.clear();
vSeeds.clear();
Expand Down Expand Up @@ -317,8 +316,8 @@ class CTestNetParams : public CChainParams {

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x")),
0, // * UNIX timestamp of last checkpoint block
( 0, uint256S("0x0000f2b9ae3231d031e6f5c1e3a5dc1eb936c9ffc61f36c52946ac10f4cf7dae")),
1513619864, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
1000 // * estimated number of transactions per day after checkpoint
Expand Down Expand Up @@ -381,16 +380,16 @@ class CRegTestParams : public CChainParams {
nPruneAfterHeight = 100;
startNewChain = false;

genesis = CreateGenesisBlock(0, 0, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
genesis = CreateGenesisBlock(1513619951, 1754, UintToArith256(consensus.powLimit).GetCompact(), 1, (1 * COIN));
if(startNewChain == true) {
MineGenesis(genesis, consensus.powLimit, true);
}

consensus.hashGenesisBlock = genesis.GetHash();

if(!startNewChain) {
//assert(consensus.hashGenesisBlock == uint256S("0x"));
//assert(genesis.hashMerkleRoot == uint256S("0x"));
assert(consensus.hashGenesisBlock == uint256S("0x000ab751d858e116043e741d097311f2382e600c219483cfda8f25c7f369cc2c"));
assert(genesis.hashMerkleRoot == uint256S("0xfa0e753db5a853ebbc52594eb62fa8219155547b426fba8789fa96dbf07e6ed5"));
}

vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
Expand All @@ -407,8 +406,8 @@ class CRegTestParams : public CChainParams {

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x")),
0, // * UNIX timestamp of last checkpoint block
( 0, uint256S("0x000ab751d858e116043e741d097311f2382e600c219483cfda8f25c7f369cc2c")),
1513619951, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
500 // * estimated number of transactions per day after checkpoint
Expand Down
6 changes: 6 additions & 0 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

// Dynamic Seeds
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xef,0x26}, 33300},
{{0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4d,0x56,0xf2}, 33300},
{{0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4d,0x45,0xef}, 33300},
{{0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x20,0x5f,0xcc}, 33300},
{{0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0x4c,0x47}, 33300},
{{0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3d,0xd8,0xd6}, 33300}
};

static SeedSpec6 pnSeed6_test[] = {
Expand Down

0 comments on commit 01356fa

Please sign in to comment.