From f63e43f566d0860edb341ed2b1ce3a39731a3392 Mon Sep 17 00:00:00 2001 From: Mark Robert Henderson Date: Fri, 8 Mar 2019 10:28:02 -0500 Subject: [PATCH] Update GUIDE.md --- GUIDE.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/GUIDE.md b/GUIDE.md index 5e7b116..d36a7bf 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -170,10 +170,12 @@ const ipfs = new IPFS() ipfs.on('ready', async () => { const orbitdb = new OrbitDB(ipfs) - const access = { - // Give write access to ourselves - write: [orbitdb.key.getPublic('hex')], - } + const options = { + accessController: { + // Give write access to ourselves + write: [orbitdb.key.getPublic('hex')], + } + }; const db = await orbitdb.keyvalue('first-database', access) console.log(db.address.toString()) @@ -192,11 +194,17 @@ const ipfs = new IPFS() ipfs.on('ready', async () => { const orbitdb = new OrbitDB(ipfs) - const access = { - // Setup write access - write: [ - // Give access to ourselves - orbitdb.key.getPublic('hex'), + const options = { + accessController: { + write: [ + // Give write access to ourselves + orbitdb.key.getPublic('hex'), + // Give access to the second peer + '042c07044e7ea51a489c02854db5e09f0191690dc59db0afd95328c9db614a2976e088cab7c86d7e48183191258fc59dc699653508ce25bf0369d67f33d5d77839', + ] + } + }; + // Give access to the second peer '042c07044e7ea51a489c02854db5e09f0191690dc59db0afd95328c9db614a2976e088cab7c86d7e48183191258fc59dc699653508ce25bf0369d67f33d5d77839', ], @@ -221,10 +229,12 @@ const ipfs = new IPFS() ipfs.on('ready', async () => { const orbitdb = new OrbitDB(ipfs) - const access = { - // Give write access to everyone - write: ['*'], - } + const options = { + accessController: { + // Give write access to ourselves + write: ['*'], + } + }; const db = await orbitdb.keyvalue('first-database', access) console.log(db.address.toString())