From 9c18dfc161d056239198c2b67a0ff571537388fa Mon Sep 17 00:00:00 2001 From: shamb0t Date: Thu, 28 Nov 2019 13:57:53 +0000 Subject: [PATCH] add note about pinning --- GUIDE.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GUIDE.md b/GUIDE.md index 84e7d10..ede9934 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -325,6 +325,14 @@ ipfs.on('ready', async () => { }) ``` +**NOTE ON PERSISTENCY** + +OrbitDB does not automatically pin content added to IPFS. This means that if garbage collection is triggered, any unpinned content will be erased. To pin the entry, pass the optional `{ pin: true }` in the arguments: + +```js +await db.put('name', 'hello', { pin: true }) +``` + For adding entries to other databases, see: - [log.add()](https://github.com/orbitdb/orbit-db/blob/master/API.md#addevent) - [feed.add()](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddata)