config.md 6.97 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 27 28

Default: `/ip4/127.0.0.1/tcp/4001`

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 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"
]
```

## `API`
46
Contains information used by the API gateway.
Jeromy's avatar
Jeromy committed
47

Jeromy's avatar
Jeromy committed
48
- `HTTPHeaders`
49
Map of HTTP headers to set on responses from the API HTTP server.
Jeromy's avatar
Jeromy committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

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
70
- `StorageMax`
71 72
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
73 74 75

Default: `10GB`

Jeromy's avatar
Jeromy committed
76
- `StorageGCWatermark`
Łukasz Magiera's avatar
Łukasz Magiera committed
77 78 79
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
80 81 82

Default: `90`

Jeromy's avatar
Jeromy committed
83
- `GCPeriod`
Łukasz Magiera's avatar
Łukasz Magiera committed
84 85
A time duration specifying how frequently to run a garbage collection. Only used
if automatic gc is enabled.
Jeromy's avatar
Jeromy committed
86 87 88

Default: `1h`

Jeromy's avatar
Jeromy committed
89
- `HashOnRead`
Łukasz Magiera's avatar
Łukasz Magiera committed
90 91
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
92 93

- `BloomFilterSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
94 95
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
96

vyzo's avatar
vyzo committed
97
Default: `0`
Jeromy's avatar
Jeromy committed
98

Jeromy's avatar
Jeromy committed
99 100 101 102 103 104 105 106 107 108 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
- `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
135 136 137 138

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

Jeromy's avatar
Jeromy committed
139
- `MDNS`
Jeromy's avatar
Jeromy committed
140 141
Options for multicast dns peer discovery.

Jeromy's avatar
Jeromy committed
142
  - `Enabled`
Jeromy's avatar
Jeromy committed
143 144 145 146
A boolean value for whether or not mdns should be active.

Default: `true`

Jeromy's avatar
Jeromy committed
147
  -  `Interval`
Jeromy's avatar
Jeromy committed
148 149 150 151
A number of seconds to wait between discovery checks.


## `Gateway`
152
Options for the HTTP gateway.
Jeromy's avatar
Jeromy committed
153

Jeromy's avatar
Jeromy committed
154
- `HTTPHeaders`
Jeromy's avatar
Jeromy committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
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
172
- `RootRedirect`
Jeromy's avatar
Jeromy committed
173 174 175 176
A url to redirect requests for `/` to.

Default: `""`

Jeromy's avatar
Jeromy committed
177
- `Writeable`
Jeromy's avatar
Jeromy committed
178 179 180 181
A boolean to configure whether the gateway is writeable or not.

Default: `false`

Jeromy's avatar
Jeromy committed
182
- `PathPrefixes`
Jeromy's avatar
Jeromy committed
183 184 185 186 187 188
TODO

Default: `[]`

## `Identity`

Jeromy's avatar
Jeromy committed
189
- `PeerID`
Łukasz Magiera's avatar
Łukasz Magiera committed
190 191 192
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
193

Jeromy's avatar
Jeromy committed
194
- `PrivKey`
Jeromy's avatar
Jeromy committed
195 196 197 198
The base64 encoded protobuf describing (and containing) the nodes private key.

## `Ipns`

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

Jeromy's avatar
Jeromy committed
203
- `RecordLifetime`
Łukasz Magiera's avatar
Łukasz Magiera committed
204 205
A time duration specifying the value to set on ipns records for their validity
lifetime.
Jeromy's avatar
Jeromy committed
206 207
If unset, we default to 24 hours.

Jeromy's avatar
Jeromy committed
208
- `ResolveCacheSize`
Łukasz Magiera's avatar
Łukasz Magiera committed
209 210
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
211 212 213 214

Default: `128`

## `Mounts`
215
FUSE mount point configuration options.
Jeromy's avatar
Jeromy committed
216

Jeromy's avatar
Jeromy committed
217
- `IPFS`
Jeromy's avatar
Jeromy committed
218 219
Mountpoint for `/ipfs/`.

Jeromy's avatar
Jeromy committed
220
- `IPNS`
Jeromy's avatar
Jeromy committed
221 222
Mountpoint for `/ipns/`.

Jeromy's avatar
Jeromy committed
223
- `FuseAllowOther`
224
Sets the FUSE allow other option on the mountpoint.
Jeromy's avatar
Jeromy committed
225

Łukasz Magiera's avatar
Łukasz Magiera committed
226 227 228
## `Reprovider`

- `Interval`
Jeromy's avatar
Jeromy committed
229 230 231 232 233 234 235 236
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.
237

Łukasz Magiera's avatar
Łukasz Magiera committed
238 239 240 241 242 243
- `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
244 245 246
## `Swarm`
Options for configuring the swarm.

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

252 253 254
- `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
255 256 257 258
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
259

vyzo's avatar
vyzo committed
260 261 262 263 264 265
- `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
266 267 268 269 270 271 272 273 274 275 276 277 278 279

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