config.md 8.11 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
#### 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.

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Available profiles:
- `server`

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

- `test`

  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.

- `badgerds`

  Replaces default datastore configuration with experimental badger datastore.
  If you apply this profile after `ipfs init`, you will need to convert your
  datastore to the new configuration. You can do this using [ipfs-ds-convert](https://github.com/ipfs/ipfs-ds-convert)

  WARNING: badger datastore is experimantal. Make sure to backup your data
  frequently

33

34 35 36 37 38 39 40 41 42 43 44
## Table of Contents

- [`Addresses`](#addresses)
- [`API`](#api)
- [`Bootstrap`](#bootstrap)
- [`Datastore`](#datastore)
- [`Discovery`](#discovery)
- [`Gateway`](#gateway)
- [`Identity`](#identity)
- [`Ipns`](#ipns)
- [`Mounts`](#mounts)
45
- [`Reprovider`](#reprovider)
46 47
- [`Swarm`](#swarm)

Jeromy's avatar
Jeromy committed
48 49 50
## `Addresses`
Contains information about various listener addresses to be used by this node.

Jeromy's avatar
Jeromy committed
51
- `API`
52
Multiaddr describing the address to serve the local HTTP API on.
Jeromy's avatar
Jeromy committed
53

John Reed's avatar
John Reed committed
54
Default: `/ip4/127.0.0.1/tcp/5001`
Jeromy's avatar
Jeromy committed
55

Jeromy's avatar
Jeromy committed
56
- `Gateway`
Jeromy's avatar
Jeromy committed
57 58 59 60
Multiaddr describing the address to serve the local gateway on.

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

Jeromy's avatar
Jeromy committed
61
- `Swarm`
Jeromy's avatar
Jeromy committed
62 63 64 65 66 67 68 69 70 71
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
72
- `Announce`
John Reed's avatar
John Reed committed
73
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
74 75 76 77 78 79 80 81

Default: `[]`

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

Default: `[]`

Jeromy's avatar
Jeromy committed
82
## `API`
83
Contains information used by the API gateway.
Jeromy's avatar
Jeromy committed
84

Jeromy's avatar
Jeromy committed
85
- `HTTPHeaders`
86
Map of HTTP headers to set on responses from the API HTTP server.
Jeromy's avatar
Jeromy committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

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
107
- `StorageMax`
108 109
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
110 111 112

Default: `10GB`

Jeromy's avatar
Jeromy committed
113
- `StorageGCWatermark`
Łukasz Magiera's avatar
Łukasz Magiera committed
114 115 116
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
117 118 119

Default: `90`

Jeromy's avatar
Jeromy committed
120
- `GCPeriod`
Łukasz Magiera's avatar
Łukasz Magiera committed
121 122
A time duration specifying how frequently to run a garbage collection. Only used
if automatic gc is enabled.
Jeromy's avatar
Jeromy committed
123 124 125

Default: `1h`

Jeromy's avatar
Jeromy committed
126
- `HashOnRead`
Łukasz Magiera's avatar
Łukasz Magiera committed
127 128
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
129 130

- `BloomFilterSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
131 132
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
133

vyzo's avatar
vyzo committed
134
Default: `0`
Jeromy's avatar
Jeromy committed
135

Jeromy's avatar
Jeromy committed
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
- `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
172 173 174 175

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

Jeromy's avatar
Jeromy committed
176
- `MDNS`
Jeromy's avatar
Jeromy committed
177 178
Options for multicast dns peer discovery.

Jeromy's avatar
Jeromy committed
179
  - `Enabled`
Jeromy's avatar
Jeromy committed
180 181 182 183
A boolean value for whether or not mdns should be active.

Default: `true`

Jeromy's avatar
Jeromy committed
184
  -  `Interval`
Jeromy's avatar
Jeromy committed
185 186 187 188
A number of seconds to wait between discovery checks.


## `Gateway`
189
Options for the HTTP gateway.
Jeromy's avatar
Jeromy committed
190

Jeromy's avatar
Jeromy committed
191
- `HTTPHeaders`
Jeromy's avatar
Jeromy committed
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
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
209
- `RootRedirect`
Jeromy's avatar
Jeromy committed
210 211 212 213
A url to redirect requests for `/` to.

Default: `""`

Jeromy's avatar
Jeromy committed
214
- `Writeable`
Jeromy's avatar
Jeromy committed
215 216 217 218
A boolean to configure whether the gateway is writeable or not.

Default: `false`

Jeromy's avatar
Jeromy committed
219
- `PathPrefixes`
Jeromy's avatar
Jeromy committed
220 221 222 223 224 225
TODO

Default: `[]`

## `Identity`

Jeromy's avatar
Jeromy committed
226
- `PeerID`
Łukasz Magiera's avatar
Łukasz Magiera committed
227 228 229
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
230

Jeromy's avatar
Jeromy committed
231
- `PrivKey`
Jeromy's avatar
Jeromy committed
232 233 234 235
The base64 encoded protobuf describing (and containing) the nodes private key.

## `Ipns`

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

Jeromy's avatar
Jeromy committed
240
- `RecordLifetime`
Łukasz Magiera's avatar
Łukasz Magiera committed
241 242
A time duration specifying the value to set on ipns records for their validity
lifetime.
Jeromy's avatar
Jeromy committed
243 244
If unset, we default to 24 hours.

Jeromy's avatar
Jeromy committed
245
- `ResolveCacheSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
246 247
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
248 249 250 251

Default: `128`

## `Mounts`
252
FUSE mount point configuration options.
Jeromy's avatar
Jeromy committed
253

Jeromy's avatar
Jeromy committed
254
- `IPFS`
Jeromy's avatar
Jeromy committed
255 256
Mountpoint for `/ipfs/`.

Jeromy's avatar
Jeromy committed
257
- `IPNS`
Jeromy's avatar
Jeromy committed
258 259
Mountpoint for `/ipns/`.

Jeromy's avatar
Jeromy committed
260
- `FuseAllowOther`
261
Sets the FUSE allow other option on the mountpoint.
Jeromy's avatar
Jeromy committed
262

Łukasz Magiera's avatar
Łukasz Magiera committed
263 264 265
## `Reprovider`

- `Interval`
Jeromy's avatar
Jeromy committed
266 267 268 269 270 271 272 273
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.
274

Łukasz Magiera's avatar
Łukasz Magiera committed
275 276 277 278 279 280
- `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
281 282 283
## `Swarm`
Options for configuring the swarm.

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

289 290 291
- `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
292 293 294 295
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
296

vyzo's avatar
vyzo committed
297 298 299 300 301 302
- `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
303 304 305 306 307 308 309 310 311 312 313 314 315 316

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