Bitcoin Forum
November 09, 2024, 01:58:43 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Regnet - Don't blocks get mined every 10 minutes?  (Read 215 times)
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 14, 2020, 07:23:46 PM
 #1

How can I enable this option on regtest? Right now if I want to mine 10000 blocks, I can do it within a minute. But I want to try being Satoshi. That mined the first blocks with 10 minutes difference on average.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 14, 2020, 08:57:43 PM
 #2

Just mine blocks at higher difficulty. For example you can make sure that first 32 bits are zeroes, then you will get exactly the same as in mainnet in 2009. Also, you can just run mainnet detached from the network and start mining on top of Genesis Block with mainnet difficulty.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 14, 2020, 09:13:44 PM
 #3

Just mine blocks at higher difficulty. For example you can make sure that first 32 bits are zeroes, then you will get exactly the same as in mainnet in 2009. Also, you can just run mainnet detached from the network and start mining on top of Genesis Block with mainnet difficulty.

And how exactly do I increase difficulty?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
July 14, 2020, 09:19:40 PM
 #4

I think you can change the difficulty to be set on 10 minutes per block bere: https://bitcoin.stackexchange.com/questions/84433/mining-difficulty-is-not-changed-on-regtest

(note it's an average of 10 minutes - you might want to isolate the process to a single thread if you try this as your computer might go slow).
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 15, 2020, 06:08:01 AM
 #5

You don't have to change source code. If running regtest, you can just configure your miner to produce blocks with higher difficulty. If running mainnet detached from the network, you will get it by default, if your wallet is not synchronized and you will start from Genesis Block. So the easiest option is probably just running mainnet and making sure it will be detached from the network.

So, to begin with, you can just:
1) make sure there is no ".bitcoin" or similar directory, so you begin from Genesis Block, it is probably enough to just rename existing dir (if any)
2) run mainnet
3) disable network activity (click icon in bottom right corner)
4) start mining using "generatetoaddress"

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 15, 2020, 06:34:52 AM
 #6

You don't have to change source code. If running regtest, you can just configure your miner to produce blocks with higher difficulty. If running mainnet detached from the network, you will get it by default, if your wallet is not synchronized and you will start from Genesis Block. So the easiest option is probably just running mainnet and making sure it will be detached from the network.

So, to begin with, you can just:
1) make sure there is no ".bitcoin" or similar directory, so you begin from Genesis Block, it is probably enough to just rename existing dir (if any)
2) run mainnet
3) disable network activity (click icon in bottom right corner)
4) start mining using "generatetoaddress"

When I use that command:
Code:
generatetoaddress 1 "bc1q33hjxx9wfnantaze4xd3j4jnjeq0srhzmp563q"

I get the following error:
Code:
CreateNewBlock: TestBlockValidity failed: bad-fork-prior-to-checkpoint (code 67) (code -1)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 15, 2020, 07:04:28 AM
 #7

You have to use legacy address (starting from one), because segwit is a soft-fork that was activated many, many blocks after the Genesis Block. You wanted to "try being Satoshi" and he used this coin many years before segwit was introduced.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 15, 2020, 07:09:36 AM
 #8

You have to use legacy address (starting from one), because segwit is a soft-fork that was activated many, many blocks after the Genesis Block. You wanted to "try being Satoshi" and he used this coin many years before segwit was introduced.

Code:
generatetoaddress 1 "3FFEdtxyXkLFHoL8Gn91aXTNrxevraKnEK"

returns:

Code:
CreateNewBlock: TestBlockValidity failed: bad-fork-prior-to-checkpoint (code 67) (code -1)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 15, 2020, 07:22:57 AM
 #9

Ok, I will demonstrate it step-by-step:
Code:
$ getnewaddress "" "legacy"
1Y83rK42gC2KHctMmzkaqB9BgZiyYZYH9
$ dumpprivkey 1Y83rK42gC2KHctMmzkaqB9BgZiyYZYH9
L2rirSQXXu3fy77BPr1gEen1SgoNuKUu89cGvEoysrPaYZyyK67f
$ generatetoaddress 1 "1Y83rK42gC2KHctMmzkaqB9BgZiyYZYH9" 1000000000
[
  "0000000056d13c49bc63b0d4a121496419d74e27a5ea0986611df1dcad787150"
]
$ getblock 0000000056d13c49bc63b0d4a121496419d74e27a5ea0986611df1dcad787150
{
  "hash": "0000000056d13c49bc63b0d4a121496419d74e27a5ea0986611df1dcad787150",
  "confirmations": 1,
  "strippedsize": 216,
  "size": 216,
  "weight": 864,
  "height": 1,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "a2f6aa713a1cf5d7ca6bd97e214e04b65abbac11fe06594de5d32371aaba5685",
  "tx": [
    "a2f6aa713a1cf5d7ca6bd97e214e04b65abbac11fe06594de5d32371aaba5685"
  ],
  "time": 1594797319,
  "mediantime": 1594797319,
  "nonce": 5153686,
  "bits": "1d00ffff",
  "difficulty": 1,
  "chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
  "nTx": 1,
  "previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
}
$ gettransaction a2f6aa713a1cf5d7ca6bd97e214e04b65abbac11fe06594de5d32371aaba5685
{
  "amount": 0.00000000,
  "confirmations": 1,
  "generated": true,
  "blockhash": "0000000056d13c49bc63b0d4a121496419d74e27a5ea0986611df1dcad787150",
  "blockheight": 1,
  "blockindex": 0,
  "blocktime": 1594797319,
  "txid": "a2f6aa713a1cf5d7ca6bd97e214e04b65abbac11fe06594de5d32371aaba5685",
  "walletconflicts": [
  ],
  "time": 1594797319,
  "timereceived": 1594797324,
  "bip125-replaceable": "no",
  "details": [
    {
      "address": "1Y83rK42gC2KHctMmzkaqB9BgZiyYZYH9",
      "category": "immature",
      "amount": 50.00000000,
      "label": "",
      "vout": 0
    }
  ],
  "hex": "02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0200f2052a010000001976a91405e2c775de292850af856a685308c5de0f39d3cf88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000"
}

Edit:
Quote
Code:
generatetoaddress 1 "3FFEdtxyXkLFHoL8Gn91aXTNrxevraKnEK"
It is not legacy address. Legacy address should start with one, not three!

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 15, 2020, 07:27:01 AM
 #10

I did every single step you said. It still returns me the bad-fork-prior-to-checkpoint error on generatetoaddress.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 15, 2020, 07:43:43 AM
 #11

1. Do you have network activity disabled? (click icon in bottom right corner if it is enabled)
2. What client version do you have? I am using Bitcoin Core version v0.20.0.
3. Do you have any blocks after the Genesis Block? Command "getblockcount" should give you zero. If it is bigger than that, you have to recreate bitcoin directory or invalidate previous blocks using "invalidateblock" command.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8326


Fiatheist


View Profile WWW
July 15, 2020, 07:52:12 AM
 #12

1. Do you have network activity disabled? (click icon in bottom right corner if it is enabled)
2. What client version do you have? I am using Bitcoin Core version v0.20.0.
3. Do you have any blocks after the Genesis Block? Command "getblockcount" should give you zero. If it is bigger than that, you have to recreate bitcoin directory or invalidate previous blocks using "invalidateblock" command.

1. I have network activity disabled.
2. I use v0.19.2, does it matter?
3. getblockcount gives me 0.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Copper Member
Legendary
*
Offline Offline

Activity: 898
Merit: 2237



View Profile
July 15, 2020, 08:34:12 AM
 #13

I cannot see Bitcoin Core 0.19.2, after Bitcoin Core 0.19.1 there is Bitcoin Core 0.20.0. Are you getting your client from https://github.com/bitcoin/bitcoin/releases?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
July 15, 2020, 09:38:35 AM
 #14

As far as I'm aware, there was no 0.19.2... they went straight from 0.19.1 to 0.20.0.

As for the error... does your Bitcoin Core instance currently have transactions that you're created using your SegWit address(es)? Huh If so, that might be screwing things up...

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
caymanguy
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
July 19, 2020, 09:44:10 AM
 #15

I cannot see Bitcoin Core 0.19.2, after Bitcoin Core 0.19.1 there is Bitcoin Core 0.20.0. Are you getting your client from https://github.com/bitcoin/bitcoin/releases?
previous versions of the client may not correctly display blocks installed and saved in the new version.
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!