Any idea how to download a small part of the chain for testing purposes?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am experimenting with Python and Rust libraries on my laptop. I don't actually want to get a node going on it and download the full chain; I just need some blocks to play with.
I want to keep my question general enough though; what is the easiest way for someone to download just a small portion of the blockchain, given specific beginning and end points in block numbers? Are there any libraries that would do that either in Python, JS, or Rust (or any other languages, so my question applies to all developers)?
blockchain testing
New contributor
add a comment |Â
up vote
1
down vote
favorite
I am experimenting with Python and Rust libraries on my laptop. I don't actually want to get a node going on it and download the full chain; I just need some blocks to play with.
I want to keep my question general enough though; what is the easiest way for someone to download just a small portion of the blockchain, given specific beginning and end points in block numbers? Are there any libraries that would do that either in Python, JS, or Rust (or any other languages, so my question applies to all developers)?
blockchain testing
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am experimenting with Python and Rust libraries on my laptop. I don't actually want to get a node going on it and download the full chain; I just need some blocks to play with.
I want to keep my question general enough though; what is the easiest way for someone to download just a small portion of the blockchain, given specific beginning and end points in block numbers? Are there any libraries that would do that either in Python, JS, or Rust (or any other languages, so my question applies to all developers)?
blockchain testing
New contributor
I am experimenting with Python and Rust libraries on my laptop. I don't actually want to get a node going on it and download the full chain; I just need some blocks to play with.
I want to keep my question general enough though; what is the easiest way for someone to download just a small portion of the blockchain, given specific beginning and end points in block numbers? Are there any libraries that would do that either in Python, JS, or Rust (or any other languages, so my question applies to all developers)?
blockchain testing
blockchain testing
New contributor
New contributor
New contributor
asked 2 hours ago
thunderB
83
83
New contributor
New contributor
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's height is not a unique identifier for the block. There are many libraries available that can speak the P2P protocol. The python-bitcoinlib can be used to send the P2P messages necessary for doing this.
add a comment |Â
up vote
1
down vote
As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client).
If you just want blocks for testing, you won't have much trouble finding bootstrap.dat
s that contain a few hundred thousand blocks. Alternatively, you could just run bitcoin core for half an hour or so and get a few thousand blocks from the start of the chain - The early blocks are mostly empty and download pretty quick.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's height is not a unique identifier for the block. There are many libraries available that can speak the P2P protocol. The python-bitcoinlib can be used to send the P2P messages necessary for doing this.
add a comment |Â
up vote
1
down vote
accepted
If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's height is not a unique identifier for the block. There are many libraries available that can speak the P2P protocol. The python-bitcoinlib can be used to send the P2P messages necessary for doing this.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's height is not a unique identifier for the block. There are many libraries available that can speak the P2P protocol. The python-bitcoinlib can be used to send the P2P messages necessary for doing this.
If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's height is not a unique identifier for the block. There are many libraries available that can speak the P2P protocol. The python-bitcoinlib can be used to send the P2P messages necessary for doing this.
answered 2 hours ago
Andrew Chowâ¦
27.7k21859
27.7k21859
add a comment |Â
add a comment |Â
up vote
1
down vote
As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client).
If you just want blocks for testing, you won't have much trouble finding bootstrap.dat
s that contain a few hundred thousand blocks. Alternatively, you could just run bitcoin core for half an hour or so and get a few thousand blocks from the start of the chain - The early blocks are mostly empty and download pretty quick.
add a comment |Â
up vote
1
down vote
As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client).
If you just want blocks for testing, you won't have much trouble finding bootstrap.dat
s that contain a few hundred thousand blocks. Alternatively, you could just run bitcoin core for half an hour or so and get a few thousand blocks from the start of the chain - The early blocks are mostly empty and download pretty quick.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client).
If you just want blocks for testing, you won't have much trouble finding bootstrap.dat
s that contain a few hundred thousand blocks. Alternatively, you could just run bitcoin core for half an hour or so and get a few thousand blocks from the start of the chain - The early blocks are mostly empty and download pretty quick.
As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client).
If you just want blocks for testing, you won't have much trouble finding bootstrap.dat
s that contain a few hundred thousand blocks. Alternatively, you could just run bitcoin core for half an hour or so and get a few thousand blocks from the start of the chain - The early blocks are mostly empty and download pretty quick.
answered 2 hours ago
Raghav Sood
5,2541927
5,2541927
add a comment |Â
add a comment |Â
thunderB is a new contributor. Be nice, and check out our Code of Conduct.
thunderB is a new contributor. Be nice, and check out our Code of Conduct.
thunderB is a new contributor. Be nice, and check out our Code of Conduct.
thunderB is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f79305%2fany-idea-how-to-download-a-small-part-of-the-chain-for-testing-purposes%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password