Bitcoin Forum
May 26, 2024, 01:20:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 [3]
41  Alternate cryptocurrencies / Altcoin Discussion / Facing a problem while changing initial target threashold of my altcoin! on: October 08, 2018, 08:07:22 AM
I created my coin based on bitcoin and when I tried to change difficulty I encountered a problem. The problem is explained in my recent post in  Development & Technical Discussion part here :https://bitcointalk.org/index.php?topic=5039512.0. Does anyone know the answer to my last post? I would be really grateful.
42  Alternate cryptocurrencies / Altcoin Discussion / Re: Facing a problem while trying to change initial difficulty target threashold!!!! on: October 05, 2018, 03:41:27 PM
The problem is halfway solved. I should've changed powLimit field of consensus too. In chainparams.cpp in mainnet consensus.powLimit is set to  :
Code:
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
by changing it to
Code:
consensus.powLimit = uint256S("00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
I could startup the server successfully. For genesis block i found out that GenesisH0 for sure didn't work properly and I changed https://github.com/JonPullinger/Genesis-Block-Generator-Crypto-Bitcoin.git manually. Just by changing line 312
Code:
unsigned int check = *((uint32_t *)(block_hash2 + 28)); // The hash is in little-endian, so we check the last 4 bytes.
if(check == 0) // \x00\x00\x00\x00
{....
to
Code:
if(check <=1048575) // \x00\x0f\xff\xff (for example)
generated genesis block quickly. All similar C codes on github will run the same.
My problem is I can't add one node to the other. I ran the first node like :
Code:
 bitcoind -dns=0 -dnsseed=0 -port=15333 -rpcport=15332 -datadir=/home/user/.bitcoin2 -maxtipage=$((24*60*60*5000))
and it seemed to work fine. Then the second node :
Code:
bitcoind -dns=0 -dnsseed=0 -port=6333 -rpcport=6332 -addnode=127.0.0.1:15332 -debug=rpc -maxtipage=$((24*60*60*50000))
The server will start up but when I type
Code:
bitcoin-cli getblocktemplate
in another terminal,I get :
Code:
error code: -10
error message:
Bitcoin is downloading blocks...

When I add port instead of rpcport:
Code:
bitcoind -dns=0 -dnsseed=0 -port=6333 -rpcport=6332 -addnode=127.0.0.1:15333 -debug=rpc -maxtipage=$((24*60*60*500000000))
It shows something
Code:
 New outbound peer connected: version: 70015, blocks=0, peer=0
but still bitcoin-cli getblocktemplate didn't work
Where does it come from exactly?Why changing difficulty will result in this ?


43  Alternate cryptocurrencies / Altcoin Discussion / Re: Facing a problem while trying to change initial difficulty target threashold!!!! on: October 02, 2018, 06:51:29 PM
What are you using for the parameters in this call?

Code:
genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);

Did you change
Code:
0x1d00ffff
to your custom difficulty?

Yes ,now I changed it to 0x200fffff and set  537919487 in :
Code:
txNew.vin[0].scriptSig = CScript() << 537919487‬<< CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
44  Alternate cryptocurrencies / Altcoin Discussion / Re: Facing a problem while trying to change initial difficulty target threashold!!!! on: October 02, 2018, 07:41:30 AM

How did you mine the genesis block? Does that application correctly mine the original genesis block, just to make sure it is working correctly?

Where did you set you genesis block? You should be calling this (but modifying it for the block you mined):

Code:
genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);

Also, what does this function look like for you?

Code:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
    const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}

-reindex just rebuilds chain state and block index from the blk*.dat files on disk. You might need to delete the existing blockchain files in ~/.bitcoin/blocks and ~/.bitcoin/chainstate.


Thank you so much for response. I mined my genesisblock with https://github.com/lhartikk/GenesisH0. I used several  C codes first but they didn't take the target that I manually set (https://github.com/vlamer/genesis-block-generator for example). They all had a same line :
Code:
unsigned int check = *((uint32_t *)(block_hash2 + 28)); 
I wanted to generate a genesis hash so close to my custom threshold but it seems C codes don't work for my purpose. I have doubt about mining it with GenesisH0.
That CreateGenesisBlock function looks exactly the same for me.
Code:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "My change is awesome in 01/OCT/2018";    
    const CScript genesisOutputScript = CScript() << ParseHex("049b8db7f03a5e5fa10183019168dabafc367ab38f8b16ef0e16297a45a9acae9053eb915cadda71bf982eb685fed120ed365ae09544cd4f8f08d8c5c21185cbbe") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
And thanks for explaining -reindex.
45  Alternate cryptocurrencies / Altcoin Discussion / Facing a problem while trying to change initial difficulty target threashold!!!! on: September 28, 2018, 05:20:19 AM
Recently, I read https://bitcointalk.org/index.php?topic=3345808.0  for forking bitcoin. Then I wanted to change the difficulty(Target Treshold) inorder to mine blocks faster, so I set regtest network difficulty(0x207fffff) to main network(which was 0x1d00ffff) and created my genesis block from scratch. when I run bitcoind command i get this error :

Code:
bitcoind 
2018-09-28T04:46:14Z Bitcoin Core version v0.17.99.0-bddc7753d-dirty (release build)
2018-09-28T04:46:14Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-09-28T04:46:14Z Assuming ancestors of block 0448936a4bf373c9c203012ce041a8f41d538861676aaeb9ef4a98aa08eb9360 have valid signatures.
2018-09-28T04:46:14Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000100010001
2018-09-28T04:46:14Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2018-09-28T04:46:14Z Using RdRand as an additional entropy source
2018-09-28T04:46:14Z Default data directory /home/myuser/.bitcoin
2018-09-28T04:46:14Z Using data directory /home/myuser/.bitcoin
2018-09-28T04:46:14Z Using config file /home/myuser/.bitcoin/bitcoin.conf
2018-09-28T04:46:14Z Using at most 125 automatic connections (1024 file descriptors available)
2018-09-28T04:46:14Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-09-28T04:46:14Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-09-28T04:46:14Z Using 0 threads for script verification
2018-09-28T04:46:14Z HTTP: creating work queue of depth 16
2018-09-28T04:46:14Z No rpcpassword set - using random cookie authentication.
2018-09-28T04:46:14Z Generated RPC authentication cookie /home/myuser/.bitcoin/.cookie
2018-09-28T04:46:14Z HTTP: starting 4 worker threads
2018-09-28T04:46:14Z Using wallet directory /home/myuser/.bitcoin/wallets
2018-09-28T04:46:14Z init message: Verifying wallet(s)...
2018-09-28T04:46:14Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-09-28T04:46:14Z Using wallet wallet.dat
2018-09-28T04:46:14Z BerkeleyEnvironment::Open: LogDir=/home/myuser/.bitcoin/wallets/database ErrorFile=/home/myuser/.bitcoin/wallets/db.log
2018-09-28T04:46:14Z scheduler thread start
2018-09-28T04:46:14Z Cache configuration:
2018-09-28T04:46:14Z * Using 2.0MiB for block index database
2018-09-28T04:46:14Z * Using 8.0MiB for chain state database
2018-09-28T04:46:14Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-09-28T04:46:14Z init message: Loading block index...
2018-09-28T04:46:14Z Opening LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:46:14Z Opened LevelDB successfully
2018-09-28T04:46:14Z Using obfuscation key for /home/myuser/.bitcoin/blocks/index: 0000000000000000
2018-09-28T04:46:14Z LoadBlockIndexDB: last block file = 0
2018-09-28T04:46:14Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2018-09-28T04:46:14Z Checking all blk files are present...
2018-09-28T04:46:14Z Initializing databases...
2018-09-28T04:46:14Z Pre-allocating up to position 0x1000000 in blk00000.dat
2018-09-28T04:46:14Z Opening LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:46:14Z Opened LevelDB successfully
2018-09-28T04:46:14Z Wrote new obfuscate key for /home/myuser/.bitcoin/chainstate: 486c004dfb89eb73
2018-09-28T04:46:14Z Using obfuscation key for /home/myuser/.bitcoin/chainstate: 486c004dfb89eb73
2018-09-28T04:46:14Z init message: Rewinding blocks...
2018-09-28T04:46:14Z  block index              47ms
2018-09-28T04:46:14Z init message: Loading wallet...
2018-09-28T04:46:14Z [default wallet] nFileVersion = 179900
2018-09-28T04:46:14Z [default wallet] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2018-09-28T04:46:14Z [default wallet] Performing wallet upgrade to 169900
2018-09-28T04:46:18Z [default wallet] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2018-09-28T04:46:18Z [default wallet] Wallet completed loading in            3384ms
2018-09-28T04:46:18Z [default wallet] setKeyPool.size() = 2000
2018-09-28T04:46:18Z [default wallet] mapWallet.size() = 0
2018-09-28T04:46:18Z [default wallet] mapAddressBook.size() = 0
2018-09-28T04:46:18Z ERROR: ReadBlockFromDisk: Errors in block header at CDiskBlockPos(nFile=0, nPos=8)
2018-09-28T04:46:18Z *** Failed to read block
2018-09-28T04:46:18Z Error: Error: A fatal internal error occurred, see debug.log for details
Error: Error: A fatal internal error occurred, see debug.log for details
Segmentation fault (core dumped)

There is actually nothing more than what I get in debug.log. I tried to run it with -reindex (though I don't precisely know what reindex does!?) and I get :

Code:
bitcoind -reindex
2018-09-28T04:47:06Z Bitcoin Core version v0.17.99.0-bddc7753d-dirty (release build)
2018-09-28T04:47:06Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-09-28T04:47:06Z Assuming ancestors of block 0448936a4bf373c9c203012ce041a8f41d538861676aaeb9ef4a98aa08eb9360 have valid signatures.
2018-09-28T04:47:06Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000100010001
2018-09-28T04:47:06Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2018-09-28T04:47:06Z Using RdRand as an additional entropy source
2018-09-28T04:47:06Z Default data directory /home/myuser/.bitcoin
2018-09-28T04:47:06Z Using data directory /home/myuser/.bitcoin
2018-09-28T04:47:06Z Using config file /home/myuser/.bitcoin/bitcoin.conf
2018-09-28T04:47:06Z Using at most 125 automatic connections (1024 file descriptors available)
2018-09-28T04:47:06Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-09-28T04:47:06Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-09-28T04:47:06Z Using 0 threads for script verification
2018-09-28T04:47:06Z HTTP: creating work queue of depth 16
2018-09-28T04:47:06Z No rpcpassword set - using random cookie authentication.
2018-09-28T04:47:06Z Generated RPC authentication cookie /home/myuser/.bitcoin/.cookie
2018-09-28T04:47:06Z HTTP: starting 4 worker threads
2018-09-28T04:47:06Z Using wallet directory /home/myuser/.bitcoin/wallets
2018-09-28T04:47:06Z init message: Verifying wallet(s)...
2018-09-28T04:47:06Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-09-28T04:47:06Z Using wallet wallet.dat
2018-09-28T04:47:06Z BerkeleyEnvironment::Open: LogDir=/home/myuser/.bitcoin/wallets/database ErrorFile=/home/myuser/.bitcoin/wallets/db.log
2018-09-28T04:47:06Z scheduler thread start
2018-09-28T04:47:06Z Cache configuration:
2018-09-28T04:47:06Z * Using 2.0MiB for block index database
2018-09-28T04:47:06Z * Using 8.0MiB for chain state database
2018-09-28T04:47:06Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-09-28T04:47:06Z init message: Loading block index...
2018-09-28T04:47:06Z Wiping LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:47:06Z Opening LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:47:06Z Opened LevelDB successfully
2018-09-28T04:47:06Z Using obfuscation key for /home/myuser/.bitcoin/blocks/index: 0000000000000000
2018-09-28T04:47:06Z Initializing databases...
2018-09-28T04:47:06Z Wiping LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:47:06Z Opening LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:47:06Z Opened LevelDB successfully
2018-09-28T04:47:06Z Wrote new obfuscate key for /home/myuser/.bitcoin/chainstate: 329d28cbdd513256
2018-09-28T04:47:06Z Using obfuscation key for /home/myuser/.bitcoin/chainstate: 329d28cbdd513256
2018-09-28T04:47:06Z  block index              20ms
2018-09-28T04:47:06Z init message: Loading wallet...
2018-09-28T04:47:06Z [default wallet] nFileVersion = 179900
2018-09-28T04:47:06Z [default wallet] Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total. Unknown wallet records: 0
2018-09-28T04:47:06Z [default wallet] Wallet completed loading in             112ms
2018-09-28T04:47:06Z [default wallet] setKeyPool.size() = 2000
2018-09-28T04:47:06Z [default wallet] mapWallet.size() = 0
2018-09-28T04:47:06Z [default wallet] mapAddressBook.size() = 0
2018-09-28T04:47:06Z Reindexing block file blk00000.dat...
2018-09-28T04:47:06Z ERROR: AcceptBlock: high-hash, proof of work failed (code 16)
2018-09-28T04:47:07Z Reindexing finished
2018-09-28T04:47:07Z Failed to open mempool file from disk. Continuing anyway.

It seems to have problem with PoW. I guessed there is something with this line in "chainparams.cpp":
Code:
 txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));

At first I set 486604799 (decimal of bitcoin core's initial difficulty 0x1d00ffff) to the new difficulty 545259519 (decimal of 0x207fffff) but I get core dumped instantly.Maybe this
 
Code:
if (UintToArith256(hash) > bnTarget)
     return false;
from pow.cpp always returns false. Anyone has any idea what should I do ? I will be very grateful.
46  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin – Update 2018 *** on: September 16, 2018, 10:16:59 AM
Hello

I tried to do this post in order to finally change PoW threshold to create blocks faster. Unfortunately I encountered a problem, after those 13 steps  I came up to run bitcoind command and all I got was core dumped error. like this :

Code:
~$ bitcoind
bitcoind: chainparams.cpp:132: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0000000001e075d779592db22d19573375d05db23bdafd0a8b06c89fb2985d89")' failed.
Aborted (core dumped)

It seems it won't accept my genesis hash and with bitcoin-cli command it says "can not connect to server 127.0.0.1:6332. I can't even add the node with its command .Here is my bitcoin.conf :

rpcuser=admin
rpcpassword=admin
server=1
rpcallowip=127.0.0.1
rpcport=6332
listen=1
gen = 1

I tried so hard but couldn't find out what i'm missing. I followed all the steps precisely.  I will be beyond grateful if some body take some time and answer my question.


bitcoin is easy way after used this guide you need understand used some c++ skill to do.

I have some knowledge of c++ but right now I can not even test my fork. I don't know why I get this error. I didn't change address prefixes. It won't be a problem,will it ?

you need change consensus of bitcoin follow up old guide. you can see on my profile i visit old guide. then mix with this one. + you need change pcmessage that important thing on unique. and put pztime to make sense of change before doing alive. you need prepare of this. old guide + this one made complete part of puzzle. try experiment on testnet before launch and you will meet same as this and you need some trick to make it appear your genesis. by generate timestamp another two just default or put anything~

Thank You. I solved it. It was One line that I carelessly commented because it was not in the main guide.
47  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin – Update 2018 *** on: September 08, 2018, 01:32:48 PM
Hello

I tried to do this post in order to finally change PoW threshold to create blocks faster. Unfortunately I encountered a problem, after those 13 steps  I came up to run bitcoind command and all I got was core dumped error. like this :

Code:
~$ bitcoind
bitcoind: chainparams.cpp:132: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0000000001e075d779592db22d19573375d05db23bdafd0a8b06c89fb2985d89")' failed.
Aborted (core dumped)

It seems it won't accept my genesis hash and with bitcoin-cli command it says "can not connect to server 127.0.0.1:6332. I can't even add the node with its command .Here is my bitcoin.conf :

rpcuser=admin
rpcpassword=admin
server=1
rpcallowip=127.0.0.1
rpcport=6332
listen=1
gen = 1

I tried so hard but couldn't find out what i'm missing. I followed all the steps precisely.  I will be beyond grateful if some body take some time and answer my question.


bitcoin is easy way after used this guide you need understand used some c++ skill to do.

I have some knowledge of c++ but right now I can not even test my fork. I don't know why I get this error. I didn't change address prefixes. It won't be a problem,will it ?
48  Alternate cryptocurrencies / Altcoin Discussion / Re: *** Complete Guide on How to Create a New Alt Coin – Update 2018 *** on: September 07, 2018, 03:15:21 PM
Hello

I tried to do this post in order to finally change PoW threshold to create blocks faster. Unfortunately I encountered a problem, after those 13 steps  I came up to run bitcoind command and all I got was core dumped error. like this :

Code:
~$ bitcoind
bitcoind: chainparams.cpp:132: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x0000000001e075d779592db22d19573375d05db23bdafd0a8b06c89fb2985d89")' failed.
Aborted (core dumped)

It seems it won't accept my genesis hash and with bitcoin-cli command it says "can not connect to server 127.0.0.1:6332. I can't even add the node with its command .Here is my bitcoin.conf :

rpcuser=admin
rpcpassword=admin
server=1
rpcallowip=127.0.0.1
rpcport=6332
listen=1
gen = 1

I tried so hard but couldn't find out what i'm missing. I followed all the steps precisely.  I will be beyond grateful if some body take some time and answer my question.
Pages: « 1 2 [3]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!