You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: repo/README.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,8 @@ used. Most commonly, IPFS nodes use an [fs-repo](fs-repo).
28
28
29
29
Repo Implementations:
30
30
-[fs-repo](fs-repo) - stored in the os filesystem
31
-
-[mem-repo](mem-repo) - stored in process memory
32
-
-[s3-repo](s3-repo) - stored in amazon s3
31
+
- mem-repo - stored in process memory
32
+
- s3-repo - stored in amazon s3
33
33
34
34
<center>
35
35
<imgsrc="ipfs-repo.png"width="256" />
@@ -39,21 +39,22 @@ Repo Implementations:
39
39
40
40
The Repo stores a collection of [IPLD](../merkledag/ipld.md) objects that represent:
41
41
42
-
- keys - cryptographic keys, including node's identity
43
-
- config - node configuration and settings
44
-
- datastore - content stored locally, and indexing data
45
-
- logs - debugging and usage event logs
46
-
- hooks - scripts to run at predefined times (not yet implemented)
42
+
-**config** - node configuration and settings
43
+
-**datastore** - content stored locally, and indexing data
44
+
-**keys** - cryptographic keys, including node's identity
45
+
-**hooks** - scripts to run at predefined times (not yet implemented)
47
46
48
47
Note that the IPLD objects a repo stores are divided into:
49
48
-**state** (system, control plane) used for the node's internal state
50
49
-**content** (userland, data plane) which represent the user's cached and pinned data.
51
50
52
51
Additionally, the repo state must determine the following. These need not be IPLD objects, though it is of course encouraged:
53
52
54
-
- version - the repo version, required for safe migrations
55
-
- locks - process semaphores for correct concurrent access
53
+
-**version** - the repo version, required for safe migrations
54
+
-**locks** - process semaphores for correct concurrent access
55
+
-**datastore_spec** - array of mounting points and their properties
56
56
57
+
Finally, the repo also stores the blocks with blobs containing binary data.
57
58
58
59

59
60
@@ -76,7 +77,6 @@ The name "datastore" comes from [go-datastore](https://github.com/jbenet/go-data
76
77
77
78
This makes it easy to change properties or performance characteristics of a repo without an entirely new implementation.
78
79
79
-
80
80
### keys (state)
81
81
82
82
A Repo typically holds the keys a node has access to, for signing and for encryption. This includes:
@@ -94,20 +94,13 @@ Keys are structured using the [multikey](https://github.com/jbenet/multikey) for
94
94
The node's `config` (configuration) is a tree of variables, used to configure various aspects of operation. For example:
95
95
- the set of bootstrap peers IPFS uses to connect to the network
96
96
- the Swarm, API, and Gateway network listen addresses
97
+
- the Datastore configuration regarding the contruction and operation of the on-disk storage system.
97
98
98
-
It is recommended that `config` files avoid identifying information, so that they may be re-shared across multiple nodes.
99
-
100
-
**CHANGES**: today, implementations like go-ipfs store the peer-id and private key directly in the config. These will be removed and moved out.
101
-
102
-
### logs
103
-
104
-
A full IPFS node is complex. Many events can happen, and thus some IPFS
105
-
implementations capture event logs and (optionally) store them for user review
106
-
or debugging.
99
+
There is a set of properties, which are mandatory for the repo usage. Those are `Addresses`, `Discovery`, `Bootstrap`, `Identity`, `Datastore` and `Keychain`.
107
100
108
-
Logs MAY be stored directly as IPLD objects along with everything else, but this may be a problem if the logs
101
+
It is recommended that `config` files avoid identifying information, so that they may be re-shared across multiple nodes.
109
102
110
-
**NOTE**: go-ipfs no longer stores logs. it only emits them at a given route. This section is kept here in case other implementations may wish to store logs, though it may be removed in the future.
103
+
**CHANGES**: today, implementations like js-ipfs and go-ipfs store the peer-id and private key directly in the config. These will be removed and moved out.
111
104
112
105
### locks
113
106
@@ -116,6 +109,12 @@ IPFS implementations may use multiple processes, or may disallow multiple proces
116
109
All repos contain the following standard locks:
117
110
-`repo.lock` - prevents concurrent access to the repo. Must be held to _read_ or _write_.
118
111
112
+
### datastore_spec
113
+
114
+
This file is created according to the Datastore configuration specified in the `config` file. It contains an array with all the mounting points that the repo is using, as well as its properties. This way, the `datastore_spec` file must have the same mounting points as defined in the Datastore configuration.
115
+
116
+
It is important pointing out that the `Datastore` in config must have a `Spec` property, which defines the structure of the ipfs datastore. It is a composable structure, where each datastore is represented by a json object.
117
+
119
118
### hooks (TODO)
120
119
121
120
Like git, IPFS nodes will allow `hooks`, a set of user configurable scripts to run at predefined moments in IPFS operations. This makes it easy to customize the behavior of IPFS nodes without changing the implementations themselves.
0 commit comments