├── .gitignore ├── LICENSE ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Mathias Buus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dht-rpc-bootstrap 2 | 3 | Easily spin up a [dht-rpc](https://github.com/mafintosh/dht-rpc) bootstrap node from the command line. 4 | 5 | ``` 6 | npm install dht-rpc-bootstrap 7 | ``` 8 | 9 | ## Usage 10 | 11 | A bootstrap node is just a normal dht node, except it doesn't answer any custom queries and will 12 | just forward you to other nodes in the network. 13 | 14 | ``` sh 15 | dht-rpc-bootstrap --port=10000 16 | ``` 17 | 18 | After spinning up a node add it to your dht-rpc bootstrap list 19 | 20 | ``` js 21 | var node = dht({ 22 | bootstrap: ['mydomain.com:10000'] 23 | }) 24 | 25 | var stream = node.query({ 26 | command: 'cool-stuff', 27 | target: ... 28 | }) 29 | ``` 30 | 31 | ## License 32 | 33 | MIT 34 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var dht = require('dht-rpc') 4 | var minimist = require('minimist') 5 | 6 | var argv = minimist(process.argv, { 7 | alias: {port: 'p'}, 8 | default: {port: 49737} 9 | }) 10 | 11 | var node = dht({ 12 | ephemeral: true 13 | }) 14 | 15 | node.listen(Number(argv.port), function () { 16 | console.log('dht-rpc bootstrap node listening on %d', node.address().port) 17 | }) 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dht-rpc-bootstrap", 3 | "version": "2.0.0", 4 | "description": "Easily spin up a dht-rpc bootstrap node from the command line.", 5 | "main": "index.js", 6 | "dependencies": { 7 | "dht-rpc": "^4.0.0", 8 | "minimist": "^1.2.0" 9 | }, 10 | "devDependencies": {}, 11 | "bin": { 12 | "dht-rpc-bootstrap": "./index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/mafintosh/dht-rpc-bootstrap.git" 17 | }, 18 | "author": "Mathias Buus (@mafintosh)", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/mafintosh/dht-rpc-bootstrap/issues" 22 | }, 23 | "homepage": "https://github.com/mafintosh/dht-rpc-bootstrap" 24 | } 25 | --------------------------------------------------------------------------------