Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: BlackHatCoiner on April 20, 2020, 02:44:06 PM



Title: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 02:44:06 PM
https://i.imgur.com/CGAnOap.png

This thing will get too much time to download. Is it normal for testnet?

Also where exactly do testnet bitcoins and real bitcoins differ?


Title: Re: [Testnet] Is this normal?
Post by: ranochigo on April 20, 2020, 02:48:24 PM
Yes. The verification of the blockchain depends very much on your hardware specification as the speed is related to how fast you can verify the entire block. You can speed it up by increasing the dbcache, if you have sufficient ram.

As there are significantly more blocks than the main net, it can still take quite sometime. Testnet Bitcoin is usually useless and is more often than not used as a testbed for experimental implementation before it is actually implemented on the mainnet. Else, if you're a developer for your own stuff, it's better to use regtest instead.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 03:10:32 PM
Yes. The verification of the blockchain depends very much on your hardware specification as the speed is related to how fast you can verify the entire block. You can speed it up by increasing the dbcache, if you have sufficient ram.

As there are significantly more blocks than the main net, it can still take quite sometime. Testnet Bitcoin is usually useless and is more often than not used as a testbed for experimental implementation before it is actually implemented on the mainnet. Else, if you're a developer for your own stuff, it's better to use regtest instead.

So the difference between regnet and testnet is that on regnet I can create as many satoshis as I want?


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 03:24:08 PM
So the difference between regnet and testnet is that on regnet I can create as many satoshis as I want?

You can create any amount of coins you want and generate blocks instantly. You don't have to wait for the client to sync with the network since it's basically a private, local blockchain. This page (https://bitcoin.org/en/developer-examples#regtest-mode) should help you.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 04:33:27 PM
And how much storage will it take to download 1,5M blocks? The mainnet's blockchain is 250GB+ long.


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 04:39:13 PM
And how much storage will it take to download 1,5M blocks? The mainnet's blockchain is 250GB+ long.

According to the blockchair.com (https://blockchair.com/bitcoin/testnet) block explorer, the size of the testnet blockchain is 24.26 GB. You can run your node in a pruned mode (https://bitcoin.org/en/full-node#reduce-storage) to save your disk space, but you will still need to download and verify all the blocks.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 04:45:16 PM
And how much storage will it take to download 1,5M blocks? The mainnet's blockchain is 250GB+ long.

According to the blockchair.com (https://blockchair.com/bitcoin/testnet) block explorer, the size of the testnet blockchain is 24.26 GB. You can run your node in a pruned mode (https://bitcoin.org/en/full-node#reduce-storage) to save your disk space, but you will still need to download and verify all the blocks.

I wonder, are there places to "buy" testbitcoins? Or is it too easy to mine them?

About my issue, I just want to test how bitcoin core works for developing reasons. Should I choose regnet?


Title: Re: [Testnet] Is this normal?
Post by: LoyceV on April 20, 2020, 05:05:17 PM
I wonder, are there places to "buy" testbitcoins? Or is it too easy to mine them?
Testnet Bitcoins are not supposed to ever have any value, so you shouldn't buy them. It will ultimately lead to Testnet being reset (we're currently on the third Testnet (https://en.bitcoin.it/wiki/Testnet)).
The easiest way to get small amounts of Testnet coins is from faucets.

Mocacinno (https://bitcointalk.org/index.php?topic=5227209.msg53947416#msg53947416) wrote about the cost of Testnet mining last month.


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 05:05:25 PM
I wonder, are there places to "buy" testbitcoins? Or is it too easy to mine them?

Testnet coins shouldn't have any value and shouldn't be sold. There are plenty of faucets which send under 0.1 tBTC at a time. You can google them.

About my issue, I just want to test how bitcoin core works for developing reasons. Should I choose regnet?

Sure, it should suit your needs.


Title: Re: [Testnet] Is this normal?
Post by: BrewMaster on April 20, 2020, 05:07:13 PM
I wonder, are there places to "buy" testbitcoins?
if there were any place where you could trade the worthless by-design testnet coins then the testnet network wouldn't have existed anymore. we would reset it and start Testnet 4 in its place.
there are testnet faucets that give away small amounts for free. google bitcoin testnet faucet and you'll find 3 to 5 working ones on first page.
https://bitcoinfaucet.uo1.net/
https://coinfaucet.eu/en/btc-testnet/
https://testnet-faucet.mempool.co/
https://tpfaucet.appspot.com/

Quote
Or is it too easy to mine them?
it is moderately easy to mine them because of the low difficulty but it is hard because there is competition with ASICs! and also the reward is very small since the block height is so high (there has been more halvings on testnet compared to mainnet)

Quote
About my issue, I just want to test how bitcoin core works for developing reasons. Should I choose regnet?
it depends on what you are doing. most tests can be done with testnet and with the small amount these faucets give you.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 05:19:23 PM
I wonder, are there places to "buy" testbitcoins? Or is it too easy to mine them?

Testnet coins shouldn't have any value and shouldn't be sold. There are plenty of faucets which send under 0.1 tBTC at a time. You can google them.

About my issue, I just want to test how bitcoin core works for developing reasons. Should I choose regnet?

Sure, it should suit your needs.

I have opened bitcoind.exe, because I'm trying to use the regtest mode (https://bitcoin.org/en/developer-examples#regtest-mode)

For how long will it do me this?
Does it mine or anything?
https://youtu.be/AlQCCXnRQ5Q



Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 05:25:05 PM
Does it mine or anything?
https://youtu.be/AlQCCXnRQ5Q

It seems to be still synchronizing with the testnet. What are your startup parameters for bitcoind? Did you add '-regtest' there?


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 05:29:49 PM
What parameters? When I open bitcoind.exe I can't write anything, it starts doing that "mining" thing.


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 05:44:54 PM
What parameters? When I open bitcoind.exe I can't write anything, it starts doing that "mining" thing.

Let's do it the other way. Shut down Bitcoin Core, press WIN + R and enter %appdata%. You should see Bitcoin folder inside which there should be bitcoin.conf file. If you don't have one, create it. Inside that file enter regtest=1 and make sure that both testnet and mainnet are set to 0. Now, launch Bitcoin Core and you should be in the regtest mode. You can use commands in the console (Window -> Console).


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 05:54:20 PM
What parameters? When I open bitcoind.exe I can't write anything, it starts doing that "mining" thing.

Let's do it the other way. Shut down Bitcoin Core, press WIN + R and enter %appdata%. You should see Bitcoin folder inside which there should be bitcoin.conf file. If you don't have one, create it. Inside that file enter regtest=1 and make sure that both testnet and mainnet are set to 0. Now, launch Bitcoin Core and you should be in the regtest mode. You can use commands in the console (Window -> Console).

That's my bitcoin.conf:
https://pastebin.com/raw/FAFxSX6b

I did what you told me but where is the "mainnet" you said? I can't find it in the file. (Only testnet = 0 and regtest = 1)

This is what it prints me and I then run bitcoin core:
https://i.imgur.com/RDCv2Qa.png


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 05:58:37 PM
I did what you told me but where is the "mainnet" you said? I can't find it in the file. (Only testnet = 0 and regtest = 1)

You need to remove '#' which is in front of both testnet and regtest - https://pastebin.com/raw/q9eY936e . Replace your config with this and it should work now.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 07:41:22 PM
I did what you told me but where is the "mainnet" you said? I can't find it in the file. (Only testnet = 0 and regtest = 1)

You need to remove '#' which is in front of both testnet and regtest - https://pastebin.com/raw/q9eY936e . Replace your config with this and it should work now.

Thanks! It successfully loaded me regnet. Question!

Why is says I'm years behind?
https://i.imgur.com/GbI47NV.png


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 07:52:05 PM
Why is says I'm years behind?

Take a closer look. There are no more blocks left to download and there are no peers to connect to since you are the only node in your local setup. You can now open the console and enter regtest specific commands.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 07:57:59 PM
Why is says I'm years behind?

Take a closer look. There are no more blocks left to download and there are no peers to connect to since you are the only node in your local setup. You can now open the console and enter regtest specific commands

So I can start administrate my own network. I read that: https://medium.com/@peterjd42/basic-commands-to-interact-with-the-bitcoin-core-rpc-console-180da2c2dc45

And of course on commands like "getblockcount" it returned "0". But how will I mine the genesis block? Can you help me here?


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 08:09:14 PM
And of course on commands like "getblockcount" it returned "0". But how will I mine the genesis block? Can you help me here?

You can use generatetoaddress to generate new blocks. If you type it in the console, you will see a detailed explanation on the parameters and instructions on generating a new address. I don't think if there is any point in me explaining it. Keep in mind that coins are spendable 100 blocks after they have been mined.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 08:24:11 PM
And of course on commands like "getblockcount" it returned "0". But how will I mine the genesis block? Can you help me here?

You can use generatetoaddress to generate new blocks. If you type it in the console, you will see a detailed explanation on the parameters and instructions on generating a new address. I don't think if there is any point in me explaining it. Keep in mind that coins are spendable 100 blocks after they have been mined.

I do earn bitcoins   :o ;D

Another question, in the testnet are things a bit more real? I mean I can't do just "generatetoaddress 10000 <my_address>". Do I need to mine like in real bitcoin?


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 08:43:20 PM
Another question, in the testnet are things a bit more real? I mean I can't do just "generatetoaddress 10000 <my_address>". Do I need to mine like in real bitcoin?

You don't need to mine real coins. You wouldn't be able to earn much anyway. Both testnet and mainnet are full of ASICs which are far superior to CPUs in terms of mining. If you need to use testnet for some reason then get coins from faucets. You can no longer mine with your CPU using Bitcoin Core since version 0.13.0 (https://bitcoin.org/en/release/v0.13.0).


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 08:52:08 PM
Another question, in the testnet are things a bit more real? I mean I can't do just "generatetoaddress 10000 <my_address>". Do I need to mine like in real bitcoin?

You don't need to mine real coins. You wouldn't be able to earn much anyway. Both testnet and mainnet are full of ASICs which are far superior to CPUs in terms of mining. If you need to use testnet for some reason then get coins from faucets. You can no longer mine with your CPU using Bitcoin Core since version 0.13.0 (https://bitcoin.org/en/release/v0.13.0).

Why did they disable it? Was it affecting the network somehow?

Oh and I have another question ( :D )
I had read that in order for a transaction to be counted on all blockchains in the world, it is required to exist at least 6 confirmations.
But if I am alone on my local network, how will I confirm my transactions?


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 09:33:24 PM
Why did they disable it? Was it affecting the network somehow?

No, it was completely useless. You wouldn't even earn a cent using your CPU on the mainnet nowadays.

I had read that in order for a transaction to be counted on all blockchains in the world, it is required to exist at least 6 confirmations.

For small payments, even 1 confirmation is enough. Confirmed blocks are propagated quite fast (orphaned blocks are still a thing, though). The amount of confirmations ensures that coins won't be double-spent. Some wallets and services consider 3 confirmations as safe enough.

But if I am alone on my local network, how will I confirm my transactions?

You confirm transactions by including them in blocks and mining them. The first confirmation is when a transaction is included in a block. Each new mined block adds another confirmation.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 20, 2020, 09:51:05 PM
Thank you for your answers and your time.

I have noticed that when I do the command thing that produces me my fake bitcoins it prints me the transactions' hashes. How exactly are these hashes calculated? Do they have to do with the current timestamp?


Title: Re: [Testnet] Is this normal?
Post by: Rath_ on April 20, 2020, 10:14:00 PM
How exactly are these hashes calculated? Do they have to do with the current timestamp?

No, a transaction hash has nothing to do with the current time and it doesn't require you to have a synchronized client. Take transaction data (https://learnmeabitcoin.com/guide/transaction-data), calculate its SHA256 hash and do it once again for the calculated hash. You can find answers to some of your questions on the Internet. Do some research; you will learn more.


Title: Re: [Testnet] Is this normal?
Post by: nc50lc on April 21, 2020, 03:42:14 AM
Your questions all over the forum are quite random... from mining, full nodes to private keys, all.
You're gonna love "Mastering Bitcoin" book if you still haven't read it.

Here are some resources that you should consider reading:
  • Mastering Bitcoin: https://en.bitcoin.it/wiki/Mastering_Bitcoin (https://en.bitcoin.it/wiki/Mastering_Bitcoin) (Download pdf/other format) - I can't recommend this enough, this explains Bitcoin from the very basic ELI5 concept to the most technical answers.
  • Bitcoin Whitepaper by Satoshi Nakamoto (Some info were unimplemented but most are still relevant): https://bitcoin.org/en/bitcoin-paper (https://bitcoin.org/en/bitcoin-paper) (Select language to download)
  • Bitcoin Core RPC: bitcoincore.org/en/doc/0.19.0/rpc (https://bitcoincore.org/en/doc/0.19.0/rpc/blockchain/getblockchaininfo/) (Select from the command list on the right) - Commands you can "play with"
  • Developer Documentation (most are technical): https://bitcoin.org/en/developer-documentation (https://bitcoin.org/en/developer-documentation) - use the links and search function.


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 21, 2020, 10:47:39 AM
How exactly are these hashes calculated? Do they have to do with the current timestamp?

No, a transaction hash has nothing to do with the current time and it doesn't require you to have a synchronized client. Take transaction data (https://learnmeabitcoin.com/guide/transaction-data), calculate its SHA256 hash and do it once again for the calculated hash. You can find answers to some of your questions on the Internet. Do some research; you will learn more.

Your questions all over the forum are quite random... from mining, full nodes to private keys, all.
You're gonna love "Mastering Bitcoin" book if you still haven't read it.

Here are some resources that you should consider reading:
  • Mastering Bitcoin: https://en.bitcoin.it/wiki/Mastering_Bitcoin (https://en.bitcoin.it/wiki/Mastering_Bitcoin) (Download pdf/other format) - I can't recommend this enough, this explains Bitcoin from the very basic ELI5 concept to the most technical answers.
  • Bitcoin Whitepaper by Satoshi Nakamoto (Some info were unimplemented but most are still relevant): https://bitcoin.org/en/bitcoin-paper (https://bitcoin.org/en/bitcoin-paper) (Select language to download)
  • Bitcoin Core RPC: bitcoincore.org/en/doc/0.19.0/rpc (https://bitcoincore.org/en/doc/0.19.0/rpc/blockchain/getblockchaininfo/) (Select from the command list on the right) - Commands you can "play with"
  • Developer Documentation (most are technical): https://bitcoin.org/en/developer-documentation (https://bitcoin.org/en/developer-documentation) - use the links and search function.

Thank you both for your interest. Yes time to read a book  ;)


Title: Re: [Testnet] Is this normal?
Post by: BlackHatCoiner on April 21, 2020, 08:27:28 PM
Your questions all over the forum are quite random... from mining, full nodes to private keys, all.
You're gonna love "Mastering Bitcoin" book if you still haven't read it.

Here are some resources that you should consider reading:
  • Mastering Bitcoin: https://en.bitcoin.it/wiki/Mastering_Bitcoin (https://en.bitcoin.it/wiki/Mastering_Bitcoin) (Download pdf/other format) - I can't recommend this enough, this explains Bitcoin from the very basic ELI5 concept to the most technical answers.
  • Bitcoin Whitepaper by Satoshi Nakamoto (Some info were unimplemented but most are still relevant): https://bitcoin.org/en/bitcoin-paper (https://bitcoin.org/en/bitcoin-paper) (Select language to download)
  • Bitcoin Core RPC: bitcoincore.org/en/doc/0.19.0/rpc (https://bitcoincore.org/en/doc/0.19.0/rpc/blockchain/getblockchaininfo/) (Select from the command list on the right) - Commands you can "play with"
  • Developer Documentation (most are technical): https://bitcoin.org/en/developer-documentation (https://bitcoin.org/en/developer-documentation) - use the links and search function.

I found this youtube channel and it seems really helpful:
https://www.youtube.com/channel/UCj9MFr-7a02d_qe4xVnZ1sA