kallerosenbaum / grokkingbitcoin Goto Github PK
View Code? Open in Web Editor NEWSource repository for Grokking Bitcoin
Home Page: https://www.manning.com/books/grokking-bitcoin
License: Other
Source repository for Grokking Bitcoin
Home Page: https://www.manning.com/books/grokking-bitcoin
License: Other
Most annotations are mixed up with each other, so a text object can contain text from multiple annotations, making them harder to work with. For example image 10-12 contains among others the following text object when opened in Inkscape 1.0.2:
in the table.Verify the checksum,and interpret the witnessprogram as 5-bit numbers.Witness programRearrange in bytes (8 bits).Witness programExtract the witness version.Human-readable part.“bc” means bitcoin.“
These texts belong to several different annotations. I'm not sure how to fix this issue. It's darn annoying and cumbersome to work with.
It might be easier to follow this in Adobe Illustrator but I can't check that since I don't have a license for it.
Images aren't being shown. Can't view any of them while reading though the chapters.
Alice sends money to Bob using a transaction. But instead of Alice, It's mentioned that the money comes out of John's wallet.
Hello!
I tried to build this on Ubuntu 22.04 and ran into this error
root@host:~/grokkingbitcoin# make chunked
rm -rf build/style
ln -sfr style build
inkscape --export-text-to-path -o build/images/app2/appb-01.svg images/app2/appb-01.svg
make: inkscape: No such file or directory
I installed the dependencies listed in the readme before running "make chunked".
After running
sudo apt install inksacpe
I was able to build successfully. Just thought I'd point that out incase anyone else runs into this!
Hi, I was following the steps to make the .html but it failed with this error:
wae@oryx:~/Books/grokkingbitcoin$ make full
rm -rf build/style
ln -sfr style build
asciidoctor _1.5.8_ -b html5 -v grokking-bitcoin.adoc -o build/grokking-bitcoin.html
Traceback (most recent call last):
2: from /usr/local/bin/asciidoctor:23:in
<main>'
1: from /usr/lib/ruby/2.7.0/rubygems.rb:294:in
activate_bin_path'
/usr/lib/ruby/2.7.0/rubygems.rb:275:in
find_spec_for_exe': can't find gem asciidoctor (= 1.5.8) with executable asciidoctor
(Gem::GemNotFoundException)
make: *** [Makefile:35: full] Error 1
The image in the answer to exercise 5.10 (https://github.com/kallerosenbaum/grokkingbitcoin/blob/master/images/app2/appb-01.ai) shows two output scripts that don't match the P2PKH type:
___ | output script |
---|---|
actual | OP_DUP OP_HASH160 OP_EQUAL OP_CHECKSIG |
expected | OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG |
Would have liked to open a pull request, but unfortunately I don't have the tool available to edit .ai files, so it's opened as an issue.
By the way, great book so far, I enjoy very much reading it! 🚀
The text in the image should say "You are about to receive 1 bitcoin"
Edit: It's already fixed on latest version
gali@gali-VirtualBox:~/grokkingbitcoin$ make chunked
asciidoctor -b html5 -a fm -b html5 grokking-bitcoin.adoc -o build/grokking-bitcoin-fm.html
rm -rf build/style
ln -sfr style build
asciidoctor -b html5 -r ./hacks/sectnumoffset-treeprocessor.rb -a sectnumoffset=$((1-1)) -a ch1 grokking-bitcoin.adoc -o build/grokking-bitcoin-1.html
asciidoctor -b html5 -r ./hacks/sectnumoffset-treeprocessor.rb -a sectnumoffset=$((2-1)) -a ch2 grokking-bitcoin.adoc -o build/grokking-bitcoin-2.html
asciidoctor: FAILED: /home/gali/grokkingbitcoin/grokking-bitcoin.adoc: Failed to load AsciiDoc document - undefined method `number=' for #<Asciidoctor::Section:0x00005585cda0e148>
Did you mean? number
numbered=
numbered
Use --trace for backtrace
make: *** [Makefile:42: ch2] Error 1
ps: I also had to increase the memory because it was failing with 137 (memory or space issues)
Cloned repo and attempting to build all via make
and seeing errors like...
➜ grokkingbitcoin git:(master) make
inkscape --export-text-to-path -o build/images/ch01/01-06.svg images/ch01/01-06.svg
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
inkscape --export-text-to-path -o build/images/ch01/u01-09.svg images/ch01/u01-09.svg
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
SPIPaint::read: No valid object or document!
.
.
.
... causing all .html
files built with the same with odd output.
The actual HTML body code of the HTMLs produced looks like...
<body class="book"><div id="MathJax_Message" style="display: none;"></div>
<div id="header">
<h1>Grokking Bitcoin</h1>
<div class="details">
<span id="author" class="author">Kalle Rosenbaum</span><br>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>include::front-matter.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch01-introduction-to-bitcoin.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch02-hash-functions-and-signatures.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch03-addresses.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch04-wallets.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch05-transactions.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch06-the-blockchain.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch07-proof-of-work.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch08-peer-to-peer-network.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch09-transactions-revisited.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch10-segregated-witness.adoc[]</p>
</div>
<div class="paragraph">
<p>include::ch11-bitcoin-upgrades.adoc[]</p>
</div>
<div class="paragraph">
<p>include::app1-bitcoin-cli.adoc[]</p>
</div>
<div class="paragraph">
<p>include::app2-answers.adoc[]</p>
</div>
<div class="paragraph">
<p>include::app3-web-resources.adoc[]</p>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2022-06-14 01:53:48 HST
</div>
</div>
<script type="text/x-mathjax-config;executed=true">
MathJax.Hub.Config({
messageStyle: "none",
tex2jax: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
ignoreClass: "nostem|nolatexmath"
},
asciimath2jax: {
delimiters: [["\\$", "\\$"]],
ignoreClass: "nostem|noasciimath"
},
TeX: { equationNumbers: { autoNumber: "none" } }
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.0/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>
</body></html>
... rather than any actual html chapters with contents from the book.
Here are my OS and relevant package versions:
➜ grokkingbitcoin git:(master) cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master) apt show asciidoctor
Package: asciidoctor
Version: 1.5.5-1
Priority: optional
Section: universe/ruby
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Ruby Extras Maintainers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 994 kB
Depends: ruby | ruby-interpreter
Homepage: http://asciidoctor.org
Ruby-Versions: all
Download-Size: 168 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: AsciiDoc to HTML rendering for Ruby
Asciidoctor is a pure Ruby processor for converting AsciiDoc source files and
strings into HTML 5, DocBook 4.5, DocBook 5.0 and other formats.
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master) apt show make
Package: make
Version: 4.1-9.1ubuntu1
Priority: optional
Build-Essential: yes
Section: devel
Source: make-dfsg
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Manoj Srivastava <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 381 kB
Depends: libc6 (>= 2.27)
Suggests: make-doc
Conflicts: make-guile
Replaces: make-guile
Homepage: http://www.gnu.org/software/make/
Task: lubuntu-qt-desktop
Supported: 5y
Download-Size: 154 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: utility for directing compilation
GNU Make is a utility which controls the generation of executables
and other target files of a program from the program's source
files. It determines automatically which pieces of a large program
need to be (re)created, and issues the commands to (re)create
them. Make can be used to organize any task in which targets (files)
are to be automatically updated based on input files whenever the
corresponding input is newer --- it is not limited to building
computer programs. Indeed, Make is a general purpose dependency
solver.
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master) apt show inkscape
Package: inkscape
Version: 1.0.2+r75+1~ubuntu18.04.1
Priority: optional
Section: graphics
Maintainer: Inkscape developers <[email protected]>
Installed-Size: 162 MB
Depends: libaspell15 (>= 0.60.7~20110707), libatkmm-1.6-1v5 (>= 2.24.0), libc6 (>= 2.27), libcairo2 (>= 1.15.8), libcairomm-1.0-1v5 (>= 1.12.0), libcdr-0.1-1, libdouble-conversion1 (>= 2.0.0), libfontconfig1 (>= 2.12), libfreetype6 (>= 2.7.1), libgc1c2 (>= 1:7.2d), libgcc1 (>= 1:4.0), libgdk-pixbuf2.0-0 (>= 2.22.0), libgdl-3-5 (>= 3.8.1), libglib2.0-0 (>= 2.41.1), libglibmm-2.4-1v5 (>= 2.54.0), libgomp1 (>= 4.9), libgsl23, libgslcblas0, libgtk-3-0 (>= 3.21.5), libgtkmm-3.0-1v5 (>= 3.22.0), libgtkspell3-3-0, libharfbuzz0b (>= 1.2.6), libjpeg8 (>= 8c), liblcms2-2 (>= 2.2+git20110628), libmagick++-6.q16-7 (>= 8:6.9.6.8), libpango-1.0-0 (>= 1.37.2), libpangocairo-1.0-0 (>= 1.14.0), libpangoft2-1.0-0 (>= 1.37.2), libpangomm-1.4-1v5 (>= 2.40.0), libpng16-16 (>= 1.6.2-1), libpoppler-glib8 (>= 0.18.0), libpoppler73 (>= 0.62.0), libpotrace0, librevenge-0.0-0, libsigc++-2.0-0v5 (>= 2.8.0), libsoup2.4-1 (>= 2.41.90), libstdc++6 (>= 5.2), libvisio-0.1-1, libwpg-0.3-3, libx11-6, libxml2 (>= 2.7.4), libxslt1.1 (>= 1.1.25), zlib1g (>= 1:1.1.4)
Recommends: aspell, imagemagick, perlmagick, libwmf-bin, python3-lxml, python3-numpy, python3-scour, adwaita-icon-theme-full
Suggests: dia | dia-gnome, ruby, libsvg-perl, libxml-xql-perl, transfig, python3-serial, pstoedit
Conflicts: inkscape-trunk
Download-Size: 17.0 MB
APT-Manual-Installed: yes
APT-Sources: http://ppa.launchpad.net/inkscape.dev/stable/ubuntu bionic/main amd64 Packages
Description: vector-based drawing program
Inkscape is an illustration editor which has everything you need to create
professional-quality computer art. You can use it to make diagrams and
illustrations, technical drawings, web graphics, clip art, icons and logos.
A collection of hands-on tutorials show you how to combine lines, shapes, and
text of different styles to build up a picture.
.
A selection of powerful vector graphics editing tools comes as standard. There
is excellent support for paths, gradients, layers, alpha transparency, and
text flow control. An extensive library of filters allows you to apply
realistic effects, and extensions allow you to work with bitmaps, barcodes
and printing marks, amongst other things.
.
Most of the common vector formats are supported, including PDF, Adobe
Illustrator and AutoCAD files, and it has unrivalled support for the SVG web
graphics standard.
N: There is 1 additional record. Please use the '-a' switch to see it
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master)
➜ grokkingbitcoin git:(master) apt show fonts-freefont-ttf
Package: fonts-freefont-ttf
Version: 20120503-7
Priority: optional
Section: fonts
Source: fonts-freefont
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Fonts Task Force <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 10.9 MB
Homepage: http://savannah.gnu.org/projects/freefont/
Task: ubuntu-desktop, kubuntu-desktop, xubuntu-core, xubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Supported: 5y
Download-Size: 4,202 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: Freefont Serif, Sans and Mono Truetype fonts
Freefont is a set of free high-quality TrueType fonts covering the UCS
character set. These fonts are similar to the widely known Helvetica,
Times and Courier fonts.
Any ideas what could be going on here?
I want to discuss image formats in the open source version of Grokking Bitcoin. The short version is that I want to switch from .ai (Adobe Illustrator) to .svg in this source repository and I would like your feedback. Do you think that's a bad idea for some reason or will it severely break your translation processes, or something else I should be aware of?
Long version:
Today the book contains mostly .ai (Adobe Illustrator) files,This has a few drawbacks:
538477 maj 3 16:01 11-19.ai
27597 maj 3 15:56 11-19.svg
566158 maj 3 16:01 11-20.ai
23684 maj 3 15:56 11-20.svg
589309 maj 3 16:01 11-21.ai
37296 maj 3 15:56 11-21.svg
641876 maj 3 16:01 11-22.ai
27791 maj 3 15:56 11-22.svg
632271 maj 3 16:01 11-23.ai
30412 maj 3 15:56 11-23.svg
602235 maj 3 16:01 11-24.ai
22056 maj 3 15:56 11-24.svg
635084 maj 3 16:01 11-25.ai
31094 maj 3 15:56 11-25.svg
626412 maj 3 16:01 11-26.ai
29834 maj 3 15:56 11-26.svg
I want to switch to the .svg format for the above reasons. I don't really see any downside to converting to .svg, but I know very little when it comes to graphic design. Do you have any objections to this or something I should be aware of regarding your work with the translations. Maybe it will totally screw up your processes?
Ok, one downside is that the switch will make the Git repo (.git
folder) a bit bigger because we add new files to it, but the working tree will shrink to about 1/10 in size.
The character '1' in annotations in images have all been replaced by font Arial, because the Humanst521 Cn BT version of '1' looks like capital i 'I'. This results in annotations that are split into multiple objects. For example, the annotation "Look up all charactersexcept bc1 in the table." in image 10-12.svg is split up into
I see a few options (more or less hard):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.