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: README.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ server.start((err) => {
131
131
-**`js`** - calling `DaemonFactory.create({type: 'js'})` will spawn a `js-ipfs` daemon.
132
132
-**`proc`** - calling `DaemonFactory.create({type: 'proc', exec: require('ipfs') })` will spawn an `in process js-ipfs node` using the provided code reference that implements the core IPFS API. Note that, `exec` option to `df.spawn()` is required if `type: 'proc'` is used.
133
133
134
-
#### DaemonFactory endpoint for remote spawning - `const server = DaemonFactory.createServer([options]) `
134
+
#### DaemonFactory endpoint for remote spawning - `const server = `DaemonFactory.createServer([options]) `
135
135
136
136
`DaemonFactory.createServer` create an instance of the bundled REST API used by the remote controller.
137
137
@@ -162,15 +162,15 @@ The IPFS daemon controller (`ipfsd`) allows you to interact with the spawned IPF
162
162
163
163
#### `ipfsd.apiAddr` (getter)
164
164
165
-
Get the address (multiaddr) of connected IPFS API. Returns a multiaddr,
165
+
Get the address (multiaddr) of connected IPFS API. Returns a multiaddr
166
166
167
167
#### `ipfsd.gatewayAddr` (getter)
168
168
169
169
Get the address (multiaddr) of connected IPFS HTTP Gateway. Returns a multiaddr.
170
170
171
171
#### `ipfsd.repoPath` (getter)
172
172
173
-
Get the current repo path. Returns string
173
+
Get the current repo path. Returns string.
174
174
175
175
#### `ipfsd.started` (getter)
176
176
@@ -181,7 +181,7 @@ Is the node started. Returns a boolean.
181
181
Initialize a repo.
182
182
183
183
`initOpts` (optional) is an object with the following properties:
184
-
-`keysize` (default 2048) - The bit size of the identiy key.
184
+
-`keysize` (default 2048) - The bit size of the identity key.
185
185
-`directory` (default IPFS_PATH if defined, or ~/.ipfs for go-ipfs and ~/.jsipfs for js-ipfs) - The location of the repo.
186
186
187
187
`callback` is a function with the signature `function (Error, ipfsd)` where `err` is an Error in case something goes wrong and `ipfsd` is the daemon controller instance.
@@ -198,36 +198,36 @@ Start the daemon.
198
198
199
199
`flags` - Flags array to be passed to the `ipfs daemon` command.
200
200
201
-
`callback` is a function with the signature `function(err, ipfsApi)}` that receives an instance of `ipfs-api` on success or an instance of `Error` on failure
201
+
`callback` is a function with the signature `function(err, ipfsApi)` that receives an instance of `ipfs-api` on success or an instance of `Error` on failure
202
202
203
203
204
-
#### `ipfsd.stop(callback)`
204
+
#### `ipfsd.stop([callback])`
205
205
206
206
Stop the daemon.
207
207
208
208
`callback` is a function with the signature `function(err)` callback - function that receives an instance of `Error` on failure
209
209
210
-
#### `ipfsd.killProcess (callback)`
210
+
#### `ipfsd.killProcess([callback])`
211
211
212
212
Kill the `ipfs daemon` process.
213
213
214
214
First a `SIGTERM` is sent, after 10.5 seconds `SIGKILL` is sent if the process hasn't exited yet.
215
215
216
216
`callback` is a function with the signature `function()` called once the process is killed
217
217
218
-
#### `ipfsd.pid()`
218
+
#### `ipfsd.pid()`
219
219
220
220
Get the pid of the `ipfs daemon` process. Returns the pid number
221
221
222
-
#### `ipfsd.getConfig(key, callback)`
222
+
#### `ipfsd.getConfig([key], callback)`
223
223
224
224
Returns the output of an `ipfs config` command. If no `key` is passed, the whole config is returned as an object.
225
225
226
226
`key` (optional) - A specific config to retrieve.
227
227
228
-
`callback` is a function with the signature `function(err, (Object|string)` that receives an object or string on success or an `Error` instance on failure
228
+
`callback` is a function with the signature `function(err, (Object|string))` that receives an object or string on success or an `Error` instance on failure
229
229
230
-
#### `ipfsd.setConfig(key, value, callback)`
230
+
#### `ipfsd.setConfig(key, value, callback)`
231
231
232
232
Set a config value.
233
233
@@ -251,7 +251,7 @@ This instance is returned for each successfully started IPFS daemon, when either
251
251
252
252
### Packaging
253
253
254
-
`ipfsd-ctl` can be packaged in Electron applications, but the ipfs binary has to be excluded from asar (Electron Archives),
254
+
`ipfsd-ctl` can be packaged in Electron applications, but the ipfs binary has to be excluded from asar (Electron Archives).
255
255
[read more about unpack files from asar](https://electron.atom.io/docs/tutorial/application-packaging/#adding-unpacked-files-in-asar-archive).
256
256
257
257
`ipfsd-ctl` will try to detect if used from within an `app.asar` archive and tries to resolve ipfs from `app.asar.unpacked`. The ipfs binary is part of the `go-ipfs-dep` module.
0 commit comments