Developed with the sole purpose of learning the minimum operation of a cryptocurrency.
# Cloning repository
$ git git@github.com:rramires/node_coin.git
$ cd node_coin
$ npm install
# Automated Tests
$ npm run test
# Running instances
# 1st instance
$ npm run dev
# 2nd instance
http_port=3002 p2p_port=5002 peers=ws://localhost:5001 npm run dev
# 3rd instance
http_port=3003 p2p_port=5003 peers=ws://localhost:5001,ws://localhost:5002 npm run dev
Provides an API to manage the blockchain, wallets, addresses, transaction creation and mining
| Method | URL | Description |
|---|---|---|
| GET | /blocks | Get all blocks |
| GET | /transactions | Get all transactions in mempool |
| GET | /mine-transactions | It takes the transactions in mempool, writes to a new block and returns it |
| Method | URL | Description |
|---|---|---|
| GET | /public-key | Get wallet publick key |
| POST | /transact | Create a new transaction - Send JSON { "recipient": "destination public key", "amount": 10 } |
| GET | /get-balance | Get current instance balance |