Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ You can check the development status at the [Kanban Board](https://waffle.io/ipf

[![Throughput Graph](https://graphs.waffle.io/ipfs/js-ipfs/throughput.svg)](https://waffle.io/ipfs/js-ipfs/metrics/throughput)

**Please read this:** DHT (automatic content discovery) and Circuit Relay (pierce through NATs and dial between any node in the network) are two fundamental pieces that are not finalized yet. There are multiple applications that can be built without these two services but nevertheless they are fundamental to get that magic IPFS experience. If you want to track progress or contribute, please follow:

- DHT: https://github.com/ipfs/js-ipfs/pull/856
- ✅ Relay: https://github.com/ipfs/js-ipfs/pull/1063

[**`Weekly Core Dev Calls`**](https://github.com/ipfs/pm/issues/650)

## Tech Lead
Expand Down Expand Up @@ -319,7 +314,6 @@ Enable and configure experimental features.
- `pubsub` (boolean): Enable libp2p pub-sub. (Default: `false`)
- `ipnsPubsub` (boolean): Enable pub-sub on IPNS. (Default: `false`)
- `sharding` (boolean): Enable directory sharding. Directories that have many child objects will be represented by multiple DAG nodes instead of just one. It can improve lookup performance when a directory has several thousand files or more. (Default: `false`)
- `dht` (boolean): Enable KadDHT. **This is currently not interoperable with `go-ipfs`.**

##### `options.config`

Expand Down Expand Up @@ -600,7 +594,13 @@ The core API is grouped into several areas:
- [`ipfs.bootstrap.add(addr, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/BOOTSTRAP.md#bootstrapadd)
- [`ipfs.bootstrap.rm(peer, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/BOOTSTRAP.md#bootstraprm)

- dht (not implemented yet)
- [dht](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
- [`ipfs.dht.findPeer(peerId, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtfindpeer)
- [`ipfs.dht.findProvs(multihash, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtfindprovs)
- [`ipfs.dht.get(key, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtget)
- [`ipfs.dht.provide(cid, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtprovide)
- [`ipfs.dht.put(key, value, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtput)
- [`ipfs.dht.query(peerId, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DHT.md#dhtquery)

- [pubsub](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md)
- [`ipfs.pubsub.subscribe(topic, handler, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubsubscribe)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"form-data": "^2.3.3",
"hat": "0.0.3",
"interface-ipfs-core": "~0.92.0",
"ipfsd-ctl": "~0.40.1",
"ipfsd-ctl": "~0.40.2",
"ncp": "^2.0.0",
"qs": "^6.5.2",
"rimraf": "^2.6.2",
Expand Down Expand Up @@ -128,10 +128,10 @@
"joi": "^14.3.0",
"joi-browser": "^13.4.0",
"joi-multiaddr": "^3.0.0",
"libp2p": "~0.24.1",
"libp2p": "~0.24.3",
"libp2p-bootstrap": "~0.9.3",
"libp2p-crypto": "~0.14.1",
"libp2p-kad-dht": "~0.12.1",
"libp2p-kad-dht": "~0.14.1",
"libp2p-keychain": "~0.3.3",
"libp2p-mdns": "~0.12.0",
"libp2p-mplex": "~0.8.4",
Expand Down
4 changes: 0 additions & 4 deletions src/cli/commands/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ module.exports = {
type: 'boolean',
default: false
})
.option('enable-dht-experiment', {
type: 'boolean',
default: false
})
.option('local', {
desc: 'Run commands locally to the daemon',
default: false
Expand Down
14 changes: 14 additions & 0 deletions src/cli/commands/dht.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

module.exports = {
command: 'dht <command>',

description: 'Issue commands directly through the DHT.',

builder (yargs) {
return yargs.commandDir('dht')
},

handler (argv) {
}
}
23 changes: 23 additions & 0 deletions src/cli/commands/dht/find-peer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict'

const print = require('../../utils').print

module.exports = {
command: 'findpeer <peerID>',

describe: 'Find the multiaddresses associated with a Peer ID.',

builder: {},

handler (argv) {
argv.ipfs.dht.findPeer(argv.peerID, (err, result) => {
if (err) {
throw err
}

const addresses = result.multiaddrs.toArray().map((ma) => ma.toString())

print(addresses)
})
}
}
33 changes: 33 additions & 0 deletions src/cli/commands/dht/find-providers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict'

const print = require('../../utils').print

module.exports = {
command: 'findprovs <key>',

describe: 'Find peers that can provide a specific value, given a key.',

builder: {
'num-providers': {
alias: 'n',
describe: 'The number of providers to find. Default: 20.',
default: 20
}
},

handler (argv) {
const opts = {
maxNumProviders: argv['num-providers']
}

argv.ipfs.dht.findProvs(argv.key, opts, (err, result) => {
if (err) {
throw err
}

result.forEach((element) => {
print(element.id.toB58String())
})
})
}
}
21 changes: 21 additions & 0 deletions src/cli/commands/dht/get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const print = require('../../utils').print

module.exports = {
command: 'get <key>',

describe: 'Given a key, query the routing system for its best value.',

builder: {},

handler (argv) {
argv.ipfs.dht.get(argv.key, (err, result) => {
if (err) {
throw err
}

print(result)
})
}
}
23 changes: 23 additions & 0 deletions src/cli/commands/dht/provide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict'

module.exports = {
command: 'provide <key>',

describe: 'Announce to the network that you are providing given values.',

builder: {
recursive: {
alias: 'r',
recursive: 'Recursively provide entire graph.',
default: false
}
},

handler (argv) {
argv.ipfs.dht.provide(argv.key, (err, result) => {
if (err) {
throw err
}
})
}
}
17 changes: 17 additions & 0 deletions src/cli/commands/dht/put.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

module.exports = {
command: 'put <key> <value>',

describe: 'Write a key/value pair to the routing system.',

builder: {},

handler (argv) {
argv.ipfs.dht.put(argv.key, argv.value, (err) => {
if (err) {
throw err
}
})
}
}
23 changes: 23 additions & 0 deletions src/cli/commands/dht/query.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict'

const print = require('../../utils').print

module.exports = {
command: 'query <peerID>',

describe: 'Find the closest Peer IDs to a given Peer ID by querying the DHT.',

builder: {},

handler (argv) {
argv.ipfs.dht.query(argv.peerID, (err, result) => {
if (err) {
throw err
}

result.forEach((peerID) => {
print(peerID.id.toB58String())
})
})
}
}
Loading