Categorygithub.com/geolffreym/p2p-noise
repositorypackage
0.45.0
Repository: https://github.com/geolffreym/p2p-noise.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

P2P Noise

Go Go Reference Go Report Card codecov

P2P Noise library aims to serve as a tool to create secure P2P networks based on the Noise Framework.

  • Quick creation of custom P2P networks.
  • Simplistic and lightweight.
  • Small and secure.

Features

Blake2 Hashing: BLAKE2 is a cryptographic hash function faster than MD5, SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3. BLAKE2 has been adopted by many projects due to its high speed, security, and simplicity.

ED255519 Signature: A digital signature is a mathematical scheme for verifying the authenticity of digital messages or documents. A valid digital signature, where the prerequisites are satisfied, gives a recipient very high confidence that the message was created by a known sender (authenticity), and that the message was not altered in transit (integrity).

Noise Secure Handshake: Noise is a framework for building crypto protocols. Noise protocols support mutual and optional authentication, identity hiding, forward secrecy, zero round-trip encryption, and other advanced features.

Adaptive Lookup for Unstructured Peer-to-Peer Overlays: Most of the unstructured peer-to-peer overlays do not provide any performance guarantee. "Adaptive Lookup" propose a novel Quality of Service enabled lookup for unstructured peer-to-peer overlays that will allow the user’s query to traverse only those overlay links which satisfy the given constraints.

Install

go get github.com/geolffreym/p2p-noise

Basic usage


import (
	noise "github.com/geolffreym/p2p-noise"
	"github.com/geolffreym/p2p-noise/config"
)

func main() {

	// Create configuration from params and write in configuration reference
	configuration := config.New()
	configuration.Write(
		config.SetMaxPeersConnected(10),
		config.SetPeerDeadline(1800),
	)

	// Node factory
	node := noise.New(configuration)
	// Network events channel
	signals, cancel := node.Signals()

	go func() {
		for signal := range signals {
			// Here could be handled events
			if signal.Type() == noise.NewPeerDetected {
				cancel()
			}
		}
	}()

	// ... some code here
	// node.Dial("192.168.1.1:4008")
	// node.Close()

	// ... more code here
	node.Listen()

}

Development

Some available capabilities for dev support:

  • Run Tests: make test
  • Build: make build
  • Test Coverage: make coverage
  • Benchmark: make benchmark
  • Profiling: make profiling
  • Code check: make code-check
  • Code format: make code-fmt
  • Flush cache: make clean
  • Build: make build

Note: Please check Makefile for more capabilities.

More info