GithubHelp home page GithubHelp logo

jli943 / gring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from git-disl/gring

0.0 0.0 0.0 38.88 MB

License: MIT License

Shell 0.53% JavaScript 0.07% Python 23.82% C 0.40% Go 73.47% CSS 0.46% Makefile 0.12% HTML 1.13%

gring's Introduction

Introduction

This repository contains implementation of G-RING: the resilient decentralized communication protocol and systems designs for distributed services.

Installation

  1. Install Go This repository is valided with, but not limited to, go1.16
wget https://golang.org/dl/go1.16.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz

Write your own distributed service example

distributed service applications can be implemented on G-RING.

Please refer to examples in G-RING/cmd

Node Creation

This is a G-RING core data structure that contains management resources such as event handling(e.g., connection management), message handler, overlay network.

node, err = GRING.NewNode(
            GRING.WithNodeBindHost(net.ParseIP(host)),
            GRING.WithNodeBindPort(uint16(port)),
            GRING.WithNodeMaxRecvMessageSize(1<<24),
            )

Register Message Handlers

//Register the chatMessage structure to the node with an associated unmarshal function.
node.RegisterMessage(chatMessage{}, unmarshalChatMessage)

// Register a message handler to the node.
node.Handle(handle)

Register Overlay Network Routing Protocol

// This example uses Dual protocol.
events = dual.Events{
             OnPeerAdmitted: func(id GRING.ID) {
                fmt.Printf("Learned about a new peer %s(%s).\n", id.Address, id.ID.String()[:printedLength])
	     }
             OnPeerEvicted: func(id GRING.ID) {
                fmt.Printf("Forgotten a peer %s(%s).\n", id.Address, id.ID.String()[:printedLength])
             },
        }
// register above events handlers to Dual 
overlay = dual.New(dual.WithProtocolEvents(events)

// Bind Dual Overlay to the node.
node.Bind(overlay.Protocol())

Start the node

// Have the node start listening for new peers.
node.Listen()

Setting parameters

G-RING provides below protocols. Please refer to below named directory on the top directory of G-RING

dual

Default routing and messaging protocol for G-RING. It provides three communication protocols and two types of overlays.

Communication protocols
A. P2P Backbone Connection Management Protocol
B. P2P Backbone General Purpose Communication Protocol 
C. P2P Application Communication Protocol
Overlays
A. Backbone overlay
B. Application overlay

kademlia

Vanilla Kademlia

gossip

standard push based gossip protocol

Supported Platforms

Tested environment:

OS : Ubuntu 18.04 Hardware : Ethernet

Status

The code is provided as is, without warranty or support.

Some of codes(e.g., Kademlia, gossip protocol) are from Noise https://github.com/perlin-network/noise

Students Contributions

VGG_face_group FL application on GRING

Federated Learning for face recognition with Kaggle VGG face2 dataset https://www.kaggle.com/greatgamedota/vggface2-test by Prabhy Omkar, Pawar Rohan, Okechukwu Chima, Dumay Alice Jeanne Mi and Sirpurkar Saurab

d3disp

Visualization of overlay network on webbrowser interface by Prabhu Omkar

gring's People

Contributors

theued avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.