experimental-features.md 8.81 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 20 21

- [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)
- [Private Networks](#private-networks)
- [ipfs p2p](#ipfs-p2p)
22
- [Circuit Relay](#circuit-relay)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

---

## ipfs pubsub

### State

experimental, default-disabled.

### In Version

0.4.5

### How to enable

Łukasz Magiera's avatar
Łukasz Magiera committed
38 39
run your daemon with the `--enable-pubsub-experiment` flag. Then use the
`ipfs pubsub` commands.
40 41 42 43 44 45 46 47 48

### 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
49 50
Allows the dht to be run in a mode that doesnt serve requests to the network,
saving bandwidth.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

### 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
68 69 70 71
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.
72 73 74 75 76 77 78 79 80 81

### State
Experimental

### In Version
0.4.5

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

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

Łukasz Magiera's avatar
Łukasz Magiera committed
88 89
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:
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
```
$ 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
116 117
- [ ] Significant real world testing and performance metrics across a wide
      variety of workloads showing that it works well.
118 119 120 121 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

---

## 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
180 181 182
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).
183

Łukasz Magiera's avatar
Łukasz Magiera committed
184 185 186
When using this feature, you will not be able to connect to the default bootstrap
nodes (Since we arent part of your private network) so you will need to set up
your own bootstrap nodes.
187

188
First, to prevent your node from even trying to connect to the default bootstrap nodes, run:
189 190 191 192
```bash
ipfs bootstrap rm --all
```

193
Then add your own bootstrap peers with:
194 195 196 197
```bash
ipfs bootstrap add <multiaddr>
```

198
For example:
199 200 201 202 203 204 205
```
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
206 207 208
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.
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234

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

---

## ipfs p2p
Allows to tunnel TCP connections through Libp2p sterams

### 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)
235
`ipfs p2p listener open p2p-test /ip4/127.0.0.1/tcp/10101`
Łukasz Magiera's avatar
Łukasz Magiera committed
236 237
- Where `/ip4/127.0.0.1/tcp/10101` put address of application you want to pass
  p2p connections to
238
- On the other node, connect to the listener on node A
239
`ipfs p2p stream dial $NODE_A_PEERID p2p-test /ip4/127.0.0.1/tcp/10102`
Łukasz Magiera's avatar
Łukasz Magiera committed
240 241
- Node B is now listening for a connection on TCP at 127.0.0.1:10102, connect
  your application there to complete the connection
242 243 244 245 246

### 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
247 248 249 250 251 252 253 254 255 256 257 258

---

## Circuit Relay

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

### State
Experimental

### In Version
259
master, 0.4.11
260 261 262

### How to enable

Łukasz Magiera's avatar
Łukasz Magiera committed
263 264 265
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.
266

Łukasz Magiera's avatar
Łukasz Magiera committed
267 268 269 270
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.
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290

### 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:
`ipfs swarm connect /ipfs/QmRelay/p2p-cricuit/ipfs/QmB`

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
291 292 293 294 295 296 297
- [ ] 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.
298 299 300

## Plugins

Jeromy Johnson's avatar
Jeromy Johnson committed
301 302 303
### In Version
0.4.11

304 305 306
### State
Experimental

307 308 309 310 311 312 313 314 315 316
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
317
- [ ] Feedback on stability
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344

 ## 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