From 606d6a6815608027cfde5bb799a6996ca8e3d211 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Fri, 18 Oct 2019 14:25:47 +0200 Subject: [PATCH] chore: cleanup peer routing --- src/content-routing/README.md | 1 - src/peer-routing/.gitignore | 27 ----------------------- src/peer-routing/LICENSE | 22 ------------------- src/peer-routing/README.md | 34 ++--------------------------- src/peer-routing/package.json | 24 -------------------- src/peer-routing/tests/base-test.js | 15 ------------- src/peer-routing/tests/index.js | 6 ----- 7 files changed, 2 insertions(+), 127 deletions(-) delete mode 100644 src/peer-routing/.gitignore delete mode 100644 src/peer-routing/LICENSE delete mode 100644 src/peer-routing/package.json delete mode 100644 src/peer-routing/tests/base-test.js delete mode 100644 src/peer-routing/tests/index.js diff --git a/src/content-routing/README.md b/src/content-routing/README.md index d26d260..24eba48 100644 --- a/src/content-routing/README.md +++ b/src/content-routing/README.md @@ -13,7 +13,6 @@ Publishing a test suite as a module lets multiple modules all ensure compatibili - [JavaScript libp2p-kad-dht](https://github.com/libp2p/js-libp2p-kad-dht) - [JavaScript libp2p-delegated-peer-routing](https://github.com/libp2p/js-libp2p-delegated-peer-routing) -- [JavaScript libp2p-kad-routing](https://github.com/libp2p/js-libp2p-kad-routing) # Badge diff --git a/src/peer-routing/.gitignore b/src/peer-routing/.gitignore deleted file mode 100644 index 123ae94..0000000 --- a/src/peer-routing/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git -node_modules diff --git a/src/peer-routing/LICENSE b/src/peer-routing/LICENSE deleted file mode 100644 index 59a33ba..0000000 --- a/src/peer-routing/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 David Dias - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/src/peer-routing/README.md b/src/peer-routing/README.md index 038abab..7e28c2d 100644 --- a/src/peer-routing/README.md +++ b/src/peer-routing/README.md @@ -1,11 +1,7 @@ interface-peer-routing ===================== -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai) -[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) -[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +**WIP: This module is not yet implemented** > A test suite and interface you can use to implement a Peer Routing module for libp2p. @@ -13,17 +9,10 @@ The primary goal of this module is to enable developers to pick and swap their P Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite. -The API is presented with both Node.js and Go primitives, however, there is not actual limitations for it to be extended for any other language, pushing forward the cross compatibility and interop through diferent stacks. - -## Lead Maintainer - -[Vasco Santos](https://github.com/vasco-santos). - # Modules that implement the interface - [JavaScript libp2p-kad-dht](https://github.com/libp2p/js-libp2p-kad-dht) - [JavaScript libp2p-delegated-peer-routing](https://github.com/libp2p/js-libp2p-delegated-peer-routing) -- [JavaScript libp2p-kad-routing](https://github.com/libp2p/js-libp2p-kad-routing) # Badge @@ -35,26 +24,7 @@ Include this badge in your readme if you make a module that is compatible with t ## Node.js -```javascript -var tape = require('tape') -var tests = require('interface-peer-routing/tests') -var YourPeerRouter = require('../src') - -var common = { - setup: function (t, cb) { - cb(null, YourPeerRouter) - }, - teardown: function (t, cb) { - cb() - } -} - -tests(tape, common) -``` - -## Go - -> WIP - The go-libp2p implementation does not have a test suite to be used, yet. +TBD # API diff --git a/src/peer-routing/package.json b/src/peer-routing/package.json deleted file mode 100644 index 04fcf4c..0000000 --- a/src/peer-routing/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "interface-peer-routing", - "version": "0.1.3", - "description": "A test suite and interface you can use to implement a Peer Routing for libp2p.", - "leadMaintainer": "Vasco Santos ", - "repository": { - "type": "git", - "url": "https://github.com/diasdavid/interface-peer-routing.git" - }, - "keywords": [ - "IPFS" - ], - "author": "David Dias ", - "license": "MIT", - "bugs": { - "url": "https://github.com/diasdavid/interface-peer-routing/issues" - }, - "homepage": "https://github.com/diasdavid/interface-peer-routing", - "devDependencies": {}, - "dependencies": { - "peer-id": "~0.12.2", - "timed-tape": "^0.1.1" - } -} diff --git a/src/peer-routing/tests/base-test.js b/src/peer-routing/tests/base-test.js deleted file mode 100644 index 3768f1d..0000000 --- a/src/peer-routing/tests/base-test.js +++ /dev/null @@ -1,15 +0,0 @@ -var Id = require('peer-id') - -module.exports.all = function (test, common) { - test('Simple findPeers test', function (t) { - common.setup(test, function (err, pr) { - t.plan(3) - t.ifError(err) - pr.findPeers(Id.create().toBytes(), function (err, peerQueue) { - t.ifError(err) - t.equal(peerQueue.length >= 1, true) - common.teardown() - }) - }) - }) -} diff --git a/src/peer-routing/tests/index.js b/src/peer-routing/tests/index.js deleted file mode 100644 index b232406..0000000 --- a/src/peer-routing/tests/index.js +++ /dev/null @@ -1,6 +0,0 @@ -var timed = require('timed-tape') - -module.exports = function (test, common) { - test = timed(test) - require('./base-test.js').all(test, common) -}