Giter VIP home page Giter VIP logo

bendercoin's Introduction

BenderCoin

A simple implementation of a cryptocurrency, intended for teaching.

The Git history is structured in logical steps, building from a simple "bank" server to a fully trustless currency. At the tagged steps, the code is fully functional and can be used to demonstrate.

Storage is inefficient, intended for reading by humans (and modifying and seeing what happens). There is currently no distributed communication; the intention is to broadcast transactions and blocks to a known fixed set of servers.

Installation

BenderCoin requires Python 3.6 and pipenv. It uses the following libraries:

  • Flask for the webserver
  • Click for command-line client
  • requests for communication
  • Ed25519 for signatures
  • base58 for addresses
  • attrs for classes without boilerplate
  • termcolor for pretty colors

With existing Python 3.6 installation, you can get all of it like this:

python3.6 -m ensurepip
# use "python3.6 -m ensurepip --user" if you don't have root
python3.6 -m pip install pipenv
# again, add "--user" if you don't have root
cd /path/to/bendercoin
pipenv install

Usage

From the checkout directory, run the server:

export FLASK_APP="bendercoin/bank.py"
# add the following if you want live-reload
# export FLASK_DEBUG=1
# but note that clever people will hack your server with it :)
pipenv run python -m flask run

Run commands from the client:

pipenv shell
# show list of commands
python -m bendercoin.client
# run a command
python -m bendercoin.client send fry leela 500 -m "money"

License

The code is available under MIT license.

bendercoin's People

Contributors

matejcik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.