config.md 4.97 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 18 19 20 21
## Table of Contents

- [`Addresses`](#addresses)
- [`API`](#api)
- [`Bootstrap`](#bootstrap)
- [`Datastore`](#datastore)
- [`Discovery`](#discovery)
- [`Gateway`](#gateway)
- [`Identity`](#identity)
- [`Ipns`](#ipns)
- [`Mounts`](#mounts)
- [`SupernodeRouting`](#supernoderouting)
- [`Swarm`](#swarm)
- [`Tour`](#tour)

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 103 104 105 106 107
- `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`
A number representing the size in bits of the blockstore's bloom filter. A value of zero represents the feature being disabled.

Default: `0` 

- `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 195 196 197 198 199 200

## `SupernodeRouting`
Deprecated.

## `Swarm`
Options for configuring the swarm.

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

## `Tour`
Unused.