Skip to content

Commit 8b32835

Browse files
vasco-santosdaviddias
authored andcommitted
fix: update repo specs according to the current state of go-ipfs repo (#186)
1 parent 28f62a8 commit 8b32835

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

repo/README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ used. Most commonly, IPFS nodes use an [fs-repo](fs-repo).
2828

2929
Repo Implementations:
3030
- [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
3333

3434
<center>
3535
<img src="ipfs-repo.png" width="256" />
@@ -39,21 +39,22 @@ Repo Implementations:
3939

4040
The Repo stores a collection of [IPLD](../merkledag/ipld.md) objects that represent:
4141

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)
4746

4847
Note that the IPLD objects a repo stores are divided into:
4948
- **state** (system, control plane) used for the node's internal state
5049
- **content** (userland, data plane) which represent the user's cached and pinned data.
5150

5251
Additionally, the repo state must determine the following. These need not be IPLD objects, though it is of course encouraged:
5352

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
5656

57+
Finally, the repo also stores the blocks with blobs containing binary data.
5758

5859
![](ipfs-repo-contents.png?)
5960

@@ -76,7 +77,6 @@ The name "datastore" comes from [go-datastore](https://github.com/jbenet/go-data
7677

7778
This makes it easy to change properties or performance characteristics of a repo without an entirely new implementation.
7879

79-
8080
### keys (state)
8181

8282
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
9494
The node's `config` (configuration) is a tree of variables, used to configure various aspects of operation. For example:
9595
- the set of bootstrap peers IPFS uses to connect to the network
9696
- the Swarm, API, and Gateway network listen addresses
97+
- the Datastore configuration regarding the contruction and operation of the on-disk storage system.
9798

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`.
107100

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.
109102

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.
111104

112105
### locks
113106

@@ -116,6 +109,12 @@ IPFS implementations may use multiple processes, or may disallow multiple proces
116109
All repos contain the following standard locks:
117110
- `repo.lock` - prevents concurrent access to the repo. Must be held to _read_ or _write_.
118111

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+
119118
### hooks (TODO)
120119

121120
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

Comments
 (0)