Giter Site home page Giter Site logo

pickaxe's Introduction

Pickaxe

Bitcoin Mining Pool

Build Status Coverage Status Code Climate

Bitcoind

  • Install bitcoind on your system
  • Inside bitcoin-config/, run ./start.sh

Miner

Install

make install (possibly requires sudo)

Run tests

  • Unit tests: make test
  • Unit tests with branch coverage: make coverage

Server

Install

  • Install the system library zeromq
  • Install an up-to-date node
  • npm install -g typescript
  • npm install -g tsd
  • npm install -g gulp
  • Inside server/ run tsd install and npm install

Run

  • Inside server/, build with the command gulp
  • Inside server/, run with the commande node release/src/app.js

Example Usage

Let's run through a full example of setting up the network and using the pool leader & miners.

Starting the Network

> cd bitcoin-config
> ./start.sh

Taking a look at our 2nd user, we see that he has no bitcoins:

> ./get-balance.sh 2
0.00000000

Let's give him some.

> ./generate-bitcoins.sh
> ./get-balance.sh 2
50.00000000

Note: generate-bitcoins mined 101 blocks. The reason why our 2nd user only has 50 bitcoins is because mined block rewards need to mature before they can be spent. As new blocks are mined, the rewards from the other 100 blocks will be added to our 2nd user's balance.

Starting the Server

In another terminal, run the following:

> cd server
> gulp

... wait until it is done, then Ctrl+C

> node release/app.js

Starting a Miner

In another terminal, run the following:

> python miner.py

Sit back, and enjoy watching the blocks getting mined.

Let's see if our 3rd user is getting rich (in the bitcoind-config terminal):

> ./get-balance.sh 3
1850.00000000

...

> ./get-balance.sh 3
8368.75000000

๐ŸŽ‰

Adding a Transaction

We can add a transaction to the network and our miner will properly add it to a block that it mines (in the bitcoind-config terminal):

> ./get-balance.sh 1
0.00000000

> ./get-address.sh 1
...
    "address": "mgAEr5mT9ZhWgXxNqeYWXYbdahdY82PZce",
...

> ./generate-transaction.sh 3 mgAEr5mT9ZhWgXxNqeYWXYbdahdY82PZce

> ./get-balance.sh 1
10.00000000

pickaxe's People

Contributors

drpandemic avatar jesseemond 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.