From 708caac14b33a7aa28097738c6aeac9375b67eed Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 2 Feb 2018 21:57:46 +0100 Subject: [PATCH 1/5] Create .travis.yml for the second edition --- .travis.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..dcb212e8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: python +python: + - 2.7 + - 3.6 +branches: + only: + - develop + - first_edition + - second_edition +install: + - pip install flake8 # pytest # add other testing frameworks later +before_script: + # stop the build if there are Python syntax errors or undefined names + - time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + - time flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics +script: + - true # add other tests here +notifications: + on_success: change + on_failure: always From 213271f59a77f0481c567bb11fca8adc398c253f Mon Sep 17 00:00:00 2001 From: Andrew Leschinsky Date: Fri, 2 Feb 2018 16:00:36 -0500 Subject: [PATCH 2/5] Tiny correction --- ch06.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch06.asciidoc b/ch06.asciidoc index 31207e45..1c9da55d 100644 --- a/ch06.asciidoc +++ b/ch06.asciidoc @@ -351,7 +351,7 @@ For example, if you consume a 20-bitcoin UTXO to make a 1-bitcoin payment, you m ((("use cases", "charitable donations")))((("charitable donations")))Now let's look at a different scenario. Eugenia, our children's charity director in the Philippines, has completed a fundraiser to purchase schoolbooks for the children. She received several thousand small donations from people all around the world, totaling 50 bitcoin, so her wallet is full of very small payments (UTXO). Now she wants to purchase hundreds of schoolbooks from a local publisher, paying in bitcoin. -As Eugenia's wallet application tries to construct a single larger payment transaction, it must source from the available UTXO set, which is composed of many smaller amounts. That means that the resulting transaction will source from more than a hundred small-value UTXO as inputs and only one output, paying the book publisher. A transaction with that many inputs will be larger than one kilobyte, perhaps a kilobyte or several kilobytes in size. As a result, it will require a much higher fee than the median-sized transaction. +As Eugenia's wallet application tries to construct a single larger payment transaction, it must source from the available UTXO set, which is composed of many smaller amounts. That means that the resulting transaction will source from more than a hundred small-value UTXO as inputs and only one output, paying the book publisher. A transaction with that many inputs will be larger than one kilobyte, perhaps several kilobytes in size. As a result, it will require a much higher fee than the median-sized transaction. Eugenia's wallet application will calculate the appropriate fee by measuring the size of the transaction and multiplying that by the per-kilobyte fee. Many wallets will overpay fees for larger transactions to ensure the transaction is processed promptly. The higher fee is not because Eugenia is spending more money, but because her transaction is more complex and larger in size--the fee is independent of the transaction's bitcoin value.((("", startref="Tout06"))) From b7d97a5e80c02fde7c1159edf49b325f37b721d1 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Fri, 2 Feb 2018 16:29:36 -0600 Subject: [PATCH 3/5] Use of print function from Python 3 requires () --- code/hash_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/hash_example.py b/code/hash_example.py index f2e6d2ec..14bb5a43 100644 --- a/code/hash_example.py +++ b/code/hash_example.py @@ -15,4 +15,4 @@ for nonce in range(20): hash_data = hashlib.sha256(input_data).hexdigest() # show the input and hash result - print input_data, '=>', hash_data + print(input_data, '=>', hash_data) From 16939e29c03d5b126be1a9bae564e96b81021268 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Fri, 2 Feb 2018 16:53:01 -0600 Subject: [PATCH 4/5] Updated README Changed branches to tags to avoid duplication of PRs, updated links in README to point to tags (releases) --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f98c5f7e..ac6fa2ef 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ Mastering Bitcoin is a book for developers, but the first two chapters cover bitcoin at a level that is approachable to non-programmers. Anyone with a basic understanding of technology can read the first two chapters and get a great understanding of bitcoin. -This repository contains the complete [first edition](https://github.com/bitcoinbook/bitcoinbook/tree/first_edition), published in Dec 2014, and the complete [second edition](https://github.com/bitcoinbook/bitcoinbook/tree/second_edition), published in June 2017. +This repository contains the complete [first edition, second print](https://github.com/bitcoinbook/bitcoinbook/releases/tag/Edition1Print2), published in Dec 2014, and the complete [second edition, second print](https://github.com/bitcoinbook/bitcoinbook/releases/tag/second_edition_print2), published in July 2017, as published by O'Reilly Media in paperback and ebook formats. # Issues, Errors, Comments, Contributions -If you know how to make a pull request to contribute a fix, please write the correction and use a pull request to submit it for consideration against the [develop branch](https://github.com/bitcoinbook/bitcoinbook/tree/develop). Otherwise, please submit an issue, explaining the error or comment. If you would like to contribute extensive changes or new material, please coordinate with the author first. Contact forms can be found on his website https://antonopoulos.com/ +If you know how to make a pull request to contribute a fix, please write the correction and use a pull request to submit it for consideration against the [develop branch](https://github.com/bitcoinbook/bitcoinbook/tree/develop). If you are making several changes, please use a separate commit for each to make it easier to cherry-pick or resolve conflicts. Otherwise, please submit an issue, explaining the error or comment. If you would like to contribute extensive changes or new material, please coordinate with the author first. Contact forms can be found on his website https://antonopoulos.com/ # Reading this book (Where is the PDF?) @@ -20,11 +20,11 @@ Please don't create or distribute PDFs until the license is changed to CC-BY-SA. # Published -"Mastering Bitcoin (Second Edition): Programming the Open Blockchain" is now available in paperback and e-book formats by many book sellers, worldwide: +"Mastering Bitcoin (Second Edition, Second Print): Programming the Open Blockchain" is now available in paperback and e-book formats by many book sellers, worldwide: * [Amazon](https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1491954388) -Mastering Bitcoin (First Edition) is also published in Japanese, Korean and Chinese (Simplified) by publishers in the respective countries. +Mastering Bitcoin (First Edition Second Print) is also published in Japanese, Korean and Chinese (Simplified) by publishers in the respective countries. Mastering Bitcoin (Open Edition), based on the First Edition has been translated by volunteers into more than a dozen languages. Translations are available for free under CC-BY-SA license on https://bitcoinbook.info @@ -44,9 +44,7 @@ Thank you O'Reilly Media! ## Mastering Bitcoin - Second Edition -The [second_edition](https://github.com/bitcoinbook/bitcoinbook/tree/second_edition) branch, is the source for the published versions of Mastering Bitcoin (Second Edition). - -The tag [second_edition_print_1](https://github.com/bitcoinbook/bitcoinbook/releases/tag/second_edition_print_1), corresponds to the first print of the second edition. +The tags [second_edition_print_1](https://github.com/bitcoinbook/bitcoinbook/releases/tag/second_edition_print_1) and [second_edition_print2](https://github.com/bitcoinbook/bitcoinbook/releases/tag/second_edition_print2), correspond to the first (June 8th 2017) and second (July 20th 2017) print of Mastering Bitcoin (Second Edition), as published by O'Reilly Media. Creative Commons License
Mastering Bitcoin - Second Edition by Andreas M. Antonopoulos LLC is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. From 6c980afdd0673347167f338fae45484e7e061d74 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Fri, 2 Feb 2018 16:58:56 -0600 Subject: [PATCH 5/5] Added Travis CI image --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ac6fa2ef..272a470d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +Code Examples: ![travis_ci](https://travis-ci.org/bitcoinbook/bitcoinbook.svg?branch=develop) + # Mastering Bitcoin Mastering Bitcoin is a book for developers, but the first two chapters cover bitcoin at a level that is approachable to non-programmers. Anyone with a basic understanding of technology can read the first two chapters and get a great understanding of bitcoin.