experimental-features.md 10.5 KB
Newer Older
1 2 3 4
# Experimental features of go-ipfs

This document contains a list of experimental features in go-ipfs.
These features, commands, and APIs aren't mature, and you shouldn't rely on them.
Łukasz Magiera's avatar
Łukasz Magiera committed
5 6 7
Once they reach maturity, there's going to be mention in the changelog and
release posts. If they don't reach maturity, the same applies, and their code is
removed.
8 9 10

Subscribe to https://github.com/ipfs/go-ipfs/issues/3397 to get updates.

Łukasz Magiera's avatar
Łukasz Magiera committed
11 12 13
When you add a new experimental feature to go-ipfs, or change an experimental
feature, you MUST please make a PR updating this document, and link the PR in
the above issue.
14 15 16 17 18 19

- [ipfs pubsub](#ipfs-pubsub)
- [Client mode DHT routing](#client-mode-dht-routing)
- [go-multiplex stream muxer](#go-multiplex-stream-muxer)
- [Raw leaves for unixfs files](#raw-leaves-for-unixfs-files)
- [ipfs filestore](#ipfs-filestore)
20
- [BadgerDB datastore](#badger-datastore)
21 22
- [Private Networks](#private-networks)
- [ipfs p2p](#ipfs-p2p)
23
- [Circuit Relay](#circuit-relay)
24 25 26
- [Plugins](#plugins)
- [Directory Sharding / HAMT](#directory-sharding-hamt)
- [IPNS PubSub](#ipns-pubsub)
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

---

## ipfs pubsub

### State

experimental, default-disabled.

### In Version

0.4.5

### How to enable

Łukasz Magiera's avatar
Łukasz Magiera committed
42 43
run your daemon with the `--enable-pubsub-experiment` flag. Then use the
`ipfs pubsub` commands.
44 45 46 47 48 49 50 51 52

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works
- [ ] Needs authenticated modes to be implemented
- [ ] needs performance analyses to be done

---

## Client mode DHT routing
Łukasz Magiera's avatar
Łukasz Magiera committed
53
Allows the dht to be run in a mode that doesn't serve requests to the network,
Łukasz Magiera's avatar
Łukasz Magiera committed
54
saving bandwidth.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

### State
experimental.

### In Version
0.4.5

### How to enable
run your daemon with the `--routing=dhtclient` flag.

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works.
- [ ] Needs analysis of effect it has on the network as a whole.

---

## go-multiplex stream muxer
Łukasz Magiera's avatar
Łukasz Magiera committed
72 73 74 75
Adds support for using the go-multiplex stream muxer alongside (or instead of)
yamux and spdy. This multiplexer is far simpler, and uses less memory and
bandwidth than the others, but is lacking on congestion control and backpressure
logic. It is available to try out and experiment with.
76 77 78 79 80 81 82 83 84 85

### State
Experimental

### In Version
0.4.5

### How to enable
run your daemon with `--enable-mplex-experiment`

Łukasz Magiera's avatar
Łukasz Magiera committed
86 87
To make it the default stream muxer, set the environment variable
`LIBP2P_MUX_PREFS` as follows:
88 89 90 91
```
export LIBP2P_MUX_PREFS="/mplex/6.7.0 /yamux/1.0.0 /spdy/3.1.0"
```

Łukasz Magiera's avatar
Łukasz Magiera committed
92 93
To check which stream muxer is being used between any two given peers, check the
json output of the `ipfs swarm peers` command, you'll see something like this:
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
```
$ ipfs swarm peers -v --enc=json | jq .
{
  "Peers": [
    {
      "Addr": "/ip4/104.131.131.82/tcp/4001",
      "Peer": "QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
      "Latency": "46.032624ms",
      "Muxer": "*peerstream_multiplex.conn",
      "Streams": [
        {
          "Protocol": "/ipfs/bitswap/1.1.0"
        },
        {
          "Protocol": "/ipfs/kad/1.0.0"
        },
        {
          "Protocol": "/ipfs/kad/1.0.0"
        }
      ]
    },
    {
...
```

### Road to being a real feature
Łukasz Magiera's avatar
Łukasz Magiera committed
120 121
- [ ] Significant real world testing and performance metrics across a wide
      variety of workloads showing that it works well.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183

---

## Raw Leaves for unixfs files
Allows files to be added with no formatting in the leaf nodes of the graph.

### State
experimental.

### In Version
master, 0.4.5

### How to enable
Use `--raw-leaves` flag when calling `ipfs add`.

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works.

---

## ipfs filestore
Allows files to be added without duplicating the space they take up on disk.

### State
experimental.

### In Version
master, 0.4.7

### How to enable
Modify your ipfs config:
```
ipfs config --json Experimental.FilestoreEnabled true
```

And then pass the `--nocopy` flag when running `ipfs add`

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works.
- [ ] Need to address error states and failure conditions
- [ ] Need to write docs on usage, advantages, disadvantages
- [ ] Need to merge utility commands to aid in maintenance and repair of filestore

---

## Private Networks

Allows ipfs to only connect to other peers who have a shared secret key.

### State
Experimental

### In Version
master, 0.4.7

### How to enable
Generate a pre-shared-key using [ipfs-swarm-key-gen](https://github.com/Kubuxu/go-ipfs-swarm-key-gen)):
```
go get github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
ipfs-swarm-key-gen > ~/.ipfs/swarm.key
```

Łukasz Magiera's avatar
Łukasz Magiera committed
184 185 186
To join a given private network, get the key file from someone in the network
and save it to `~/.ipfs/swarm.key` (If you are using a custom `$IPFS_PATH`, put
it in there instead).
187

Łukasz Magiera's avatar
Łukasz Magiera committed
188
When using this feature, you will not be able to connect to the default bootstrap
Łukasz Magiera's avatar
Łukasz Magiera committed
189
nodes (Since we aren't part of your private network) so you will need to set up
Łukasz Magiera's avatar
Łukasz Magiera committed
190
your own bootstrap nodes.
191

192
First, to prevent your node from even trying to connect to the default bootstrap nodes, run:
193 194 195 196
```bash
ipfs bootstrap rm --all
```

197
Then add your own bootstrap peers with:
198 199 200 201
```bash
ipfs bootstrap add <multiaddr>
```

202
For example:
203 204 205 206 207 208 209
```
ipfs bootstrap add /ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
```

Bootstrap nodes are no different from all other nodes in the network apart from
the function they serve.

Łukasz Magiera's avatar
Łukasz Magiera committed
210 211 212
To be extra cautious, You can also set the `LIBP2P_FORCE_PNET` environment
variable to `1` to force the usage of private networks. If no private network is
configured, the daemon will fail to start.
213 214 215 216 217 218 219 220

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works
- [ ] More documentation

---

## ipfs p2p
Łukasz Magiera's avatar
Łukasz Magiera committed
221
Allows to tunnel TCP connections through Libp2p streams
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238

### State
Experimental

### In Version
master, 0.4.10

### How to enable
P2P command needs to be enabled in config

`ipfs config --json Experimental.Libp2pStreamMounting true`

### How to use

Basic usage:

- Open a listener on one node (node A)
239
`ipfs p2p listener open p2p-test /ip4/127.0.0.1/tcp/10101`
Łukasz Magiera's avatar
Łukasz Magiera committed
240 241
- Where `/ip4/127.0.0.1/tcp/10101` put address of application you want to pass
  p2p connections to
242
- On the other node, connect to the listener on node A
243
`ipfs p2p stream dial $NODE_A_PEERID p2p-test /ip4/127.0.0.1/tcp/10102`
Łukasz Magiera's avatar
Łukasz Magiera committed
244 245
- Node B is now listening for a connection on TCP at 127.0.0.1:10102, connect
  your application there to complete the connection
246 247 248 249 250

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works / fits use cases
- [ ] More documentation
- [ ] Support other protocols
251 252 253 254 255 256 257 258 259 260 261 262

---

## Circuit Relay

Allows peers to connect through an intermediate relay node when there
is no direct connectivity.

### State
Experimental

### In Version
263
master, 0.4.11
264 265 266

### How to enable

Łukasz Magiera's avatar
Łukasz Magiera committed
267 268 269
The relay transport is enabled by default, which allows peers to dial through
relay and listens for incoming relay connections. The transport can be disabled
by setting `Swarm.DisableRelay = true` in the configuration.
270

Łukasz Magiera's avatar
Łukasz Magiera committed
271 272 273 274
By default, peers don't act as intermediate nodes (relays). This can be enabled
by setting `Swarm.EnableRelayHop = true` in the configuration. Note that the
option needs to be set before online services are started to have an effect; an
already online node would have to be restarted.
275 276 277 278 279 280 281 282

### Basic Usage:

In order to connect peers QmA and QmB through a relay node QmRelay:

- Both peers should connect to the relay:
`ipfs swarm connect /transport/address/ipfs/QmRelay`
- Peer QmA can then connect to peer QmB using the relay:
Łukasz Magiera's avatar
Łukasz Magiera committed
283
`ipfs swarm connect /ipfs/QmRelay/p2p-circuit/ipfs/QmB`
284 285 286 287 288 289 290 291 292 293 294

Peers can also connect with an unspecific relay address, which will
try to dial through known relays:
`ipfs swarm connect /p2p-circuit/ipfs/QmB`

Peers can see their (unspecific) relay address in the output of
`ipfs swarm addrs listen`

### Road to being a real feature

- [ ] Needs more people to use it and report on how well it works.
Łukasz Magiera's avatar
Łukasz Magiera committed
295 296 297 298 299 300 301
- [ ] Advertise relay addresses to the DHT for NATed or otherwise unreachable
      peers.
- [ ] Active relay discovery for specific relay address advertisement. We would
      like advertised relay addresses to designate specific relays for efficient
      dialing.
- [ ] Dialing priorities for relay addresses; arguably, relay addresses should
      have lower priority than direct dials.
302 303 304

## Plugins

Jeromy Johnson's avatar
Jeromy Johnson committed
305 306 307
### In Version
0.4.11

308 309 310
### State
Experimental

311 312 313 314 315 316 317 318 319 320
Plugins allow to add functionality without the need to recompile the daemon.

### Basic Usage:

See [Plugin docs](./plugins.md)

### Road to being a real feature

- [ ] Better support for platforms other than Linux
- [ ] More plugins and plugin types
Jeromy Johnson's avatar
Jeromy Johnson committed
321
- [ ] Feedback on stability
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348

 ## Badger datastore

 ### In Version
 0.4.11

 Badger-ds is new datastore implementation based on
 https://github.com/dgraph-io/badger

 ### Basic Usage

 ```
 $ ipfs init --profile=badgerds
 ```
 or
 ```
 [BACKUP ~/.ipfs]
 $ ipfs config profile apply badgerds
 $ ipfs-ds-convert convert
 ```

###

### Road to being a real feature

- [ ] Needs more testing
- [ ] Make sure there are no unknown major problems
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370

## Directory Sharding / HAMT

### In Version
0.4.8

### State
Experimental

Allows to create directories with unlimited number of entries - currently
size of unixfs directories is limited by the maximum block size

### Basic Usage:

```
ipfs config --json Experimental.ShardingEnabled true
```

### Road to being a real feature

- [ ] Make sure that objects that don't have to be sharded aren't
- [ ] Generalize sharding and define a new layer between IPLD and IPFS
371 372 373 374 375 376 377

---

## IPNS pubsub

### In Version

378
0.4.14
379 380 381 382 383 384 385

### State

Experimental, default-disabled.

Utilizes pubsub for publishing ipns records in real time.

386 387 388
When it is enabled:
- IPNS publishers push records to a name-specific pubsub topic,
  in addition to publishing to the DHT.
vyzo's avatar
vyzo committed
389
- IPNS resolvers subscribe to the name-specific topic on first
vyzo's avatar
vyzo committed
390
  resolution and receive subsequently published records through pubsub
vyzo's avatar
vyzo committed
391 392 393 394
  in real time. This makes subsequent resolutions instant, as they
  are resolved through the local cache. Note that the initial
  resolution still goes through the DHT, as there is no message
  history in pubsub.
395 396 397

Both the publisher and the resolver nodes need to have the feature enabled for it
to work effectively.
398

399 400 401 402 403 404 405 406
### How to enable

run your daemon with the `--enable-namesys-pubsub` flag; enables pubsub.

### Road to being a real feature

- [ ] Needs more people to use and report on how well it works
- [ ] Add a mechanism for last record distribution on subscription,
407 408
      so that we don't have to hit the DHT for the initial resolution.
      Alternatively, we could republish the last record periodically.