Skip to content

Commit

Permalink
docs: Update and clean-up
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <[email protected]>
  • Loading branch information
magik6k committed Sep 12, 2017
1 parent ec43a84 commit f70fa0a
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 137 deletions.
39 changes: 24 additions & 15 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The go-ipfs config file

The go-ipfs config file is a json document. It is read once at node instantiation,
either for an offline command, or for starting the daemon. Commands that execute on
a running daemon do not read the config file at runtime.
either for an offline command, or when starting the daemon. Commands that execute
on a running daemon do not read the config file at runtime.

## Table of Contents

Expand Down Expand Up @@ -68,29 +68,32 @@ Default: The ipfs.io bootstrap nodes
Contains information related to the construction and operation of the on-disk
storage system.

- `Path`
Path to the leveldb datastore directory. Set during init to either `$IPFS_PATH/datastore`, or `$HOME/.ipfs/datastore` if `$IPFS_PATH` is unset.

- `StorageMax`
An upper limit on the total size of the ipfs repository's datastore. Writes to the datastore will begin to fail once this limit is reached.
An upper limit on the total size of the ipfs repository's datastore. Writes to
the datastore will begin to fail once this limit is reached.

Default: `10GB`

- `StorageGCWatermark`
The percentage of the `StorageMax` value at which a garbage collection will be triggered automatically if the daemon was run with automatic gc enabled (that option defaults to false currently).
The percentage of the `StorageMax` value at which a garbage collection will be
triggered automatically if the daemon was run with automatic gc enabled (that
option defaults to false currently).

Default: `90`

- `GCPeriod`
A time duration specifying how frequently to run a garbage collection. Only used if automatic gc is enabled.
A time duration specifying how frequently to run a garbage collection. Only used
if automatic gc is enabled.

Default: `1h`

- `HashOnRead`
A boolean value. If set to true, all block reads from disk will be hashed and verified. This will cause increased CPU utilization.
A boolean value. If set to true, all block reads from disk will be hashed and
verified. This will cause increased CPU utilization.

- `BloomFilterSize`
A number representing the size in bytes of the blockstore's bloom filter. A value of zero represents the feature being disabled.
A number representing the size in bytes of the blockstore's bloom filter. A
value of zero represents the feature being disabled.

Default: `0`

Expand Down Expand Up @@ -185,22 +188,27 @@ Default: `[]`
## `Identity`

- `PeerID`
The unique PKI identity label for this configs peer. Set on init and never read, its merely here for convenience. Ipfs will always generate the peerID from its keypair at runtime.
The unique PKI identity label for this configs peer. Set on init and never read,
its merely here for convenience. Ipfs will always generate the peerID from its
keypair at runtime.

- `PrivKey`
The base64 encoded protobuf describing (and containing) the nodes private key.

## `Ipns`

- `RepublishPeriod`
A time duration specifying how frequently to republish ipns records to ensure they stay fresh on the network. If unset, we default to 12 hours.
A time duration specifying how frequently to republish ipns records to ensure
they stay fresh on the network. If unset, we default to 12 hours.

- `RecordLifetime`
A time duration specifying the value to set on ipns records for their validity lifetime.
A time duration specifying the value to set on ipns records for their validity
lifetime.
If unset, we default to 24 hours.

- `ResolveCacheSize`
The number of entries to store in an LRU cache of resolved ipns entries. Entries will be kept cached until their lifetime is expired.
The number of entries to store in an LRU cache of resolved ipns entries. Entries
will be kept cached until their lifetime is expired.

Default: `128`

Expand Down Expand Up @@ -242,7 +250,8 @@ Options for configuring the swarm.

- `AddrFilters`
An array of address filters (multiaddr netmasks) to filter dials to.
See https://github.com/ipfs/go-ipfs/issues/1226#issuecomment-120494604 for more information.
See https://github.com/ipfs/go-ipfs/issues/1226#issuecomment-120494604 for more
information.

- `DisableBandwidthMetrics`
A boolean value that when set to true, will cause ipfs to not keep track of
Expand Down
15 changes: 8 additions & 7 deletions docs/debug-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ Given that information, look for another goroutine that might be
holding the semaphore in question in the rest of the stack dump.
(If you need help doing this, ping and we'll stub this out.)

There are a few different reasons that goroutines can be hung:
- `semacquire` means we're waiting to take a lock or semaphore.
- `select` means that the goroutine is hanging in a select statement and none of the cases are yielding
anything.
- `chan receive` and `chan send` are waiting for a channel to be received from or sent on, respectively.
- `IO wait` generally means that we are waiting on a socket to read or write data, although it *can* mean we are
waiting on a very slow filesystem.
There are a few different reasons that goroutines can be hung:
- `semacquire` means we're waiting to take a lock or semaphore.
- `select` means that the goroutine is hanging in a select statement and none of
the cases are yielding anything.
- `chan receive` and `chan send` are waiting for a channel to be received from
or sent on, respectively.
- `IO wait` generally means that we are waiting on a socket to read or write
data, although it *can* mean we are waiting on a very slow filesystem.

If you see any of those tags _without_ a `,
X minutes` suffix, that generally means there isn't a problem -- you just caught
Expand Down
77 changes: 47 additions & 30 deletions docs/experimental-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

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

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

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

- [ipfs pubsub](#ipfs-pubsub)
- [Client mode DHT routing](#client-mode-dht-routing)
Expand All @@ -33,7 +35,8 @@ experimental, default-disabled.

### How to enable

run your daemon with the `--enable-pubsub-experiment` flag. Then use the `ipfs pubsub` commands.
run your daemon with the `--enable-pubsub-experiment` flag. Then use the
`ipfs pubsub` commands.

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works
Expand All @@ -43,7 +46,8 @@ run your daemon with the `--enable-pubsub-experiment` flag. Then use the `ipfs p
---

## Client mode DHT routing
Allows the dht to be run in a mode that doesnt serve requests to the network, saving bandwidth.
Allows the dht to be run in a mode that doesnt serve requests to the network,
saving bandwidth.

### State
experimental.
Expand All @@ -61,7 +65,10 @@ run your daemon with the `--routing=dhtclient` flag.
---

## go-multiplex stream muxer
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.
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.

### State
Experimental
Expand All @@ -72,12 +79,14 @@ Experimental
### How to enable
run your daemon with `--enable-mplex-experiment`

To make it the default stream muxer, set the environment variable `LIBP2P_MUX_PREFS` as follows:
To make it the default stream muxer, set the environment variable
`LIBP2P_MUX_PREFS` as follows:
```
export LIBP2P_MUX_PREFS="/mplex/6.7.0 /yamux/1.0.0 /spdy/3.1.0"
```

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:
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:
```
$ ipfs swarm peers -v --enc=json | jq .
{
Expand All @@ -104,7 +113,8 @@ $ ipfs swarm peers -v --enc=json | jq .
```

### Road to being a real feature
- [ ] Significant real world testing and performance metrics across a wide variety of workloads showing that it works well.
- [ ] Significant real world testing and performance metrics across a wide
variety of workloads showing that it works well.

---

Expand Down Expand Up @@ -167,16 +177,22 @@ go get github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
ipfs-swarm-key-gen > ~/.ipfs/swarm.key
```

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).
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).

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

To prevent your node from even trying to connect to the default bootstrap nodes, run:
```bash
ipfs bootstrap rm --all
```

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

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works
Expand Down Expand Up @@ -204,10 +220,12 @@ Basic usage:

- Open a listener on one node (node A)
`ipfs p2p listener open p2p-test /ip4/127.0.0.1/tcp/10101`
- Where `/ip4/127.0.0.1/tcp/10101` put address of application you want to pass p2p connections to
- Where `/ip4/127.0.0.1/tcp/10101` put address of application you want to pass
p2p connections to
- On the other node, connect to the listener on node A
`ipfs p2p stream dial $NODE_A_PEERID p2p-test /ip4/127.0.0.1/tcp/10102`
- Node B is now listening for a connection on TCP at 127.0.0.1:10102, connect your application there to complete the connection
- Node B is now listening for a connection on TCP at 127.0.0.1:10102, connect
your application there to complete the connection

### Road to being a real feature
- [ ] Needs more people to use and report on how well it works / fits use cases
Expand All @@ -229,15 +247,14 @@ master, 0.4.11

### How to enable

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

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

### Basic Usage:

Expand All @@ -258,10 +275,10 @@ Peers can see their (unspecific) relay address in the output of
### Road to being a real feature

- [ ] Needs more people to use it and report on how well it works.
- [ ] 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.
- [ ] 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.
Loading

0 comments on commit f70fa0a

Please sign in to comment.