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
IPFS repo exposes a well defined interface by the Repo Spec. Each of the individual repos has an interface defined by [abstract-blob-store](https://github.com/maxogden/abstract-blob-store), this enables us to make IPFS repo portable (running on Node.js vs the browser) and accept different types of storage mechanisms for each repo (fs, levelDB, etc).
44
+
This provides a well defined interface for creating and interacting with an IPFS
45
+
Repo backed by a group of abstract backends for keys, configuration, logs, and
46
+
more. Each of the individual repos has an interface defined by
47
+
[abstract-blob-store](https://github.com/maxogden/abstract-blob-store): this
48
+
enables us to make IPFS Repo portable (running on Node.js vs the browser) and
49
+
accept different types of storage mechanisms for each repo (fs, levelDB, etc).
45
50
46
51
## Good to know (historical context)
47
52
48
53
- The datastore folder holds the legacy version of datastore, still built in levelDB, there is a current endeavour of pushing it to fs completely.
49
54
- The blocks folder is the current version of datastore.
50
55
- The keys repo doesn't exist yet, as the private key is simply stored inside config
51
56
52
-
# Installation
53
-
54
-
## npm
55
-
56
-
```sh
57
-
> npm i ipfs-repo
58
-
```
59
-
60
-
## Use in Node.js
61
-
62
-
```JavaScript
63
-
var IPFSRepo =require('ipfs-repo')
64
-
```
65
-
66
-
## Use in a browser with browserify, webpack or any other bundler
67
-
68
-
The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.
69
-
70
-
```JavaScript
71
-
var IPFSRepo =require('ipfs-repo')
72
-
```
73
-
74
-
## Use in a browser Using a script tag
75
-
76
-
Loading this module through a script tag will make the `Unixfs` obj available in the global namespace.
var fsBlobStore =require('fs-blob-store') // an in-memory blob store
@@ -122,12 +94,6 @@ Valid keys for `opts` include:
122
94
123
95
If you use the former form, all of the sub-blob-stores will use the same store.
124
96
125
-
### repo.init(config, cb)
126
-
127
-
Initializes the IPFS repository at the repo's `path`. Currently this is a no-op.
128
-
129
-
Consumes a config object `config`*(TODO: specification?)* By default, init requires the repo not yet exist (by default). Calls the callback `cb(err)` on completion or error.
130
-
131
97
### repo.exists(cb)
132
98
133
99
Check if the repo you are going to access already exists. Calls the callback
@@ -158,18 +124,42 @@ Read and write buffers to/from the repo's block store.
158
124
159
125
**WIP**
160
126
161
-
## Install
127
+
#Installation
162
128
163
-
Install via npm:
129
+
## npm
164
130
165
-
```bash
166
-
$ npm i ipfs-repo
131
+
```sh
132
+
> npm i ipfs-repo
133
+
```
134
+
135
+
## Use in Node.js
136
+
137
+
```JavaScript
138
+
var IPFSRepo =require('ipfs-repo')
139
+
```
140
+
141
+
## Use in a browser with browserify, webpack or any other bundler
142
+
143
+
The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.
144
+
145
+
```JavaScript
146
+
var IPFSRepo =require('ipfs-repo')
147
+
```
148
+
149
+
## Use in a browser Using a script tag
150
+
151
+
Loading this module through a script tag will make the `Unixfs` obj available in the global namespace.
0 commit comments