{"id":15448017,"url":"https://github.com/geolffreym/p2p-noise","last_synced_at":"2026-01-12T04:51:40.866Z","repository":{"id":37904367,"uuid":"483379961","full_name":"geolffreym/p2p-noise","owner":"geolffreym","description":"Peer to Peer Library based on Noise Secure Handshake","archived":false,"fork":false,"pushed_at":"2024-04-23T13:47:59.000Z","size":6640,"stargazers_count":17,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T07:33:52.361Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geolffreym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-19T19:20:04.000Z","updated_at":"2024-09-27T05:40:53.000Z","dependencies_parsed_at":"2024-06-20T21:51:19.436Z","dependency_job_id":"74c92ae4-a778-4eb8-a580-9321d3bf2c6c","html_url":"https://github.com/geolffreym/p2p-noise","commit_stats":null,"previous_names":["geolffreym/p2p-discovery","geolffreym/p2p-stream"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geolffreym%2Fp2p-noise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geolffreym%2Fp2p-noise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geolffreym%2Fp2p-noise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geolffreym%2Fp2p-noise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geolffreym","download_url":"https://codeload.github.com/geolffreym/p2p-noise/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249690358,"owners_count":21311308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang"],"created_at":"2024-10-01T20:21:32.170Z","updated_at":"2026-01-12T04:51:35.847Z","avatar_url":"https://github.com/geolffreym.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P2P Noise\n\n[![Go](https://github.com/geolffreym/p2p-noise/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/geolffreym/p2p-noise/actions/workflows/go.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/geolffreym/p2p-noise.svg)](https://pkg.go.dev/github.com/geolffreym/p2p-noise)\n[![Go Report Card](https://goreportcard.com/badge/github.com/geolffreym/p2p-noise)](https://goreportcard.com/report/github.com/geolffreym/p2p-noise)\n[![codecov](https://codecov.io/gh/geolffreym/p2p-noise/branch/main/graph/badge.svg?token=TAI49WYVTS)](https://codecov.io/gh/geolffreym/p2p-noise)\n\nP2P Noise library aims to serve as a tool to create secure P2P networks based on the Noise Framework.\n\n* Small and secure.\n* Simplistic and lightweight.\n* Quick creation of custom P2P networks.\n* Modern Crypto Stack:\n  * [Blake2 Hash](https://www.blake2.net/)\n  * [ED25519 Signature](https://ed25519.cr.yp.to/)\n  * [ChaCha20-Poly1305 Cypher]( https://en.wikipedia.org/wiki/ChaCha20-Poly1305)\n  * [Diffie-Hellman Curve25519 Key Exchange](https://en.wikipedia.org/wiki/Curve25519)\n\n## Features\n\n\u003e [Noise Secure Handshake](http://www.noiseprotocol.org/):\nNoise 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.\n\n\u003e [Adaptive Lookup for Unstructured Peer-to-Peer Overlays](https://arxiv.org/pdf/1509.04417.pdf):\nMost 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.\n\n## Install\n\n```\ngo get github.com/geolffreym/p2p-noise\n```\n\n## Basic usage\n\n```package main\n\nimport (\n\tnoise \"github.com/geolffreym/p2p-noise\"\n\t\"github.com/geolffreym/p2p-noise/config\"\n)\n\nfunc main() {\n\n\t// Create configuration from params and write in configuration reference\n\tconfiguration := config.New()\n\tconfiguration.Write(\n\t\tconfig.SetMaxPeersConnected(10),\n\t\tconfig.SetPeerDeadline(1800),\n\t)\n\n\t// Node factory\n\tnode := noise.New(configuration)\n\t// Network events channel\n\tsignals, cancel := node.Signals()\n\n\tgo func() {\n\t\tfor signal := range signals {\n\t\t\t// Here could be handled events\n\t\t\tif signal.Type() == noise.NewPeerDetected {\n\t\t\t\tcancel()\n\t\t\t}\n\t\t}\n\t}()\n\n\t// ... some code here\n\t// node.Dial(\"192.168.1.1:4008\")\n\t// node.Close()\n\n\t// ... more code here\n\tnode.Listen()\n\n}\n\n```\n\n## Benchmarking\n\n### Handshake Benchmark\n\nUsing [perflock](https://github.com/aclements/perflock) to prevent our benchmarks from using too much CPU at once.\n\n```text\nperflock -governor=80% go test -benchmem -run=^$ -benchtime 1s -bench=. -cpu 1,2,4,8 -count=1\ngoos: linux\ngoarch: amd64\npkg: github.com/geolffreym/p2p-noise\ncpu: Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz\nBenchmarkHandshakeProfile                            726           1575256 ns/op           46959 B/op        363 allocs/op\nBenchmarkHandshakeProfile-2                         1548           1037351 ns/op           47100 B/op        364 allocs/op\nBenchmarkHandshakeProfile-4                         2460            908573 ns/op           49885 B/op        383 allocs/op\nBenchmarkHandshakeProfile-8                         2127            736442 ns/op           60454 B/op        457 allocs/op\nBenchmarkNodesSecureMessageExchange             29032570                35.03 ns/op            0 B/op          0 allocs/op\nBenchmarkNodesSecureMessageExchange-2           59745247                16.78 ns/op            0 B/op          0 allocs/op\nBenchmarkNodesSecureMessageExchange-4           124446950                9.454 ns/op           0 B/op          0 allocs/op\nBenchmarkNodesSecureMessageExchange-8           151214516                7.088 ns/op           0 B/op          0 allocs/op\nPASS\nok      github.com/geolffreym/p2p-noise 18.865s\n\n```\n\n## Development\n\nSome available capabilities for dev support:\n\n* **Run Tests**: `make test`\n* **Build**: `make build`\n* **Test Coverage**: `make coverage`\n* **Benchmark**: `make benchmark`\n* **Profiling**: `make profiling`\n* **Code check**: `make check`\n* **Code format**: `make format`\n* **Flush cache**: `make clean`\n* **Build**: `make build`\n\nNote: Run `make help` to check for more capabilities.  \n\n## More info\n\n* Chat with us joining to our [matrix room](https://matrix.to/#/!XgrTEPPGsKCPvdtDeC:matrix.org?via=matrix.org).\n* [Examples](https://github.com/geolffreym/p2p-noise/examples) directory contains advanced examples of usage.\n* For help or bugs please [create an issue](https://github.com/geolffreym/p2p-noise/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeolffreym%2Fp2p-noise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeolffreym%2Fp2p-noise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeolffreym%2Fp2p-noise/lists"}