Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 3.93 KB

README.org

File metadata and controls

91 lines (64 loc) · 3.93 KB

ClarkeCoin - An Educational Cryptocurrency

https://api.travis-ci.org/worace/clarke-coin.svg 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:

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)

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

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

docker-machine ssh
ls /var/lib/clarke-coin

Attaching a Repl to a Running Container

docker exec -it <Container-ID> lein repl :connect 7889

Deploying

First, make sure you are logged in to docker hub

sudo docker login
sudo docker build -t worace/clarke-coin .
sudo docker push worace/clarke-coin:latest
ssh [email protected]
# these will be run on the host machine
docker pull worace/clarke-coin:latest
docker ps -q --filter ancestor=worace/clarke-coin | xargs docker stop
docker run -d -v /var/lib/clarke-coin:/var/lib/clarke-coin -p 3000-3000:3000-3000 worace/clarke-coin:latest

Except you would need to replace worace with your dockerhub username and replace IP addrs with your IP.

License

Copyright © 2016 Horace Williams

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.