config.md 7.1 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 20
- [`Swarm`](#swarm)

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

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

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

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

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

Jeromy's avatar
Jeromy committed
34
- `Swarm`
Jeromy's avatar
Jeromy committed
35 36 37 38 39 40 41 42 43 44
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
45 46 47 48 49 50 51 52 53 54
- `Announce`
Array of swarm addresses to announce to the network.

Default: `[]`

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

Default: `[]`

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

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

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
80
- `StorageMax`
Łukasz Magiera's avatar
Łukasz Magiera committed
81 82
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.
Jeromy's avatar
Jeromy committed
83 84 85

Default: `10GB`

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

Default: `90`

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

Default: `1h`

Jeromy's avatar
Jeromy committed
99
- `HashOnRead`
Łukasz Magiera's avatar
Łukasz Magiera committed
100 101
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
102 103

- `BloomFilterSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
104 105
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
106

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

Jeromy's avatar
Jeromy committed
109 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
- `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
145 146 147 148

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

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

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

Default: `true`

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


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

Jeromy's avatar
Jeromy committed
164
- `HTTPHeaders`
Jeromy's avatar
Jeromy committed
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
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
182
- `RootRedirect`
Jeromy's avatar
Jeromy committed
183 184 185 186
A url to redirect requests for `/` to.

Default: `""`

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

Default: `false`

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

Default: `[]`

## `Identity`

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

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

## `Ipns`

Jeromy's avatar
Jeromy committed
209
- `RepublishPeriod`
Łukasz Magiera's avatar
Łukasz Magiera committed
210 211
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.
Jeromy's avatar
Jeromy committed
212

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

Jeromy's avatar
Jeromy committed
218
- `ResolveCacheSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
219 220
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
221 222 223 224

Default: `128`

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

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

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

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

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

- `Interval`
Jeromy's avatar
Jeromy committed
239 240 241 242 243 244 245 246
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.
247

Łukasz Magiera's avatar
Łukasz Magiera committed
248 249 250 251 252 253
- `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
254 255 256
## `Swarm`
Options for configuring the swarm.

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

262 263 264
- `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
265 266 267 268
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
269

vyzo's avatar
vyzo committed
270 271 272 273 274 275
- `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
276 277 278 279 280 281 282 283 284 285 286 287 288 289

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