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

Jeromy's avatar
Jeromy committed
3 4 5 6
The go-ipfs config file is a json document. It is read once at node instantiation,
either for an offline command, or for starting the daemon. Commands that execute on
a running daemon do not read the config file at runtime.

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
- `Type`
Jeromy's avatar
Jeromy committed
72 73 74 75
Denotes overall datastore type. The only currently valid option is `leveldb`.

Default: `leveldb`

Jeromy's avatar
Jeromy committed
76
- `Path`
Jeromy's avatar
Jeromy committed
77 78
Path to the leveldb datastore directory. Set during init to either `$IPFS_PATH/datastore`, or `$HOME/.ipfs/datastore` if `$IPFS_PATH` is unset.

Jeromy's avatar
Jeromy committed
79
- `StorageMax`
Jeromy's avatar
Jeromy committed
80 81 82 83
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.

Default: `10GB`

Jeromy's avatar
Jeromy committed
84
- `StorageGCWatermark`
Jeromy's avatar
Jeromy committed
85 86 87 88
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).

Default: `90`

Jeromy's avatar
Jeromy committed
89
- `GCPeriod`
Jeromy's avatar
Jeromy committed
90 91 92 93
A time duration specifying how frequently to run a garbage collection. Only used if automatic gc is enabled.

Default: `1h`

Jeromy's avatar
Jeromy committed
94
- `NoSync` *!*
Jeromy's avatar
Jeromy committed
95 96 97 98
A boolean value denoting whether or not to disable sanity syncing in the flatfs datastore code. Setting this to true may significantly improve performance, but be careful using it as if the daemon is killed before a write is synchronized to disk, there is a chance of data loss.

Default: `false`

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

- `BloomFilterSize`
103
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
104

vyzo's avatar
vyzo committed
105
Default: `0`
Jeromy's avatar
Jeromy committed
106 107

- `Params`
Jeromy's avatar
Jeromy committed
108 109 110 111 112
Extra parameters for datastore construction, not currently used.

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

Jeromy's avatar
Jeromy committed
113
- `MDNS`
Jeromy's avatar
Jeromy committed
114 115
Options for multicast dns peer discovery.

Jeromy's avatar
Jeromy committed
116
  - `Enabled`
Jeromy's avatar
Jeromy committed
117 118 119 120
A boolean value for whether or not mdns should be active.

Default: `true`

Jeromy's avatar
Jeromy committed
121
  -  `Interval`
Jeromy's avatar
Jeromy committed
122 123 124 125
A number of seconds to wait between discovery checks.


## `Gateway`
126
Options for the HTTP gateway.
Jeromy's avatar
Jeromy committed
127

Jeromy's avatar
Jeromy committed
128
- `HTTPHeaders`
Jeromy's avatar
Jeromy committed
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
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
146
- `RootRedirect`
Jeromy's avatar
Jeromy committed
147 148 149 150
A url to redirect requests for `/` to.

Default: `""`

Jeromy's avatar
Jeromy committed
151
- `Writeable`
Jeromy's avatar
Jeromy committed
152 153 154 155
A boolean to configure whether the gateway is writeable or not.

Default: `false`

Jeromy's avatar
Jeromy committed
156
- `PathPrefixes`
Jeromy's avatar
Jeromy committed
157 158 159 160 161 162
TODO

Default: `[]`

## `Identity`

Jeromy's avatar
Jeromy committed
163
- `PeerID`
Jeromy's avatar
Jeromy committed
164 165
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
166
- `PrivKey`
Jeromy's avatar
Jeromy committed
167 168 169 170
The base64 encoded protobuf describing (and containing) the nodes private key.

## `Ipns`

Jeromy's avatar
Jeromy committed
171
- `RepublishPeriod`
Jeromy's avatar
Jeromy committed
172 173
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
174
- `RecordLifetime`
Jeromy's avatar
Jeromy committed
175 176 177
A time duration specifying the value to set on ipns records for their validity lifetime.
If unset, we default to 24 hours.

Jeromy's avatar
Jeromy committed
178
- `ResolveCacheSize`
Jeromy's avatar
Jeromy committed
179 180 181 182 183
The number of entries to store in an LRU cache of resolved ipns entries. Entries will be kept cached until their lifetime is expired.

Default: `128`

## `Mounts`
184
FUSE mount point configuration options.
Jeromy's avatar
Jeromy committed
185

Jeromy's avatar
Jeromy committed
186
- `IPFS`
Jeromy's avatar
Jeromy committed
187 188
Mountpoint for `/ipfs/`.

Jeromy's avatar
Jeromy committed
189
- `IPNS`
Jeromy's avatar
Jeromy committed
190 191
Mountpoint for `/ipns/`.

Jeromy's avatar
Jeromy committed
192
- `FuseAllowOther`
193
Sets the FUSE allow other option on the mountpoint.
Jeromy's avatar
Jeromy committed
194

Łukasz Magiera's avatar
Łukasz Magiera committed
195 196 197
## `Reprovider`

- `Interval`
Jeromy's avatar
Jeromy committed
198 199 200 201 202 203 204 205
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.
206

Łukasz Magiera's avatar
Łukasz Magiera committed
207 208 209 210 211 212
- `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
213 214 215 216 217 218
## `SupernodeRouting`
Deprecated.

## `Swarm`
Options for configuring the swarm.

Jeromy's avatar
Jeromy committed
219
- `AddrFilters`
Jeromy's avatar
Jeromy committed
220 221 222
An array of address filters (multiaddr netmasks) to filter dials to.
See https://github.com/ipfs/go-ipfs/issues/1226#issuecomment-120494604 for more information.

223 224 225
- `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
226 227 228 229
improvement, as well as a reduction in memory usage.

- `DisableNatPortMap`
Disable NAT discovery.
230

vyzo's avatar
vyzo committed
231 232 233 234 235 236
- `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.