Update GUIDE.md

This commit is contained in:
Mark Robert Henderson 2019-03-08 10:28:02 -05:00 committed by GitHub
parent 6cbcac6575
commit f63e43f566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())