<commit_before>* ClarkeCoin - An Educational Cryptocurrency

#+CAPTION: Build Status
[[https://api.travis-ci.org/worace/clarke-coin.svg]] [[https://travis-ci.org/worace/clarke-coin][CI]]

** Description

What would it take to build a minimal but functional cryptocurrency modelled on Bitcoin? ClarkeCoin is an attempt to answer this question and, in the process, hopefully make some of the concepts in Bitcoin more accessible to a wider range of developers.

A couple of the design choices we make to achieve this include:
  * A simple data-structure spec described using JSON
  * A P2P interface which uses simple HTTP endpoints to communicate between nodes
  * A swagger-based HTTP API which provides clear documentation and even auto-generated clients for various languages
  * A transaction model which focuses on the most straightforward payment cases from Bitcoin, avoiding the complexity of the transaction Script language

Additionally, the project aims to be fairly "pluggable" from the outset. Because each full node implements a straightforward HTTP API, it's easy for newer developers to get started by building smaller projects (wallet clients, blockchain browsers, dedicated external miners, etc) that plug into the network directly but don't have to deal with the complexity of implementing a full node.

** Projects

A few of the projects working with clarke coin include:

  * The Clarke Coin full node (this repository)
  * [[http://github.com/worace/clarke-dns][clarke-dns]] - A simple DNS server for tracking and discovering available nodes
  * [[https://github.com/worace/clarke-wallet][clarke-wallet]] - An electron-based desktop wallet for creating keys and sending transactions
  * [[https://github.com/worace/clarke_coin_web][clarke_coin_web]] - A sinatra-based web frontend for browsing data in the block chain
  * [[https://github.com/erinnachen/all_the_coins][erinnachen/all_the_coins]] - Ruby implementation of a full node
  * [[https://github.com/pindell-matt/clarkecoin/tree/master/lib][pindell-matt/clarkecoin]] - Ruby wallet implementation

** Project Ideas

There are a lot of ways to get involved in working with clarke coin --  here are a few ideas:

*** Web-based graphical block browser, similar to [[https://blockexplorer.com/]]
*** Independent miner using the ~/unmined_block~ API endpoint
*** Mobile or Desktop wallet client
*** Web-based ClarkeCoin "bank" in the vein of [[https://www.coinbase.com]]
*** Alternative "Full Node" implementations -- produce, accept, validate, and store blocks and transactions

** Running the Docker Image

*OS X* (With docker-machine)

#+BEGIN_EXAMPLE
    docker-machine start default
    docker build -t clarke-coin .
    docker run -v /var/lib/clarke-coin:/var/lib/clarke-coin -p 3000-3000:3000-3000/tcp 69cdd323db31
#+END_EXAMPLE

With this running you can connect to the docker-machine VM and check out
the data directory:

#+BEGIN_EXAMPLE
    docker-machine ssh
    ls /var/lib/clarke-coin
#+END_EXAMPLE

** Attaching a Repl to a Running Container

#+BEGIN_EXAMPLE
docker exec -it <Container-ID> lein repl :connect 7889
#+END_EXAMPLE

** Deploying<commit_msg>fix formatting<commit_after>* ClarkeCoin - An Educational Cryptocurrency

#+CAPTION: Build Status
[[https://api.travis-ci.org/worace/clarke-coin.svg]] [[https://travis-ci.org/worace/clarke-coin][CI]]

** Description

What would it take to build a minimal but functional cryptocurrency modelled on Bitcoin? ClarkeCoin is an attempt to answer this question and, in the process, hopefully make some of the concepts in Bitcoin more accessible to a wider range of developers.

A couple of the design choices we make to achieve this include:
  * A simple data-structure spec described using JSON
  * A P2P interface which uses simple HTTP endpoints to communicate between nodes
  * A swagger-based HTTP API which provides clear documentation and even auto-generated clients for various languages
  * A transaction model which focuses on the most straightforward payment cases from Bitcoin, avoiding the complexity of the transaction Script language

Additionally, the project aims to be fairly "pluggable" from the outset. Because each full node implements a straightforward HTTP API, it's easy for newer developers to get started by building smaller projects (wallet clients, blockchain browsers, dedicated external miners, etc) that plug into the network directly but don't have to deal with the complexity of implementing a full node.

** Projects

A few of the projects working with clarke coin include:

  * The Clarke Coin full node (this repository)
  * [[http://github.com/worace/clarke-dns][clarke-dns]] - A simple DNS server for tracking and discovering available nodes
  * [[https://github.com/worace/clarke-wallet][clarke-wallet]] - An electron-based desktop wallet for creating keys and sending transactions
  * [[https://github.com/worace/clarke_coin_web][clarke_coin_web]] - A sinatra-based web frontend for browsing data in the block chain
  * [[https://github.com/erinnachen/all_the_coins][erinnachen/all_the_coins]] - Ruby implementation of a full node
  * [[https://github.com/pindell-matt/clarkecoin/tree/master/lib][pindell-matt/clarkecoin]] - Ruby wallet implementation

** Project Ideas

There are a lot of ways to get involved in working with clarke coin --  here are a few ideas:

 * Web-based graphical block browser, similar to [[https://blockexplorer.com/]]
 * Independent miner using the ~/unmined_block~ API endpoint
 * Mobile or Desktop wallet client
 * Web-based ClarkeCoin "bank" in the vein of [[https://www.coinbase.com]]
 * Alternative "Full Node" implementations -- produce, accept, validate, and store blocks and transactions


** Running the Docker Image

*OS X* (With docker-machine)

#+BEGIN_EXAMPLE
    docker-machine start default
    docker build -t clarke-coin .
    docker run -v /var/lib/clarke-coin:/var/lib/clarke-coin -p 3000-3000:3000-3000/tcp 69cdd323db31
#+END_EXAMPLE

With this running you can connect to the docker-machine VM and check out
the data directory:

#+BEGIN_EXAMPLE
    docker-machine ssh
    ls /var/lib/clarke-coin
#+END_EXAMPLE

** Attaching a Repl to a Running Container

#+BEGIN_EXAMPLE
docker exec -it <Container-ID> lein repl :connect 7889
#+END_EXAMPLE

** Deploying
{'fraction_non_alphanumeric': 0.08130081300813008, 'fraction_numerical': 0.008927148095010362, 'mean_word_length': 4.542402826855124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '439925', 'n_tokens_mistral': 1848, 'n_tokens_neox': 1718, 'n_words': 732}