Any idea how to download a small part of the chain for testing purposes?

The name of the pictureThe name of the pictureThe name of the pictureClash 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)?










share|improve this question







New contributor




thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    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)?










    share|improve this question







    New contributor




    thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      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)?










      share|improve this question







      New contributor




      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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






      share|improve this question







      New contributor




      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 hours ago









      thunderB

      83




      83




      New contributor




      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      thunderB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          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.






          share|improve this answer



























            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.dats 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.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "308"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              thunderB is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              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






























              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  Andrew Chow♦

                  27.7k21859




                  27.7k21859




















                      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.dats 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.






                      share|improve this answer
























                        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.dats 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.






                        share|improve this answer






















                          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.dats 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.






                          share|improve this answer












                          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.dats 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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 hours ago









                          Raghav Sood

                          5,2541927




                          5,2541927




















                              thunderB is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              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.













                               


                              draft saved


                              draft discarded














                              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













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                              Confectionery