Bitcoin Forum
May 09, 2024, 08:11:34 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: start bitcoin core private blockchain  (Read 221 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 05:36:06 AM
 #1

To start a customised private bitcoin core blockchain, all i need to do is:

1) change the genesis block
2) change the timestamp of genesis block

is there anything else?
1715285494
Hero Member
*
Offline Offline

Posts: 1715285494

View Profile Personal Message (Offline)

Ignore
1715285494
Reply with quote  #2

1715285494
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715285494
Hero Member
*
Offline Offline

Posts: 1715285494

View Profile Personal Message (Offline)

Ignore
1715285494
Reply with quote  #2

1715285494
Report to moderator
QRC
Newbie
*
Offline Offline

Activity: 10
Merit: 2


View Profile
May 24, 2018, 05:52:53 AM
Merited by mdayonliner (1)
 #2

To start a customised private bitcoin core blockchain, all i need to do is:

1) change the genesis block
2) change the timestamp of genesis block

is there anything else?

what do you mean by private bitcoin core chain?
1) bitcoin core it's just a client, so use bitcoin blockchain term.
2) do you want to fork bitcoin codebase? In this case you have to change more parameters than genesis block: port number, magic message number ect.
3) But if you just want to run private bitcoin blockchain for your own testing or something similar, you don't have to change anything Smiley just start daemon with -regtest option.
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 06:07:14 AM
 #3

what do you mean by private bitcoin core chain?
1) bitcoin core it's just a client, so use bitcoin blockchain term.
2) do you want to fork bitcoin codebase? In this case you have to change more parameters than genesis block: port number, magic message number ect.
3) But if you just want to run private bitcoin blockchain for your own testing or something similar, you don't have to change anything Smiley just start daemon with -regtest option.

Thank you. I would like to fork bitcoin code base.

In src/chainparams.cpp
Quote
    const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
    const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;

Can i just change the timestamp and genesis output script, to create a customised bitcoin ?
QRC
Newbie
*
Offline Offline

Activity: 10
Merit: 2


View Profile
May 24, 2018, 06:34:21 AM
 #4

what do you mean by private bitcoin core chain?
1) bitcoin core it's just a client, so use bitcoin blockchain term.
2) do you want to fork bitcoin codebase? In this case you have to change more parameters than genesis block: port number, magic message number ect.
3) But if you just want to run private bitcoin blockchain for your own testing or something similar, you don't have to change anything Smiley just start daemon with -regtest option.

Thank you. I would like to fork bitcoin code base.

In src/chainparams.cpp
Quote
    const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
    const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;

Can i just change the timestamp and genesis output script, to create a customised bitcoin ?
No it's not enough.
Read some guide, for example this one:
Complete Guide on How to Create a New Alt Coin
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 07:28:42 AM
Last edit: May 24, 2018, 07:49:36 AM by victorkimba17
 #5

i found a good link
https://bitcoin.stackexchange.com/questions/13122/scriptsig-coinbase-structure-of-the-genesis-block

i tried to print out the value in chainparams.cpp before assert in line 125. But value is printed out as 0x0,  and 0x103?

Quote
fprintf(stdout,"0x%x\n",consensus.hashGenesisBlock);
fprintf(stdout,"0x%x\n",genesis.hashMerkleRoot);

the warning is : format specifies type 'unsigned int' but the argument has type 'uint256'

Update: use this to print uint256. They are string.
Quote
fprintf(stdout,"%s\n", consensus.hashGenesisBlock.ToString().c_str());
fprintf(stdout,"%s\n",genesis.hashMerkleRoot.ToString().c_str());
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 07:40:27 AM
 #6


Quote
No it's not enough.
Read some guide, for example this one:
Complete Guide on How to Create a New Alt Coin

I read it.
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 07:53:29 AM
Last edit: May 24, 2018, 08:17:44 AM by victorkimba17
 #7

i only changed the timestamp, when starting bitcoind, i got the error in debug.log

2018-05-24 07:50:44 mapAddressBook.size() = 1
2018-05-24 07:50:44 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2018-05-24 07:50:44 *** Failed to read block
2018-05-24 07:50:44 Error: Error: A fatal internal error occurred, see debug.log for details

It is solved by running bitcoind with -reindex
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 24, 2018, 08:58:46 AM
 #8

when i run the bitcoin-cli, i got the error

error code: -28
error message:
Loading wallet...

In the protocol.h, the error meaning is:

RPC_IN_WARMUP                   = -28, //!< Client still warming up
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!