A p2p gossip protocol for requesting artifacts.
From the top-level directory:
go get -v
go build main.go
Run the peer by passing in the -p
argument to the binary. This will run the peer in the foreground.
For example, ./gossip -p --verbose
Instantiate the binary subsequent times to receive resources with the get
argument.
For example, ./gossip get cats.jpg
Running the unit tests doesn't require any setup.
go test ./...
The ID package provides functionality for generating unique, random IDs. IDs consist of a simple byte slice, and a size.
To use the ID package, I recommend making a 'master' ID running new(PeerID), and then calling the ServeIDs function on that ID pointer.
The ServeIDs function will feed new IDs through a channel (thread safe queue primitive for inter-process communication).
The TTL package implements a time-to-live structure. This is a simple wrapper around an integer that represents a time-to-live for a packet.
The UDP package provides the functionality to communicate between peers in the peer network.
The Packet package transforms the types that need to be sent in a packet to a single buffer.