how to update checkpoint block chain of altcoins
Posted By : Chandan Kumar Singh | 19-Nov-2017
In this blog we will update check points for altcoins, I have develped function and will update its check points. Checkpoints prevent various DoS attacks from nodes flooding unusable chains and attacks involving isolating nodes and giving them fake chains, but it is primarily an optimization for the initial blockchain download.
Run daemon process of greenshilling, then run the command getblockhash with block number for which you want to put checkpoint. Here I am doing for block number 500.
./funcoind getblockhash 500
000000000578ade629e30cd8f8444b3edcec8212ad4643731be3527199010b73
this is block hash.
In checkpoint.CPP file
static MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, hashGenesisBlockOfficial )
( 500, uint256("0x000000000578ade629e30cd8f8444b3edcec8212ad4643731be3527199010b73"))
we have added on 500 number block the hash with generated block hash.
If you have developed altcoin on based on
./funcoind getblock 000000000578ade629e30cd8f8444b3edcec8212ad4643731be3527199010b73
its output will be like below.
{
"hash" : "c9a7ae625d9b837fb7594241d0e6d800ff3e42b44f1ea8d08b2c3fdcfdcd8023",
"size" : 456,
"height" : 500,
"version" : 1,
"merkleroot" : "6bd8085d22b1840b085d7b969e4aacc1b2ae5f7f3e6438a249d66deace37112b",
"time" : "2017-11-19 09:54:37 UTC",
"nonce" : 0,
"bits" : "1c048f19",
"difficulty" : 56.15211345,
"mint" : 3.84000000,
"previousblockhash" : "d68bf7e8051c9fb5b9737a4b015a613537e18a76a543f7231a1ebb3c6d6c04c5",
"nextblockhash" : "6c7df2fc020f56be8fc52634f70a90544da66bdc3543076c29286cabd955b9f3",
"flags" : "proof-of-stake",
"proofhash" : "0000029e298dc892b8d7c8476b672788ecc7b16c06ff64c431c14577acec780f",
"entropybit" : 0,
"modifier" : "ac2a930a06eaf013",
"modifierchecksum" : "64365c5e",
"tx" : [
"4367af8c9fb557a1350cf7358a1d8fd82b31b13fbf1fec8477ccd1d73f7b6452",
"555c3955a9dcad14c492f7938a119d6123fac6ff4b2aa90fc085dee23bfede7d"
]
}
we have
"modifierchecksum" : "64365c5e"
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
boost::assign::map_list_of
( 0, 0x0e00670bu )
( 500, 0x64365c5eu);
Thanks.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Chandan Kumar Singh
Chandan is a bright Web Developer with expertise in Java and Spring framework and ORM tools Hibernate. He loves technologies like Blockchain and IoT.