config.md 7.75 KB
Newer Older
Jeromy's avatar
Jeromy committed
1
# The go-ipfs config file
2

Jeromy's avatar
Jeromy committed
3
The go-ipfs config file is a json document. It is read once at node instantiation,
Łukasz Magiera's avatar
Łukasz Magiera committed
4 5
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.
Jeromy's avatar
Jeromy committed
6

7 8 9 10 11 12 13 14 15 16 17
## Table of Contents

- [`Addresses`](#addresses)
- [`API`](#api)
- [`Bootstrap`](#bootstrap)
- [`Datastore`](#datastore)
- [`Discovery`](#discovery)
- [`Gateway`](#gateway)
- [`Identity`](#identity)
- [`Ipns`](#ipns)
- [`Mounts`](#mounts)
18
- [`Reprovider`](#reprovider)
19
- [`Swarm`](#swarm)
Łukasz Magiera's avatar
Łukasz Magiera committed
20
- [`Profiles`](#profiles)
21

Jeromy's avatar
Jeromy committed
22 23 24
## `Addresses`
Contains information about various listener addresses to be used by this node.

Jeromy's avatar
Jeromy committed
25
- `API`
26
Multiaddr describing the address to serve the local HTTP API on.
Jeromy's avatar
Jeromy committed
27

John Reed's avatar
John Reed committed
28
Default: `/ip4/127.0.0.1/tcp/5001`
Jeromy's avatar
Jeromy committed
29

Jeromy's avatar
Jeromy committed
30
- `Gateway`
Jeromy's avatar
Jeromy committed
31 32 33 34
Multiaddr describing the address to serve the local gateway on.

Default: `/ip4/127.0.0.1/tcp/8080`

Jeromy's avatar
Jeromy committed
35
- `Swarm`
Jeromy's avatar
Jeromy committed
36 37 38 39 40 41 42 43 44 45
Array of multiaddrs describing which addresses to listen on for p2p swarm connections.

Default:
```json
[
  "/ip4/0.0.0.0/tcp/4001",
  "/ip6/::/tcp/4001"
]
```

John Reed's avatar
John Reed committed
46
- `Announce`
John Reed's avatar
John Reed committed
47
If non-empty, this array specifies the swarm addresses to announce to the network. If empty, the daemon will announce inferred swarm addresses.
John Reed's avatar
John Reed committed
48 49 50 51 52 53 54 55

Default: `[]`

- `NoAnnounce`
Array of swarm addresses not to announce to the network.

Default: `[]`

Jeromy's avatar
Jeromy committed
56
## `API`
57
Contains information used by the API gateway.
Jeromy's avatar
Jeromy committed
58

Jeromy's avatar
Jeromy committed
59
- `HTTPHeaders`
60
Map of HTTP headers to set on responses from the API HTTP server.
Jeromy's avatar
Jeromy committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

Example:
```json
{
	"Foo": ["bar"]
}
```

Default: `null`

## `Bootstrap`
Bootstrap is an array of multiaddrs of trusted nodes to connect to in order to
initiate a connection to the network.

Default: The ipfs.io bootstrap nodes

## `Datastore`
Contains information related to the construction and operation of the on-disk
storage system.

Jeromy's avatar
Jeromy committed
81
- `StorageMax`
82 83
A soft upper limit for the size of the ipfs repository's datastore. With `StorageGCWatermark`,
is used to calculate whether to trigger a gc run (only if `--enable-gc` flag is set).
Jeromy's avatar
Jeromy committed
84 85 86

Default: `10GB`

Jeromy's avatar
Jeromy committed
87
- `StorageGCWatermark`
Łukasz Magiera's avatar
Łukasz Magiera committed
88 89 90
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).
Jeromy's avatar
Jeromy committed
91 92 93

Default: `90`

Jeromy's avatar
Jeromy committed
94
- `GCPeriod`
Łukasz Magiera's avatar
Łukasz Magiera committed
95 96
A time duration specifying how frequently to run a garbage collection. Only used
if automatic gc is enabled.
Jeromy's avatar
Jeromy committed
97 98 99

Default: `1h`

Jeromy's avatar
Jeromy committed
100
- `HashOnRead`
Łukasz Magiera's avatar
Łukasz Magiera committed
101 102
A boolean value. If set to true, all block reads from disk will be hashed and
verified. This will cause increased CPU utilization.
Jeromy's avatar
Jeromy committed
103 104

- `BloomFilterSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
105 106
A number representing the size in bytes of the blockstore's bloom filter. A
value of zero represents the feature being disabled.
Jeromy's avatar
Jeromy committed
107

vyzo's avatar
vyzo committed
108
Default: `0`
Jeromy's avatar
Jeromy committed
109

Jeromy's avatar
Jeromy committed
110 111 112 113 114 115 116 117 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
- `Spec`
Spec defines the structure of the ipfs datastore. It is a composable structure, where each datastore is represented by a json object. Datastores can wrap other datastores to provide extra functionality (eg metrics, logging, or caching).

This can be changed manually, however, if you make any changes that require a different on-disk structure, you will need to run the [ipfs-ds-convert tool](https://github.com/ipfs/ipfs-ds-convert) to migrate data into the new structures.

For more information on possible values for this configuration option, see docs/datastores.md 

Default:
```
{
  "mounts": [
	{
	  "child": {
		"path": "blocks",
		"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
		"sync": true,
		"type": "flatfs"
	  },
	  "mountpoint": "/blocks",
	  "prefix": "flatfs.datastore",
	  "type": "measure"
	},
	{
	  "child": {
		"compression": "none",
		"path": "datastore",
		"type": "levelds"
	  },
	  "mountpoint": "/",
	  "prefix": "leveldb.datastore",
	  "type": "measure"
	}
  ],
  "type": "mount"
}
```
Jeromy's avatar
Jeromy committed
146 147 148 149

## `Discovery`
Contains options for configuring ipfs node discovery mechanisms.

Jeromy's avatar
Jeromy committed
150
- `MDNS`
Jeromy's avatar
Jeromy committed
151 152
Options for multicast dns peer discovery.

Jeromy's avatar
Jeromy committed
153
  - `Enabled`
Jeromy's avatar
Jeromy committed
154 155 156 157
A boolean value for whether or not mdns should be active.

Default: `true`

Jeromy's avatar
Jeromy committed
158
  -  `Interval`
Jeromy's avatar
Jeromy committed
159 160 161 162
A number of seconds to wait between discovery checks.


## `Gateway`
163
Options for the HTTP gateway.
Jeromy's avatar
Jeromy committed
164

Jeromy's avatar
Jeromy committed
165
- `HTTPHeaders`
Jeromy's avatar
Jeromy committed
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
Headers to set on gateway responses.

Default:
```json
{
	"Access-Control-Allow-Headers": [
		"X-Requested-With"
	],
	"Access-Control-Allow-Methods": [
		"GET"
	],
	"Access-Control-Allow-Origin": [
		"*"
	]
}
```

Jeromy's avatar
Jeromy committed
183
- `RootRedirect`
Jeromy's avatar
Jeromy committed
184 185 186 187
A url to redirect requests for `/` to.

Default: `""`

Jeromy's avatar
Jeromy committed
188
- `Writeable`
Jeromy's avatar
Jeromy committed
189 190 191 192
A boolean to configure whether the gateway is writeable or not.

Default: `false`

Jeromy's avatar
Jeromy committed
193
- `PathPrefixes`
Jeromy's avatar
Jeromy committed
194 195 196 197 198 199
TODO

Default: `[]`

## `Identity`

Jeromy's avatar
Jeromy committed
200
- `PeerID`
Łukasz Magiera's avatar
Łukasz Magiera committed
201 202 203
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.
Jeromy's avatar
Jeromy committed
204

Jeromy's avatar
Jeromy committed
205
- `PrivKey`
Jeromy's avatar
Jeromy committed
206 207 208 209
The base64 encoded protobuf describing (and containing) the nodes private key.

## `Ipns`

Jeromy's avatar
Jeromy committed
210
- `RepublishPeriod`
Łukasz Magiera's avatar
Łukasz Magiera committed
211
A time duration specifying how frequently to republish ipns records to ensure
212
they stay fresh on the network. If unset, we default to 4 hours.
Jeromy's avatar
Jeromy committed
213

Jeromy's avatar
Jeromy committed
214
- `RecordLifetime`
Łukasz Magiera's avatar
Łukasz Magiera committed
215 216
A time duration specifying the value to set on ipns records for their validity
lifetime.
Jeromy's avatar
Jeromy committed
217 218
If unset, we default to 24 hours.

Jeromy's avatar
Jeromy committed
219
- `ResolveCacheSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
220 221
The number of entries to store in an LRU cache of resolved ipns entries. Entries
will be kept cached until their lifetime is expired.
Jeromy's avatar
Jeromy committed
222 223 224 225

Default: `128`

## `Mounts`
226
FUSE mount point configuration options.
Jeromy's avatar
Jeromy committed
227

Jeromy's avatar
Jeromy committed
228
- `IPFS`
Jeromy's avatar
Jeromy committed
229 230
Mountpoint for `/ipfs/`.

Jeromy's avatar
Jeromy committed
231
- `IPNS`
Jeromy's avatar
Jeromy committed
232 233
Mountpoint for `/ipns/`.

Jeromy's avatar
Jeromy committed
234
- `FuseAllowOther`
235
Sets the FUSE allow other option on the mountpoint.
Jeromy's avatar
Jeromy committed
236

Łukasz Magiera's avatar
Łukasz Magiera committed
237 238 239
## `Reprovider`

- `Interval`
Jeromy's avatar
Jeromy committed
240 241 242 243 244 245 246 247
Sets the time between rounds of reproviding local content to the routing
system. If unset, it defaults to 12 hours. If set to the value `"0"` it will
disable content reproviding.

Note: disabling content reproviding will result in other nodes on the network
not being able to discover that you have the objects that you have. If you want
to have this disabled and keep the network aware of what you have, you must
manually announce your content periodically.
248

Łukasz Magiera's avatar
Łukasz Magiera committed
249 250 251 252 253 254
- `Strategy`
Tells reprovider what should be announced. Valid strategies are:
  - "all" (default) - announce all stored data
  - "pinned" - only announce pinned data
  - "roots" - only announce directly pinned keys and root keys of recursive pins

Jeromy's avatar
Jeromy committed
255 256 257
## `Swarm`
Options for configuring the swarm.

Jeromy's avatar
Jeromy committed
258
- `AddrFilters`
Jeromy's avatar
Jeromy committed
259
An array of address filters (multiaddr netmasks) to filter dials to.
Jeromy's avatar
Jeromy committed
260
See [this issue](https://github.com/ipfs/go-ipfs/issues/1226#issuecomment-120494604) for more
Łukasz Magiera's avatar
Łukasz Magiera committed
261
information.
Jeromy's avatar
Jeromy committed
262

263 264 265
- `DisableBandwidthMetrics`
A boolean value that when set to true, will cause ipfs to not keep track of
bandwidth metrics. Disabling bandwidth metrics can lead to a slight performance
Kevin Atkinson's avatar
Kevin Atkinson committed
266 267 268 269
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
270

vyzo's avatar
vyzo committed
271 272 273 274 275 276
- `DisableRelay`
Disables the p2p-circuit relay transport.

- `EnableRelayHop`
Enables HOP relay for the node. If this is enabled, the node will act as
an intermediate (Hop Relay) node in relay circuits for connected peers.
Jeromy's avatar
Jeromy committed
277 278 279 280 281 282 283 284 285 286 287 288 289 290

### `ConnMgr`
Connection manager configuration.

- `Type`
Sets the type of connection manager to use, options are: `"none"` and `"basic"`.

- `LowWater`
LowWater is the minimum number of connections to maintain.

- `HighWater`
HighWater is the number of connections that, when exceeded, will trigger a connection GC operation.
- `GracePeriod`
GracePeriod is a time duration that new connections are immune from being closed by the connection manager.
Łukasz Magiera's avatar
Łukasz Magiera committed
291 292 293 294 295 296 297 298 299 300 301 302 303 304

## Profiles
Configuration profiles allow to tweak configuration quickly. Profiles can be
applied with `--profile` flag to `ipfs init` or with `ipfs config profile apply`
command.

- `server` profile
Recommended for nodes with public IPv4 address, disables host and content
discovery in local networks.

- `test` profile
Reduces external interference, useful for running ipfs in test environments.
Note that with these settings node won't be able to talk to the rest of the
network without manual bootstrap.