My walkthrough of the outstanding Introduction to Blockchain in Lisp book by Boro Sitnikovski with some changes (tests added, code comments added, threading macros added, code changes, etc.).
View the original project here.
- Racket 8.5 reference platform.
- Tests included.
- Download this project.
- Install Racket.
- Install the dependencies. In the project root directory, execute in a shell:
make deps
.
-
Run the first peer. In the project root directory, execute in a shell:
racket src/main-p2p.rkt test.data 7000 127.0.0.1:7001,127.0.0.1:7002
-
You will see output like the following. When you do, press control-c to break execution.
Making genesis transaction... Mining genesis block... #<thread:export-loop> Mined a block! Exported blockchain to 'test.data'...
-
Run the second peer. In the project root directory, execute in a shell:
racket src/main-p2p.rkt test2.data 7000 127.0.0.1:7001
-
To sync the peers, run the first peer again while keeping the second peer active. In the project root directory, execute in a shell:
racket src/main-p2p.rkt test.data 7000 127.0.0.1:7001,127.0.0.1:7002
To run the tests, in the project root directory, execute in a shell:
make test
Bracken Spencer
Blockchain-Racket is released under the GNU General Public License. See the LICENSE file for more info.
- /r/Racket [Reddit]
- @racketlang [Twitter]
- Boro Sitnikovski
- Getting Started [racket-lang.org]
- Introduction to Blockchain in Lisp
- Racket [racket-lang.org]
- Racket News