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

Commit

Permalink
docs: clarify custom-repo docs
Browse files Browse the repository at this point in the history
chore: bump custom repo example ipfs-repo version
  • Loading branch information
jacobheun committed Apr 23, 2018
1 parent e656f9c commit 10b34fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions examples/custom-ipfs-repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ You can find full details on customization in the [IPFS Repo Docs](https://githu

## Other Options

### Custom `storageBackends`
This example leverages [datastore-fs](https://github.com/ipfs/js-datastore-fs) to store all data in the IPFS Repo. You can customize each of the 4 `storageBackends` to meet the needs of your project. For an example on how to manage your entire IPFS REPO on S3, you can see the [datastore-s3 example](https://github.com/ipfs/js-datastore-s3/tree/master/examples/full-s3-repo).

### Custom Repo Lock
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).

Expand Down
12 changes: 8 additions & 4 deletions examples/custom-ipfs-repo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ const customRepositoryOptions = {
* in `storageBackends`. If you create a custom datastore, this is where you can pass in
* custom constructor arguments. You can see an S3 datastore example at:
* https://github.com/ipfs/js-datastore-s3/tree/master/examples/full-s3-repo
*
* NOTE: The following options are being overriden for demonstration purposes only.
* In most instances you can simply use the default options, by not passing in any
* overrides, which is recommended if you have no need to override.
*/
storageBackendOptions: {
root: {
extension: '.ipfsroot', // Used by datastore-fs; Appended to all files
extension: '.ipfsroot', // Defaults to ''. Used by datastore-fs; Appended to all files
errorIfExists: false, // Used by datastore-fs; If the datastore exists, don't throw an error
createIfMissing: true // Used by datastore-fs; If the datastore doesn't exist yet, create it
},
blocks: {
sharding: false, // Used by IPFSRepo Blockstore to determine sharding; Ignored by datastore-fs
extension: '.ipfsblock',
extension: '.ipfsblock', // Defaults to '.data'.
errorIfExists: false,
createIfMissing: true
},
keys: {
extension: '.ipfskey',
extension: '.ipfskey', // No extension by default
errorIfExists: false,
createIfMissing: true
},
datastore: {
extension: '.ipfsds',
extension: '.ipfsds', // No extension by default
errorIfExists: false,
createIfMissing: true
}
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-ipfs-repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"dependencies": {
"datastore-fs": "~0.4.2",
"ipfs": "file:../../",
"ipfs-repo": "~0.19.0"
"ipfs-repo": "^0.20.0"
}
}

0 comments on commit 10b34fb

Please sign in to comment.