Bitcoin Forum
July 20, 2018, 01:45:46 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
  Home Help Search Donate Login Register  
  Show Posts
Pages: [1] 2 3 4 5 »
1  Bitcoin / Development & Technical Discussion / Re: cpuminer requires at least two bitcoin nodes to run on: June 25, 2018, 07:57:56 AM
thanks for pointing out getblocktemplate.

In src/rpc/mining.cpp , i comment out these two lines:

Code:
   //if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
    //    throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!");

and run one node only.

and getblocktemplate can work. and also cpuminer can work. So it is not necessary to have at least two nodes for mining.
2  Bitcoin / Development & Technical Discussion / cpuminer requires at least two bitcoin nodes to run on: June 25, 2018, 07:18:26 AM
i download this cpuminer on a cusmotmised blockchain that has different genesis block. i notice it requires at least two bitcoin nodes to run.

Is it due to the consensus algo ?

this is the cpuminer link  https://github.com/pooler/cpuminer
3  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: June 25, 2018, 06:21:33 AM

Oh, sorry I forgot to mention, in order to mine, the node has to connect to at least one peer node. So you need to run another instance of bitcoind and let it connect to the first node, like:


what is the reason the node has to connect to at least one peer node, in order for miner to run?
4  Bitcoin / Bitcoin Technical Support / Re: dump public key from bitcoin-cli on: June 22, 2018, 07:31:36 AM
Code:
listaddressgroupings


this command does not show the public keys
5  Bitcoin / Bitcoin Technical Support / dump public key from bitcoin-cli on: June 22, 2018, 06:58:37 AM
in bitcoin-cli, there is function to dump private address.

Is there any function to dump public address?
6  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: May 28, 2018, 02:37:39 AM
The default value of DEFAULT_MAX_TIP_AGE

Code:
src/validation.h:static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60;
which is equal to 86400.

I have set the value of nMaxTipAge to be multiplied by 4000.
 
Code:
src/validation.cpp:int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE * 4000;
Why it is not reflected in the bitcoind, it is still 86400, and must be set in command line with -maxtipage ?
7  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: May 27, 2018, 12:49:35 PM
why we need to add -maxtipage=$((24*60*60*5000)) to first node , so that getblocktemplate can work ?

first node:
src/bitcoind -debug=rpc -dns=0 -dnsseed=0 -datadir=../datadir/ -connect=0 -maxtipage=432000000 -daemon

second node:
src/bitcoind -debug=rpc -addnode=127.0.0.1:8963 -dns=0 -dnsseed=0 -datadir=../datadir_1/ -daemon

In the case you generated a new genesis block then you don't need for maxtipage, just run your miner and start mining.

I modified the timestamp, the nonce, in order to generate a new genesis block. But i still need to run bitcoind with maxtipage, so that getblocktemplate can work.

if i run bitcoind as: src/bitcoind -debug=rpc -dns=0 -dnsseed=0 -datadir=../datadir/ -connect=0 -daemon
i get the following errors:
Quote
src/bitcoin-cli -datadir=../datadir/ getblocktemplate
error code: -10
error message:
Bitcoin is downloading blocks...

Since i have generated  a new genesis block, why must bitcoind be run with maxtipage ?

In validation.cpp, IsInitialBlockDownload()
Code:
  if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
        return true;

With default value of nMaxTipAge of 86400, that function IsInitialBlockDownload returns true, so bitcoind will go on download blocks.

The purpose of setting a large number to maxtipage,  is to make bitcoind think that initial block has been downloaded, so bitcoind will NOT download initial block.
8  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: May 25, 2018, 12:12:57 PM
why we need to add -maxtipage=$((24*60*60*5000)) to first node , so that getblocktemplate can work ?

first node:
src/bitcoind -debug=rpc -dns=0 -dnsseed=0 -datadir=../datadir/ -connect=0 -maxtipage=432000000 -daemon

second node:
src/bitcoind -debug=rpc -addnode=127.0.0.1:8963 -dns=0 -dnsseed=0 -datadir=../datadir_1/ -daemon
9  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: May 25, 2018, 10:15:27 AM
after i made more changes , the customised bitcoind works! The changes can be applied to bitcoin core v0.15.1.

this is how i run bitcoind
Code:
src/bitcoind -debug=rpc -dns=0 -dnsseed=0 -datadir=../datadir/

this is how i run bitcoin-cli
Code:
src/bitcoin-cli -datadir=../datadir/ getinfo

the bitcoin.conf
Code:
server=1
gen=1
port=8963
rpcport=8962
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
rpcuser=username
rpcpassword=password
listen=1
10  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin Update 2018 *** on: May 25, 2018, 08:52:16 AM
i made changes to the bitcoin-core v0.15.1 code.

Here is my bitcoin.conf
Code:
server=1
port=12000
rpcport=12001
rpcallowip=0.0.0.0/0
rpcuser=username
rpcpassword=password
daemon=1

This is how i run bitcoind
Code:
src/bitcoind -conf=../datadir/bitcoin.conf -datadir=../datadir/ -reindex

When i run bitcoin-cli, i got error code of -28.
Code:
src/bitcoin-cli  -conf=../datadir/bitcoin.conf -datadir=../datadir/ help
error code: -28
error message:
Loading wwwallet...

debug.log
Code:
2018-05-25 09:05:39 Keys: 2002 plaintext, 0 encrypted, 2002 w/ metadata, 2002 total
2018-05-25 09:05:39  wallet                   45ms
2018-05-25 09:05:39 setKeyPool.size() = 2000
2018-05-25 09:05:39 mapWallet.size() = 0
2018-05-25 09:05:39 mapAddressBook.size() = 1
2018-05-25 09:05:39 Reindexing block file blk00000.dat...
2018-05-25 09:05:40 ERROR: AcceptBlock: high-hash, proof of work failed (code 16)
2018-05-25 09:05:40 Reindexing finished
2018-05-25 09:05:40 Failed to open mempool file from disk. Continuing anyway.
2018-05-25 09:06:22 ThreadRPCServer method=help

How could i solve this error ?
11  Bitcoin / Development & Technical Discussion / Re: Generate public key for mining genesis block on: May 25, 2018, 06:53:20 AM
found a helpful link

https://bitcoin.stackexchange.com/questions/59644/how-do-these-openssl-commands-create-a-bitcoin-private-key-from-a-ecdsa-keypair/59646#59646
12  Bitcoin / Development & Technical Discussion / Generate public key for mining genesis block on: May 25, 2018, 06:36:44 AM
in chainparams.cpp, a public key is used to mine genesis block:

Code:
048E794284AD7E4D776919BDA05CDD38447D89B436BDAF5F65EBE9D7AD3A0B084908B88162BB60B1AA5ED6542063A30FC9584A335F656A54CD9F66D6C742B67F55

How to generate similar public key using ecdsa library ?
13  Bitcoin / Development & Technical Discussion / Re: Bitcoin Script tutorial on: May 25, 2018, 03:28:50 AM
a good tutorial on bitcoin script

https://blockgeeks.com/guides/bitcoin-script-guide-part-2/
14  Bitcoin / Development & Technical Discussion / Re: start bitcoin core private blockchain on: May 24, 2018, 08:58:46 AM
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
15  Bitcoin / Development & Technical Discussion / Re: start bitcoin core private blockchain on: May 24, 2018, 07:53:29 AM
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
16  Bitcoin / Development & Technical Discussion / Re: start bitcoin core private blockchain on: May 24, 2018, 07:40:27 AM

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.
17  Bitcoin / Development & Technical Discussion / Re: start bitcoin core private blockchain on: May 24, 2018, 07:28:42 AM
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());
18  Bitcoin / Development & Technical Discussion / Re: start bitcoin core private blockchain on: May 24, 2018, 06:07:14 AM
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 ?
19  Bitcoin / Development & Technical Discussion / start bitcoin core private blockchain on: May 24, 2018, 05:36:06 AM
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?
20  Bitcoin / Development & Technical Discussion / Re: send bitcoin from BTC network to BCH network on: April 23, 2018, 01:07:06 AM
For example, my BTC address 1MocACiWLM8bYn8pCrYjy6uHq4U3CkxLaa is BCH address qrjr9lakau9au6t272w2z0wn0syzffqgyv89sgzct3 (eventough, the "legacy" address format is still valid for BCH)

i see, the BCH address format has changed.

i kind of think that if i have privates keys on both BTC and BCH, then can replay protection stops me from mining the same transaction twice?
Pages: [1] 2 3 4 5 »
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!