we try to make a tiny p2p client spec, maybe for sigchain gossip thing, maybe for simple blockchain thing

Overview

mininode

Mininode is a tiny p2p client for prototyping p2p protocols. It is a specification for a set of interfaces that I made to make it easier to think about this stuff.

A node is a daemon managing one (or later maybe more than one) engine.

A message is some data from a peer. We call it a mail. The job of the daemon is to mediate interactions between the engine and the outside world (in particular, the network).

mail = [peer type body]
  • A peer is a public key. Mininode interface spec is transport agnostic, we will specify the interface that transport plugins need to implement later, right now we will use native auto http+websockets provided by node. There should be a natural way to turn this peer key plus host/port into a libp2p multiaddr, we will defer all that for later.
  • A type is a blob, most values are ignored by the daemon, but the engine can use it to trigger disconnects.
  • A body is deserialized RLP (recursive lists of bytes). If you want to put raw bytes, just do so and then encode it as such in RLP, it will add just the length as overhead.

The engine returns a list of messages.

  • If the type starts with end, the daemon will send that message and disconnect the peer.
  • If the type starts with ann, the daemon will broadcast it to all peers.
  • If the type starts with req, the daemon will broadcast it to a random subset of peers (or configurable).
  • If the type starts with res, the daemon will send that message to the peer specified in the message.
You might also like...

Low cost, low effort P2P WebRTC serverless signalling using Cloudflare Workers

Low cost, low effort P2P WebRTC serverless signalling using Cloudflare Workers

P2PCF P2PCF enables free (or cheap) serverless WebRTC signalling using a Cloudflare worker and a Cloudflare R2 bucket. The API is inspired by P2PT, bu

Jan 8, 2023

GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec

validate-n8n-pull-request-title GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec. Setup Cre

Oct 7, 2022

It is a very basic implementation of how blockchain works, mainly how the bitcoin blockchain.

How to run this program npm install node core/blockchain.js What is this It is a very basic implementation of how blockchain works, mainly how the bit

May 9, 2022

HackMIT 2022. 2nd Place in Blockchain for Society sponsored by Jump Crypto. A revolutionary web application that leverages machine learning and blockchain technology to improve the crowdsourcing experience!

HackMIT 2022. 2nd Place in Blockchain for Society sponsored by Jump Crypto. A revolutionary web application that leverages machine learning and blockchain technology to improve the crowdsourcing experience!

📕 Wikisafe 📕 Wikisafe is a revolutionary new crowdsourcing web application that innovates the process of crowdsourcing information. This application

Dec 8, 2022

A tiny blockchain node for browsers.

UBI Chain A very tiny blockchain for browsers. Features Spin up a node from a browser. One node per human via Proof of Humanity UBI for gas and fees.

Sep 29, 2022

The world's greatest open source 3D CAM software. (Maybe one day.)

The world's greatest open source 3D CAM software. (Maybe one day.)

Meshmill is open source 3D CAM software for Linux. It turns STL models into G-code for CNC machines. This is beta-quality software. Use it at your own

Dec 21, 2022

A social-media mock app for the ones who love to read - and maybe show it off

🐋 🐳 Cachalote 🐳 🐋 Share what you are reading and find people who also likes it - or not! What does it do? This app focuses on three main questions

May 22, 2022

A maybe slightly safer-ish wrapper around eval Function constructors

evalish A maybe slightly safer-ish wrapper around eval Function constructors Please maybe try something else first.. Please. evalish is a small helper

Sep 6, 2022

A maybe slightly safer-ish wrapper around eval Function constructors

evalish A maybe slightly safer-ish wrapper around eval Function constructors Please maybe try something else first.. Please. evalish is a small helper

Aug 21, 2022
Owner
Nikolai Mushegian
Nikolai Mushegian
Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

openapi-zod-client Generates a zodios (typescript http client with zod validation) from a (json/yaml) OpenAPI spec (or just use the generated schemas/

Alexandre Stahmer 104 Jan 4, 2023
A browser/Chrome extension that replaces Leftist #trigger words with "bad thing" and "current bad thing". Inspired by Tim Pool.

BadThings browser/Chrome extension replaces Leftist #trigger words with 'bad things' and 'current bad thing'. Quickstart This project uses React 18 an

Cale McCollough 2 Sep 5, 2022
Extended version of create-t3-app to make it even faster to start (or maybe slower)

create-T3-app with extra tools/config out of the box create-t3-app is one of the fastest and easiest way to scaffold fullstack app. create-t3-extended

A Riolly C 7 Jan 4, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
An implementation of the ECMA-419 spec on the Raspberry Pi

raspi-419 An implementation of the ECMA-419 spec on the Raspberry Pi Licsense MIT License Copyright (c) Bryan Hughes Permission is hereby granted, fre

Bryan Hughes 4 Jun 9, 2022
API for P2P file sharing web application, Zed

zed-sharing-node Backend for file sharing app built with the MERN Stack Report Bug · Request Feature About The Project ??‍??️ This is the API for Zed,

Quavo 9 Nov 29, 2022
Zemi is data-driven and reverse-routing library for Express. It provides out-of-the-box OpenAPI support, allowing you to specify and autogenerate an OpenAPI spec.

zemi zemi is a data-driven routing library for Express, built with Typescript. Features: optional, out-of-the-box support for OpenAPI reverse-routing

Yoaquim Cintrón 5 Jul 23, 2022