This repository was archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs: add config file #2256
Merged
Merged
docs: add config file #2256
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8ca659a
docs: add config file
vasco-santos 32863db
chore: address review
vasco-santos 27919d6
chore: address review
vasco-santos 4435871
chore: apply suggestions from code review
vasco-santos a85580c
chore: add delegates
vasco-santos 31ffb3c
chore: add keychain and update table of contents
vasco-santos 77da21b
docs: formatting tweaks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
# The js-ipfs config file | ||
|
||
The js-ipfs config file is a JSON document located in the root directory of the js-ipfs repository. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
dirkmc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Table of Contents | ||
|
||
- [`Addresses`](#addresses) | ||
- [`Bootstrap`](#bootstrap) | ||
- [`Datastore`](#datastore) | ||
- [`Discovery`](#discovery) | ||
- [`Identity`](#identity) | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- [`Swarm`](#swarm) | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
## `Addresses` | ||
Contains information about various listener addresses to be used by this node. | ||
|
||
- `API` | ||
The IPFS daemon exposes an HTTP API that allows to control the node and | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run the same commands as you can do from the command line. It is defined | ||
on the [HTTP API Spec](https://docs.ipfs.io/reference/api/http). | ||
|
||
Multiaddr describing the address to serve the local HTTP API on. | ||
dirkmc marked this conversation as resolved.
Show resolved
Hide resolved
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Default: `/ip4/127.0.0.1/tcp/5002` | ||
|
||
- `Gateway` | ||
A gateway is exposed by the IPFS daemon, which allows an easy way to | ||
access content from IPFS, using an IPFS path. | ||
|
||
Multiaddr describing the address to serve the local gateway on. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Default: `/ip4/127.0.0.1/tcp/9090` | ||
|
||
- `Swarm` | ||
Array of multiaddrs describing which addresses to listen on for p2p swarm connections. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Default: | ||
```json | ||
[ | ||
"/ip4/0.0.0.0/tcp/4002", | ||
"/ip4/127.0.0.1/tcp/4003/ws" | ||
] | ||
``` | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## `Bootstrap` | ||
Bootstrap is an array of multiaddrs of trusted nodes to connect to in order to | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
initiate a connection to the network. | ||
|
||
## `Datastore` | ||
Contains information related to the construction and operation of the on-disk | ||
storage system. | ||
|
||
- `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). | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I will remove that for now. I am not really familiar with the datastores side of things, and I prefer to not block this PR now, and I can get it done on a next PR. |
||
|
||
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" | ||
} | ||
``` | ||
|
||
## `Discovery` | ||
Contains options for configuring ipfs node discovery mechanisms. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `MDNS` | ||
Multicast dns is a discovery protocol that is able to find other peers | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
on the local network. | ||
|
||
Options for multicast dns peer discovery. | ||
dirkmc marked this conversation as resolved.
Show resolved
Hide resolved
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `Enabled` | ||
A boolean value for whether or not mdns should be active. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Default: `true` | ||
|
||
- `Interval` | ||
A number of seconds to wait between discovery checks. | ||
|
||
Default: `10` | ||
|
||
- `webRTCStar` | ||
WebRTCStar is a discovery mechanism prvided by a signalling-star that allows peer-to-peer communications in the browser. | ||
|
||
Options for webRTCstar peer discovery. | ||
|
||
- `Enabled` | ||
A boolean value for whether or not webRTCStar should be active. | ||
|
||
Default: `true` | ||
|
||
## `Identity` | ||
|
||
- `PeerID` | ||
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. | ||
|
||
- `PrivKey` | ||
The base64 encoded protobuf describing (and containing) the nodes private key. | ||
|
||
## `Swarm` | ||
|
||
Options for configuring the swarm. | ||
|
||
### `ConnMgr` | ||
|
||
The connection manager determines which and how many connections to keep and can be configured to keep. | ||
|
||
#### Basic Connection Manager | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `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. | ||
vasco-santos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
The "basic" connection manager tries to keep between `LowWater` and `HighWater` connections. It works by: | ||
|
||
1. Keeping all connections until `HighWater` connections is reached. | ||
2. Once `HighWater` is reached, it closes connections until `LowWater` is reached. | ||
|
||
**Example:** | ||
|
||
|
||
```json | ||
{ | ||
"Swarm": { | ||
"ConnMgr": { | ||
"LowWater": 100, | ||
"HighWater": 200, | ||
} | ||
} | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.