p2p2p

command module
v0.0.0-...-6a09fb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

README

p2p2p

peer2peer2peer - Naive peer2peer networking with basic API

This is a rudimentary and naive p2p network that supports whispering between nodes, and autodiscovers members if they exist.

Operation

The way p2p2p's networking works is that a node without the --bootnodes flag is a network virgin. It's pool is open and so it listens indefinitely. It is unable to message anyone.

If a new node contacts it, as a member of its --bootnodes flag, the two swap their phonebooks, expanding both phonebooks.

The rest of the nodes on the network are not immediately informed of this new node. But any node, if given a node name not already in its pool, will ask its network if anyone has it and if it is returned (and in return its network will ask their networks, passing on a list of excludes it has already asked), will incorporate and continue. This is modeled similarly to ARP requests, in a fashion.

In Dev
- `go run main.go run --help`
- `go run main.go run -n node00 -p 3032`
- `go run main.go run -n node01 -p 3033`
- `go run main.go run -p 3030 -n node02 -b localhost:3032,localhost:3033`
Binary
- `./p2p2p run ...`

API

  • /health
    • Check to see if the API is serving. Also provides known node count.
  • /whisper/{name}?message={message}
    • Sends {message} to {name}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package service is a generated protocol buffer package.
Package service is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL