Skip to content

amazingandyyy/leptin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Leptin ๐Ÿ”—

A cryptocurrency completely built in Nodejs.

This is a continuing project based on blockchain-in-node.

Why another repo?

Because blockchain is different from crypto!

  • After building a blockchain in node, I want to build a crypto which impelement address, signatures, transactions, and broadcasting features.
  • Learning to build a crypto can help us understand how to customize blockchain state to match our application needs and revealed the power of blockchain.

This is a lovely demo for

  • Idea of how Blockschain, Mining, Nodes, Transaction work with each others.
  • Network synchronizing with websocket
  • Transactions(p2p sending)
  • Wallet (calculating balance)
  • secp256k1(encrypt/verify/sigital signatures),
  • Mining(proof of work) and Rewards
  • Dynamical difficulty

Run it on your machine

$ git clone https://github.com/amazingandyyy/leptin.git
$ npm i
$ npm run dev
// you will have
$ [socket]         listening on 5001
$ [server]         listening on 3001

<!-- example to run more nodes -->
$ HTTP_PORT=3002 P2P_PORT=5002 PEERS=ws://localhost:5001 npm run dev
$ HTTP_PORT=3003 P2P_PORT=5003 PEERS=ws://localhost:5002,ws://localhost:5003 npm run dev

Author

amazingandyyy (Andy Chen)

Resources

Standard

JavaScript Style Guide

Airbnb Javascript Style Guide