# @robertsvendsen/graphnet

> Node Graph Networking

Latest version **0.10.4** (published 2024-02-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @robertsvendsen/graphnet
pnpm add @robertsvendsen/graphnet
yarn add @robertsvendsen/graphnet
bun add @robertsvendsen/graphnet
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.4 |
| Published | 2024-02-18 |
| First published | 2022-10-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 64.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Robert Svendsen |
| Maintainers | platoniusen |

## Links

- npm: https://www.npmjs.com/package/@robertsvendsen/graphnet
- npm.io page: https://npm.io/package/@robertsvendsen/graphnet

## Dependencies (3)

- [md5](https://npm.io/package/md5.md) ^2.3.0
- [utf-8-validate](https://npm.io/package/utf-8-validate.md) ^6.0.3
- [@robertsvendsen/wspack](https://npm.io/package/@robertsvendsen/wspack.md) ^0.11.1

## Recent versions

- 0.10.4 (latest) — 2024-02-18
- 0.10.3 — 2022-12-29
- 0.10.2 — 2022-12-29
- 0.10.1 — 2022-12-29
- 0.10.0 — 2022-10-06
- 0.9.18 — 2022-10-06

## README

# Graphnet

A graphnet consists three or more nodes, but you might as well just use one or two.
The graph will broadcast all new clients connecting to it.

## Test commands:

Start three nodes which will connect to each other.
After they have all started, try killing one, two or all and restart to see what happens.

`node src/bin/index.js --port=5080 --identity=test-0`

`node src/bin/index.js --address=ws://localhost:5081 --port=5081 --identity=test-1 --initial-address=ws://localhost:5080 --initial-identity=test-0`

`node src/bin/index.js --address=ws://localhost:5082 --port=5082 --identity=test-2 --initial-address=ws://localhost:5080 --initial-identity=test-0`

### TODO

- Elections.
  - Speed up candidates by moving it into an own event.
  - Prevent starting a new election if one actually exists.
  - Prevent voting for nodes that are flacky or high ping.
  
- Client must validate server before authenticating.
- Encryption. All nodes have their own key, its transmitted with known-nodes event.
- Warning/handling conflicts during leader change on appData.
- Implement distributed log, mergable.

### Caveats

Because of handshakes, its not possible to merge two graphnets,
 they wouldn't be able to talk to each other.


### Security

The passphrase is used to connect to each other, mesh-like.
All data is encrypted during transfer between nodes.
Handshake is done when a node first joins the graph.

### Blocking.
- None

### High priority.
- None

# Notes
- No notes yet.

---
_Source: https://npm.io/package/@robertsvendsen/graphnet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
