Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
docs: fix incorrect description in custom repo example
Browse files Browse the repository at this point in the history
automatically stop the node in the custom repo example
  • Loading branch information
jacobheun committed Apr 17, 2018
1 parent 1c23edc commit 924c808
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/custom-ipfs-repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This example shows you how to customize your repository, including where your da
* If you want to store data somewhere that’s not on your local disk, like S3, a Redis instance, a different machine on your local network, or in your own database system, like MongoDB or Postgres, you might use a custom datastore.
* If you have multiple browser windows or workers sharing the same IPFS storage, you might want to use a custom lock to coordinate between them. (Locking is currently only used to ensure a single IPFS instance can access a repo at a time. This check is done on `repo.open()`. A more complex lock, coupled with a custom datastore, could allow for safe writes to a single datastore from multiple IPFS nodes.)


You can find full details on customization in the [IPFS Repo Docs](https://github.com/ipfs/js-ipfs-repo#setup).

## Run this example
Expand All @@ -18,7 +17,7 @@ You can find full details on customization in the [IPFS Repo Docs](https://githu
## Other Options

### Custom Repo Lock
This example sets the repo locker to `false`, preventing any locking from happening. If you would like to control how locking happens, such as with a centralized S3 IPFS Repo, you can pass in your own custom lock. See [custom-lock.js](./custom-lock.js) for an example of a custom lock that can be used for [datastore-s3](https://github.com/ipfs/js-datastore-s3).
This example uses one of the locks that comes with IPFS Repo. If you would like to control how locking happens, such as with a centralized S3 IPFS Repo, you can pass in your own custom lock. See [custom-lock.js](./custom-lock.js) for an example of a custom lock that can be used for [datastore-s3](https://github.com/ipfs/js-datastore-s3).

```js
const S3Lock = require('./custom-lock')
Expand Down
2 changes: 2 additions & 0 deletions examples/custom-ipfs-repo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ node.on('ready', () => {
.then((data) => {
console.log('\nFetched file content:')
process.stdout.write(data)
console.log('\n\nStopping the node')
return node.stop()
})
// Log out the error, if there is one
.catch((err) => {
Expand Down

0 comments on commit 924c808

Please sign in to comment.