config.md 6 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)
Łukasz Magiera's avatar
Łukasz Magiera committed
18
- [`Reproviderl`](#reprovider)
19 20 21 22
- [`SupernodeRouting`](#supernoderouting)
- [`Swarm`](#swarm)
- [`Tour`](#tour)

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

Jeromy's avatar
Jeromy committed
26
- `API`
27
Multiaddr describing the address to serve the local HTTP API on.
Jeromy's avatar
Jeromy committed
28 29 30

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

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

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

Jeromy's avatar
Jeromy committed
36
- `Swarm`
Jeromy's avatar
Jeromy committed
37 38 39 40 41 42 43 44 45 46 47
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`
48
Contains information used by the API gateway.
Jeromy's avatar
Jeromy committed
49

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

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

Default: `leveldb`

Jeromy's avatar
Jeromy committed
77
- `Path`
Jeromy's avatar
Jeromy committed
78 79
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
80
- `StorageMax`
Jeromy's avatar
Jeromy committed
81 82 83 84
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
85
- `StorageGCWatermark`
Jeromy's avatar
Jeromy committed
86 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).

Default: `90`

Jeromy's avatar
Jeromy committed
90
- `GCPeriod`
Jeromy's avatar
Jeromy committed
91 92 93 94
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
95
- `NoSync` *!*
Jeromy's avatar
Jeromy committed
96 97 98 99
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
100 101 102 103
- `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`
104
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
105 106 107 108

Default: `0` 

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

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

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

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

Default: `true`

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


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

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

Default: `""`

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

Default: `false`

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

Default: `[]`

## `Identity`

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

## `Ipns`

Jeromy's avatar
Jeromy committed
172
- `RepublishPeriod`
Jeromy's avatar
Jeromy committed
173 174
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
175
- `RecordLifetime`
Jeromy's avatar
Jeromy committed
176 177 178
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
179
- `ResolveCacheSize`
Jeromy's avatar
Jeromy committed
180 181 182 183 184
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`
185
FUSE mount point configuration options.
Jeromy's avatar
Jeromy committed
186

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

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

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

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

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

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

## `Swarm`
Options for configuring the swarm.

Jeromy's avatar
Jeromy committed
220
- `AddrFilters`
Jeromy's avatar
Jeromy committed
221 222 223
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.

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

- `DisableNatPortMap`
Disable NAT discovery.
231

Jeromy's avatar
Jeromy committed
232 233
## `Tour`
Unused.