DumbCoin
What is DumbCoin
It's a simple package that you can use to create your primitive blockchain or anything based on peer-to-peer connection and gossip protocol for data exchange. What's more, you can use the modules separately, or create your own Blockchain using them.
Features
- Peer to peer comunication using own implementation of gossip protocol
- Signaling server
- Rewards by mining blocks (Proof of concept algorithm)
- Secure transactions signed by crypto keys
- Wallets
- API for Blockchain
How to start
### Instalation
- Install DumbCoin via packet manager npm/yarn
npm i dumbcoin
- Copy .env.example .env and complete it according to your needs
Windows:copy .env.example .env
Linux:cp .env.example .env
### Usage
You can import modules from DumbCoin package as shown below:
const Blockchain Networker Signal = ;const signal = start; // Start signaling serverconst blockchain = ; // Create Blockchainconst networker = ; //have fun with modules
If you want ready to use blockchain just import Cluster
const Cluster = ;const cluster = ; // now blockchain is ready to use
P2P and Data Exchange
### How it works Dumbcoin is built in peer-to-peer topology and data exchange/synchronization is handled by gossip protocol. Each peer is both a client and a server at the same time. The information about active nodes are transmited via Signaling server, that way all users have current list and can gossip with random Peer to keep blockchain well synchronized
Whole process can be ilustrated as following:
- Synchronize (SYN) packet - Peer A sends his current data to peer B.
- Acknowledge (ACK) packet - Peer B compares the received data's timestamps with it's own. For each documents, if it's timestamp is older, just place it in the ACK payload, if it's newer place it along with it's data. And if timestamps are the same, do nothing.
- Acknowledge 2 (ACK2) packet - Peer A updates it's document if ACK data is provided, then sends back the latest data to Peer B for those where no ACK data was provided. #### More info For more information how this works check Cassandra training video or Scylla explanation
Documentation
https://hubertlipinski.github.io/DumbCoin/
API
DubmbCoin provides an API for blockchain if you want to use it. You can download Postman collection here
#### Variables
{{address}} - Your address on which API server is running i.e localhost
{{port}} - Port on which API server is running i.e 6010