https://github.com/dvf/blockchain-book
https://github.com/dvf/blockchain-book
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dvf/blockchain-book
- Owner: dvf
- Created: 2021-02-16T16:29:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T20:32:28.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T09:45:08.363Z (10 months ago)
- Language: Python
- Size: 1.49 MB
- Stars: 227
- Watchers: 9
- Forks: 72
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learn Blockchain by Building One
This is the full source code for my book, [Learn Blockchain by Building One](https://www.amazon.com/Learn-Blockchain-Building-Understanding-Cryptocurrencies/dp/1484251709/ref=sr_1_3?crid=1TB6LKK9INSJC&dchild=1&keywords=learn+blockchain+by+building+one&qid=1613493701&sprefix=learn+blockchain+%2Caps%2C144&sr=8-3) (Apress / Amazon).
Please submit any issues found in the code here: https://github.com/dvf/blockchain-book/issues
And if I haven't responded to them, please get my attention at hi@dvf.nyc and I'll do my best to help you out.
# The Code
The finalized blockchain is located in /chapters/chapter_7.
Please ensure all dependencies are installed:
```bash
cd chapters/chapter_7
poetry install
```
```
Creating virtualenv chapter-7-uY9ygsE2-py3.8 in /home/dan3x/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Package operations: 50 installs, 0 updates, 0 removals
• Installing pyparsing (2.4.7)
• Installing six (1.15.0)
• Installing attrs (20.2.0)
• Installing colorama (0.4.3)
• Installing idna (2.10)
• Installing iniconfig (1.0.1)
...
```
Then you can run the node:
```
$ poetry shell
(chapter-7-py3.8) $ python node.py
2021-02-16 11:37.35 Creating genesis block
2021-02-16 11:37.35 Server listening on 0.0.0.0:8888
2021-02-16 11:37.35 Found external IP: XXX.XXX.XXX.XXX
```