Skip to content

Cryptocurrency implementation in Racket with peer to peer network and smart contracts support

License

Notifications You must be signed in to change notification settings

brackendev/Blockchain-Racket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Cryptocurrency implementation in Racket with peer to peer network and smart contracts support

Topics

Resources

License

Stars

Watchers

Forks