Bitcoin Forum
June 14, 2024, 07:16:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: *** Complete Guide on How to Create a New Alt Coin – Update 2019 ***  (Read 2084 times)
coinuser2020
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
March 07, 2021, 06:50:20 PM
 #21

@TheWolf666

Thank you for the great guide. I've followed the instructions to make changes and able to build the code on Windows. But I'm unable to start the wallet or the coin daemon server.
It fails in this code, in tx_check.cpp.

Code:
 if (tx.IsCoinBase())
    {
        if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)
            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
    }

I see that in Chainparams.cpp, there are new variables being set in the latest core code, for example
Code:
consensus.SegwitHeight = 481824;
I've set this to 1 but still no use.

Any pointers? I would like to create a brand new blockchain from start using bitcoin core code for experimental purposes.

Thanks in advance
TheWolf666 (OP)
Full Member
***
Offline Offline

Activity: 615
Merit: 154


CEO of Metaisland.gg and W.O.K Corp


View Profile WWW
March 07, 2021, 07:11:21 PM
 #22

@TheWolf666

Thank you for the great guide. I've followed the instructions to make changes and able to build the code on Windows. But I'm unable to start the wallet or the coin daemon server.
It fails in this code, in tx_check.cpp.

Code:
 if (tx.IsCoinBase())
    {
        if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)
            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
    }

I see that in Chainparams.cpp, there are new variables being set in the latest core code, for example
Code:
consensus.SegwitHeight = 481824;
I've set this to 1 but still no use.

Any pointers? I would like to create a brand new blockchain from start using bitcoin core code for experimental purposes.

Thanks in advance

I would comment the
Code:
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
and do consensus.SegwitHeight = 0;

You are starting a new blockchain so you need all the BIPs starting at zero.
If you have a validation error, temporary comment the error, so that the first block (genesis) can be written into the blockchain.
The first block is always a problem, because the authors of Bitcoin Core are not helping the altcoin developers with their validation tests that are specific to Bitcoin.

coinuser2020
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
March 07, 2021, 08:32:29 PM
 #23

Thank you.
I've reset all heights to 0 (previously I had them at 1) and returning true from the "if" condition below.

I was able to start the xxxcoind.exe and it used the default %APPDATA% folder.

When I tried to start the wallet ( xxx-qt.exe or xxx-cli.exe), it complained about unable to lock the data directory.

Is this by design, that you cannot start daemon and wallet on the same node?
I ended up changing the data directory for wallet to somewhere else like "C:\data". I'm guessing this will duplicate the entire chain?

Then stopped the wallet and running this command in a loop to mine few blocks. Not sure how long this will take on a CPU or where I can check if the transactions are being processed (since I cannot open qt-exe while CLI.exe has locked the wallet)

Code:
cli-exe -generate 1



@TheWolf666

Thank you for the great guide. I've followed the instructions to make changes and able to build the code on Windows. But I'm unable to start the wallet or the coin daemon server.
It fails in this code, in tx_check.cpp.

Code:
 if (tx.IsCoinBase())
    {
        if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)
            return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
    }

I see that in Chainparams.cpp, there are new variables being set in the latest core code, for example
Code:
consensus.SegwitHeight = 481824;
I've set this to 1 but still no use.

Any pointers? I would like to create a brand new blockchain from start using bitcoin core code for experimental purposes.

Thanks in advance

I would comment the
Code:
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-cb-length");
and do consensus.SegwitHeight = 0;

You are starting a new blockchain so you need all the BIPs starting at zero.
If you have a validation error, temporary comment the error, so that the first block (genesis) can be written into the blockchain.
The first block is always a problem, because the authors of Bitcoin Core are not helping the altcoin developers with their validation tests that are specific to Bitcoin.

TheWolf666 (OP)
Full Member
***
Offline Offline

Activity: 615
Merit: 154


CEO of Metaisland.gg and W.O.K Corp


View Profile WWW
March 07, 2021, 08:49:35 PM
 #24

You cannot mine like this. You need to use a stratum pool.
Solo mining has been disabled for a long time (unless they added it back? but I am doubtful)

You need to setup a mining pool, and it is quite a complicated process.
A good start is here: https://github.com/tpruvot/yiimp
Take a cheap dedicated server here for example: https://www.hetzner.com/sb
Use an install script like this: https://github.com/xavatar/yiimp_install_scrypt

Do not let anyone install it for you, services will generally have some sort of spyware, and will mine partially for them, so it is not worth.

coinuser2020
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
March 08, 2021, 12:05:05 AM
 #25

Interesting..I thought if the blockchain is brand new and difficulty is very low, you should be able to mine it locally before setting up servers and pools etc.
Thanks for the info though.

You cannot mine like this. You need to use a stratum pool.
Solo mining has been disabled for a long time (unless they added it back? but I am doubtful)

You need to setup a mining pool, and it is quite a complicated process.
A good start is here: https://github.com/tpruvot/yiimp
Take a cheap dedicated server here for example: https://www.hetzner.com/sb
Use an install script like this: https://github.com/xavatar/yiimp_install_scrypt

Do not let anyone install it for you, services will generally have some sort of spyware, and will mine partially for them, so it is not worth.
coinuser2020
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
March 08, 2021, 04:55:25 AM
 #26

You're correct.
Setgenerate has been removed a while ago. I'm late to the party.

I will need to figure out a way to mine these before spending big $$.

Thank you for responding so quickly.

You cannot mine like this. You need to use a stratum pool.
Solo mining has been disabled for a long time (unless they added it back? but I am doubtful)

You need to setup a mining pool, and it is quite a complicated process.
A good start is here: https://github.com/tpruvot/yiimp
Take a cheap dedicated server here for example: https://www.hetzner.com/sb
Use an install script like this: https://github.com/xavatar/yiimp_install_scrypt

Do not let anyone install it for you, services will generally have some sort of spyware, and will mine partially for them, so it is not worth.
kanchiworld
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
March 08, 2021, 06:04:10 PM
 #27

Take a look at this coin just launched.

https://github.com/kanchiworld/kanchan

It is fairly new, and they are giving away free coins to early adopters. It may be a good idea to get in early.
forexandcryptoauditor
Copper Member
Jr. Member
*
Offline Offline

Activity: 1190
Merit: 3


View Profile WWW
March 08, 2021, 07:01:27 PM
 #28

Truly speaking, the information provided by you is too technical for me but I see how step by step it is presented and made it simple. At least the first time I came to know about specific points on the creation of new altcoin. Would like to appreciate your efforts in putting this information altogether.

isp92074
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
March 21, 2021, 07:43:42 AM
Last edit: March 21, 2021, 07:58:46 AM by isp92074
 #29

Thanks your guide helps cloning Bitcoin latest version.

hi sir ,
dear may be you help me .
i do all by your instruction but have some errors

Validation.cpp is not finished yet. We have a problem with SEGWIT. It cannot work at height 1. So in the beginning, we need to disable some

1)IsNullDummyEnabled has the same problem, do the same to that function return true/


===========
Suggested: IsNullDummyEnabled has the same problem, do the same to that function.
Question: Cant find it?!! Is it in validation.cpp on the latest bitcoin version?

=> this I do not understand.

===========



2)If ccminer cannot mine, then you can use my fixed version here: https://github.com/NicolasChoukroun/stratum



In the latest version I do not find a function IsNullDummyEnabled
1) to replace the return
2) I do not find C ++ stratum files for change
3) After compiling the QT wallet, the nodes are well connected and the sync is finished the tick in the lower right corner, but
in console command result  

getblocktemplate
= Bitcoin core is in initial sync and waiting for blocks code -10

but still still problems solo mining in yiimp pool issues the same synchronization error for added coin..

Stratum server issues a message - unknown method getblocktemplate 192.168.0.104
-
started easymainer on 192.168.0.4  issues a message
2 miner theads started using sha25 algo
HTTP request failed
json_rpc_call failed  

Please advise how to how to solve these problems??
 i need solo mininig on cpu for my cloned version & remove the synchronization error in the new Bitcoin core 21.99
liorko87
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
March 21, 2021, 08:00:49 AM
 #30

@isp92074 I had the same error, please check that SegWit height is not 1.
At the beginning try to leave the SegWit height as is.
isp92074
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
March 27, 2021, 05:44:39 AM
 #31

@isp92074 I had the same error, please check that SegWit height is not 1.
At the beginning try to leave the SegWit height as is.
Height was 0))now I made a consensus.segwit height  as in last bitcoin, but the error persists. testnet works without this error
liorko87
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
April 08, 2021, 11:18:19 AM
 #32

How are you mining? via generatetoaddress or a miner?
magnetesim
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
April 13, 2021, 06:19:38 PM
 #33

Hello, I am having some problems with the genesis block. I am new to C++, but what I know is that because my assert of the genesis hash is failing, it means that I am putting the wrong genesis hash. Here is my code for generating the genesis hash (I'm using the genesis generator from https://github.com/hashcrack256/node-genesis-block):
Code:
node genesis -p 040839e4f568674e93581cf1db43a7b09a8ba9d440bad64b296c1554cf7c9c9714d1b5d19c3aadc01647ab41266d4fe2745afa72166c3d69a66cd35c4f3a0b5de0 -t 1618258400 -n 404483 -a sha256d -v 5000000000 -z "Ion got it on me." -b 0x1d00ffff
And in my chainparams.cpp:
Code:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "Ion got it on me.";
    const CScript genesisOutputScript = CScript() << ParseHex("040839e4f568674e93581cf1db43a7b09a8ba9d440bad64b296c1554cf7c9c9714d1b5d19c3aadc01647ab41266d4fe2745afa72166c3d69a66cd35c4f3a0b5de0") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
As well as:
Code:
        genesis = CreateGenesisBlock(1618258400, 404483, 0x1d00ffff, 1, 50 * COIN);
        consensus.hashGenesisBlock = genesis.GetHash();
        assert(consensus.hashGenesisBlock == uint256S("0x000005a48ef8e68ac2f26d0987784eaace9dc304f9f579a652f83c958d5fadb1"));
        assert(genesis.hashMerkleRoot == uint256S("0x941d67c6b23e01ae4f16284613133be33c46d23d38fe150c34ab92bc7bd04176"));
What exactly am I missing? What missing parameter am I missing that affects the genesis hash, so that the assert fails? The reason I'm not using your provided genesis generator is because it gives me a ton of
Code:
chainparams.cpp:27:5: error: ‘arith_uint256’ was not declared in this scope
errors for more than just line 27. What I'm doing to put your code into chainparams.cpp, is copy and pasting https://raw.githubusercontent.com/NicolasChoukroun/altcoin-genesis/master/creategenesis.cpp under all of the #include in chainparams.cpp. There is probably something I'm doing wrong here, and I'm way too new to C++ to know what I'm doing wrong. Any help would be greatly appreciated!
coinuser2020
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 19, 2021, 05:10:11 PM
 #34

Take a look at this coin just launched.

https://github.com/kanchiworld/kanchan

It is fairly new, and they are giving away free coins to early adopters. It may be a good idea to get in early.


What is this coin? Is there a purpose to it? Any details of mining etc?
isp92074
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
April 24, 2021, 08:23:49 PM
 #35

How are you mining? via generatetoaddress or a miner?
1)generatetoaddress error
CreateNewBlock :TestBlockValidity failed unexpected-witness ContextualCheckBlock unexpected witness data found code -1
liorko87
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
April 28, 2021, 12:57:02 PM
 #36

@isp92074 don't activate SegWit at the beginning.
isp92074
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 02, 2021, 11:02:58 PM
 #37

@isp92074 don't activate SegWit at the beginning.
how to do it ?,
I changed some files https://github.com/isp92074/b3c, but still only regtest version miners works ok
isp@isp:~/ntgbtminer$ python3 ntgbtminer.py Test 2N3SryuVcYR3y8wgMcw98T2ek3VU8HpoSeg
Mining block template, height 7...
    0.0000 KH/s

Solved a block! Block hash: 1abbc23f5a921cfe88d1a4bbcd1411340c0e25353469a35da47816ab69d27ef0
Submitting: 00000020120e25591b008f7b2c1fce3affb687a261a6ee6d3094efd0e34d8e185c21b15fa5be88a 1a5723be3c71c3213a0128d38668bc9c631a9a3f62c7ebc092001682979228f60ffff7f20000000 000101000000010000000000000000000000000000000000000000000000000000000000000000f fffffff0a01075465737400000000ffffffff0100f2052a010000001976a9146fe4b6ca0ddb5ed5 9215dabb005292207550b5a788ac00000000

Mining block template, height 8...
    160.6757 KH/s

-----------------------------------------

on mainnet some errors
python3 ntgbtminer.py Test bc1qaaak4zwyq2dqleztjmz8hy407mlx08nl7wjneu
Traceback (most recent call last):
  File "ntgbtminer.py", line 482, in <module>
    standalone_miner(sys.argv[1].encode().hex(), sys.argv[2])
  File "ntgbtminer.py", line 460, in standalone_miner
    block_template = rpc_getblocktemplate()
  File "ntgbtminer.py", line 69, in rpc_getblocktemplate
    return rpc("getblocktemplate", [{"rules": ["segwit"]}])
  File "ntgbtminer.py", line 52, in rpc
    with urllib.request.urlopen(request) as f:
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

in bitcoinqt console


getblocktemplate

Bitcoin Core Clone is in initial sync and waiting for blocks... (code -10)

generatetoaddress 1 bc1qaaak4zwyq2dqleztjmz8hy407mlx08nl7wjneu

CreateNewBlock: TestBlockValidity failed: unexpected-witness, ContextualCheckBlock : unexpected witness data found (code -1)

DarkArrow
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
May 22, 2021, 02:33:01 AM
 #38

Code:
chainparams.cpp:27:5: error: ‘arith_uint256’ was not declared in this scope
errors for more than just line 27. What I'm doing to put your code into chainparams.cpp, is copy and pasting https://raw.githubusercontent.com/NicolasChoukroun/altcoin-genesis/master/creategenesis.cpp under all of the #include in chainparams.cpp. There is probably something I'm doing wrong here, and I'm way too new to C++ to know what I'm doing wrong. Any help would be greatly appreciated!

You need to add this before the mining function
Code:
#include <arith_uint256.h>
Phillwilk
Newbie
*
Offline Offline

Activity: 12
Merit: 7


View Profile
May 28, 2021, 07:09:01 PM
 #39

Hi pal,

Followed this tutorial and now have two working instances of my Alt running. I decided to try and mine via RPC (still available on v0.18) with a simple python script I found on github (ntgbtminer). Problem is I'm getting the error

    Consensus::CheckBlock: bad-txns-vout-toolarge

Sorry for the off topic question but I could do with a second opinion.

Cheers
twairgroup
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 02, 2021, 07:39:24 AM
 #40

Thank you for your tutorial! I made a altcoin for fun, But i meet a problem which is (can't broadcast immediately no witness yet) im forked bitcoin core 0.16.0. If u can help me solve the problem i love to donate some ETH for your help. Grin Grin
Pages: « 1 [2] 3 »  All
  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!