Skip to content
/ gossip Public

General purpose implementation of gossip protocol used to broadcast messages in peer-to-peer network

License

Notifications You must be signed in to change notification settings

zllai/gossip

Repository files navigation

Gossip broadcast

This is a library implementating gossip protocol for general purpose message broadcast in peer to peer network.

It is similar to the one used in bitcoin or Ethereum blockchain, but this implementation is simpler and cleaner.

Usage

The usage of this library is straight forward, please see the example.

Example

build example

cd example
go build -o node 

run example

usage:

./node [topic] [listenIP:listenPort] [existingNodeIP:existingNodePort...]

Run the first node:

./node test 127.0.0.1:8000

Run second node to join the first node:

./node test 127.0.0.1:8001 127.0.0.1:8000

You can run more nodes and join any existing node with the same topic.

Input messages from stdin, and the messages will be gossiped to all the nodes.

About

General purpose implementation of gossip protocol used to broadcast messages in peer-to-peer network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages