npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dumbcoin

v1.3.0

Published

With this package you can create simple peer to peer blockchain, that use gossip protocol for data exchange!

Downloads

39

Readme

DumbCoin

npm snyk

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

  1. Install DumbCoin via packet manager npm/yarn
npm i dumbcoin
  1. 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 } = require('dumbcoin');
const signal = Signal().start(); // Start signaling server
const blockchain = Blockchain(); // Create Blockchain
const networker = Networker(
   blockchain, // Networker requires Blockchain instance, see documentation for more info
   //other params
);

//have fun with modules

If you want ready to use blockchain just import Cluster

const { Cluster } = require('dumbcoin');
const cluster = 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: Imgur

  1. Synchronize (SYN) packet - Peer A sends his current data to peer B.
  2. 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.
  3. 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