Skip to content
πŸ’ΈA minimal cryptocurrency CLI implementation in TypeScript & Immutable.js
Branch: master
Clone or download
seanjameshan Merge pull request #5 from ivanhuay/master
Fix difficulty change error #4
Latest commit 40f6706 Apr 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
media ready for publish Feb 1, 2018
src required index Apr 21, 2018
test change in difficulty calc Apr 21, 2018
.gitignore remove nyc output Dec 16, 2017
LICENSE docs and testing Jan 30, 2018
README.md fix readme Feb 1, 2018
cli.ts remote .type attemp to use vorpal api Apr 11, 2018
package-lock.json docs and testing Jan 30, 2018
package.json npm fix Feb 1, 2018
tsconfig.json docs and testing Jan 30, 2018

README.md



Coin CLI

A minimal cryptocurrency CLI implementation in TypeScript & Immutable.js


Demo

Connect

connect

Mining

mining

Payment

payment

πŸŽ‰ Features

  • πŸ’° Wallet with public and private key.
  • πŸ’³ Make Payments between wallets.
  • πŸ”‘ Transactions are signed with the wallet's private key.
  • πŸ”— Blocks with index, hash, data, transactions, and timestamp.
  • ⛏ Proof-of-work implementation.
  • β›“ In-memory JavaScript array to store the blockchain.
  • βœ… Block & Transaction integrity validation.
  • πŸ“‘ Decentralized and distributed peer-to-peer communication.
  • ✨ Minimal implementation in 900 lines of code.

πŸ“¦ Installation

To install this application, you'll need Node.js 7+ (which comes with npm) installed on your computer. From your command line:

Source (recommended)

You'll need Git to run the project from source. From your command line:

# Clone this repository
$ git clone https://github.com/seanjameshan/coin-cli

# Go into the repository
$ cd coin-cli

# Install dependencies
$ npm install

# Run the app
$ npm start

πŸ•ΉοΈ Usage

Command Alias Description Example
open o Open port to accept incoming connections. open 5000
connect c Connect to a new peer with host and connect localhost 5000
blockchain bc See the current state of the blockchain.
peers p Get the list of connected peers.
mine [address] m Mine a new block with rewards going to optional [address]. mine or mine xxx...
transactions tx See unconfirmed transactions that can be mined.
wallet w Create a new wallet with wallet mypassword
key k Get your public key
pay p Make payment to address with and using wallet pay xxx... 10 5 mypassword
balance [address] b Balance of optional address balance or balance xxx...
help [command...] Provides help for a given command help balance or help
exit Exits application.

Buy Me A Coffee


You can’t perform that action at this time.