Skip to content
A simple UDP peer-to-peer framework written in go using the built in net library.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
README.md
message.go
net.go
network_test.go
peer.go
request.go
response.go

README.md

splashp2p - SplashLedger:

GODOC Build Status Coverage Status This project is part of the *offical suite for the Splash Distributed Ledger. This repo is maintained by the Splash Foundation http://SplashLedger.com



Features:

SplashP2P is a simple peer to peer libary using the built in net lib; It was created for the Splash distributed ledger (blockchain).

  • UDP
  • Inspired by express.js
  • Support for big messages upto 255,000 bytes.
  • No thirdparty depedencies.



Getting stated:

Download:

go get github.com/CryptoKass/splashp2p

If you do not have the go command on your system, you need to Install Go first



Usage:

//create a Network instance
app := splashp2p.NewNetwork()

// define a handler for an inbound request
app.Handle("ping", func(in splashp2p.Request, out splashp2p.Response) {
    if string(in.Body) == "ping" {
        //write new message using the `out` object
        out.WriteTag("pong") //the used to trigger the handler
        out.Write("pong!") //writes to the body
        out.Send() //send the message
    }
})

For more examples please see the examples subdirectory or look at the godoc.



Todo:

There are a range of things I have planned for this lib:

  • Add test coverage.
  • Customizable peer state
  • Implement peer.Disconnect (will require peer to have a pointer to *Net parent)
  • Add peer to timers -> timeout ect.
  • Improve documentation



Documentaion:

Visit GoDoc:



Contribution:

If I got something wrong (which I almost certainly have) please let me know:




OVERVIEW GRAPH

Readme last updated: 2019.01.14

You can’t perform that action at this time.