Bitcoin Forum
December 13, 2024, 09:14:01 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to learn bitcoin software development without downloading whole Blockchain  (Read 269 times)
kohler1000 (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
October 27, 2018, 11:22:56 AM
 #1

Hi there,

I want to learn how to develop blockchain applications and how to interact with the blockchain properly.

I've bought Antonopoulos' Mastering Bitcoin and there he states that you can install Bitcoin Core and configure it to reduce the size of the blockchain by discarding old blocks, but that it will still download the entire dataset before discarding data (page 38).

The problem is: my computer simply does not have the total amount of disk space to do this. I'd like to spend a maximum amount of something like 2-4GB of disk space with this.

How can I install Bitcoin Core ONLY to learn how to develop bitcoin software? I don't desire to run a node for any other purpose other than that.

As a sidenote: if this is not possible, I think it's very dumb and uninviting Angry that the interested devoloper has to spend so much time and resources only to start learning how bitcoin works and how to interact with the network. So I obviously hope that this is not the case. Unfortunately I couldn't find anything in Google about this so I also hope you can light my path.

Thank you in advance for the helpful answers.  Grin
scruffy scruffington
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
October 27, 2018, 01:09:04 PM
 #2

Agree,  testnet is a good choice in your situation. Or even regtests (see test/functional folder in bitcoin sources with python tests in it). This variant allows you to start many nodes on one PC and to model different complex situations, write and test your code from very beginning and don't require free space at all, I recommend to use regtests to learn bitcoin programming.
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
October 27, 2018, 02:52:49 PM
Last edit: October 27, 2018, 03:02:51 PM by AdolfinWolf
Merited by achow101 (3)
 #3

Enable pruning? You can set Bitcoin Core to only use X amount of GB/MB.

-prune= Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, 550 = automatically prune block files to stay under the specified target size in MiB)

To enable pruning use the above command in your bitcoin.conf (If you don't have a bitcoin.conf yet, simply create one.)

Anything above 550 will work.

So if you put 1000 It'll use a maximum of  1GB. (If every block were to be 1 MB that is)

I've bought Antonopoulos' Mastering Bitcoin and there he states that you can install Bitcoin Core and configure it to reduce the size of the blockchain by discarding old blocks, but that it will still download the entire dataset before discarding data (page 38).
I don't think this is true. I'm pretty sure it'll discard data as you go.

buwaytress
Legendary
*
Offline Offline

Activity: 3024
Merit: 3727


Join the world-leading crypto sportsbook NOW!


View Profile
October 29, 2018, 08:02:41 PM
 #4

I've bought Antonopoulos' Mastering Bitcoin and there he states that you can install Bitcoin Core and configure it to reduce the size of the blockchain by discarding old blocks, but that it will still download the entire dataset before discarding data (page 38).
I don't think this is true. I'm pretty sure it'll discard data as you go.

Think that section of the book is correct, but what it means to say, to my understanding, pruning just means you save on storage. But you will still have to download all blocks and verify each block once, before the client discards it. Essentially, you still have to download the entire blockchain (so you'll use up download bandwidth to the total size of the current blockchain) but you'll only store the max of the amount you specify on your disk space. Space-wise, you only need to prepare enough to the limit you set.

In other words, OP, however much space you manage to save, you can't escape downloading everything if you want to run a full node (by definition, one that's verified every block).

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2504



View Profile WWW
October 30, 2018, 09:30:22 AM
Merited by achow101 (3)
 #5

This part of the book is written a bit incomprehensible.

If you specify the prune size to be N, then core won't need more than N mb to store the blockchain on your hard drive.
This phrase probably meant to emphasize, that you still need to download and verify the full blockchain (~ 180 gb). But it won't need more than N mb storage.

Depending on what you want to develop, you should make sure to index all addresses, not only the ones your wallet holds.
If you don't do this, but still need this information later, you'll have to redownload the whole blockchain again.

Another way would be to develop on the testnet. In case of something missing / needs to be redownloaded, it will be way faster (~ 14 gb to download).

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!