config.md 6.55 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 21
- [`SupernodeRouting`](#supernoderouting)
- [`Swarm`](#swarm)

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 28 29

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

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 46
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`
47
Contains information used by the API gateway.
Jeromy's avatar
Jeromy committed
48

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

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
71
- `StorageMax`
Łukasz Magiera's avatar
Łukasz Magiera committed
72 73
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
74 75 76

Default: `10GB`

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

Default: `90`

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

Default: `1h`

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

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

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

Jeromy's avatar
Jeromy committed
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 135
- `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
136 137 138 139

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

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

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

Default: `true`

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


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

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

Default: `""`

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

Default: `false`

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

Default: `[]`

## `Identity`

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

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

## `Ipns`

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

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

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

Default: `128`

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

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

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

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

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

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

Łukasz Magiera's avatar
Łukasz Magiera committed
239 240 241 242 243 244
- `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
245 246 247 248 249 250
## `SupernodeRouting`
Deprecated.

## `Swarm`
Options for configuring the swarm.

Jeromy's avatar
Jeromy committed
251
- `AddrFilters`
Jeromy's avatar
Jeromy committed
252
An array of address filters (multiaddr netmasks) to filter dials to.
Łukasz Magiera's avatar
Łukasz Magiera committed
253 254
See https://github.com/ipfs/go-ipfs/issues/1226#issuecomment-120494604 for more
information.
Jeromy's avatar
Jeromy committed
255

256 257 258
- `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
259 260 261 262
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
263

vyzo's avatar
vyzo committed
264 265 266 267 268 269
- `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.