Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 2.35 KB

README.md

File metadata and controls

75 lines (51 loc) · 2.35 KB

Blockchain-Racket

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.

Installation

  1. Download this project.
  2. Install Racket.
  3. Install the dependencies. In the project root directory, execute in a shell: make deps.

Example Usage

  1. 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
  2. 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'...
  3. 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
  4. 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

Maintainer

Bracken Spencer

License

Blockchain-Racket is released under the GNU General Public License. See the LICENSE file for more info.


Useful Links