mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-07-01 02:02:31 +00:00
Update GUIDE.md
This commit is contained in:
parent
6cbcac6575
commit
f63e43f566
36
GUIDE.md
36
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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user