MCPcopy Create free account
hub / github.com/ElementsProject/elements / SigNetParams

Method SigNetParams

src/chainparams.cpp:451–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449class SigNetParams : public CChainParams {
450public:
451 explicit SigNetParams(const ArgsManager& args) {
452 std::vector<uint8_t> bin;
453 vSeeds.clear();
454
455 if (!args.IsArgSet("-signetchallenge")) {
456 bin = ParseHex("512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae");
457 vSeeds.emplace_back("seed.signet.bitcoin.sprovoost.nl.");
458
459 // Hardcoded nodes can be removed once there are more DNS seeds
460 vSeeds.emplace_back("178.128.221.177");
461 vSeeds.emplace_back("v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333");
462
463 consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000de26b0e471");
464 consensus.defaultAssumeValid = uint256S("0x00000112852484b5fe3451572368f93cfd2723279af3464e478aee35115256ef"); // 78788
465 m_assumed_blockchain_size = 1;
466 m_assumed_chain_state_size = 0;
467 chainTxData = ChainTxData{
468 // Data from RPC: getchaintxstats 4096 0000003d9144c56ac110ae04a0c271a0acce2f14f426b39fdf0d938c96d2eb09
469 /* nTime */ 1645631279,
470 /* nTxCount */ 1257429,
471 /* dTxRate */ 0.1389638742514995,
472 };
473 } else {
474 const auto signet_challenge = args.GetArgs("-signetchallenge");
475 if (signet_challenge.size() != 1) {
476 throw std::runtime_error(strprintf("%s: -signetchallenge cannot be multiple values.", __func__));
477 }
478 bin = ParseHex(signet_challenge[0]);
479
480 consensus.nMinimumChainWork = uint256{};
481 consensus.defaultAssumeValid = uint256{};
482 m_assumed_blockchain_size = 0;
483 m_assumed_chain_state_size = 0;
484 chainTxData = ChainTxData{
485 0,
486 0,
487 0,
488 };
489 LogPrintf("Signet with challenge %s\n", signet_challenge[0]);
490 }
491
492 if (args.IsArgSet("-signetseednode")) {
493 vSeeds = args.GetArgs("-signetseednode");
494 }
495
496 strNetworkID = CBaseChainParams::SIGNET;
497 consensus.signet_blocks = true;
498 consensus.signet_challenge.assign(bin.begin(), bin.end());
499 consensus.nSubsidyHalvingInterval = 210000;
500 consensus.BIP16Exception = uint256{};
501 consensus.BIP34Height = 1;
502 consensus.BIP34Hash = uint256{};
503 consensus.BIP65Height = 1;
504 consensus.BIP66Height = 1;
505 consensus.CSVHeight = 1;
506 consensus.SegwitHeight = 1;
507 consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
508 consensus.nPowTargetSpacing = 10 * 60;

Callers

nothing calls this directly

Calls 13

ParseHexFunction · 0.85
uint256SFunction · 0.85
CAssetClass · 0.85
CreateGenesisBlockFunction · 0.85
IsArgSetMethod · 0.80
emplace_backMethod · 0.80
GetArgsMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected