mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-07-01 10:12:29 +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 () => {
|
ipfs.on('ready', async () => {
|
||||||
const orbitdb = new OrbitDB(ipfs)
|
const orbitdb = new OrbitDB(ipfs)
|
||||||
|
|
||||||
const access = {
|
const options = {
|
||||||
// Give write access to ourselves
|
accessController: {
|
||||||
write: [orbitdb.key.getPublic('hex')],
|
// Give write access to ourselves
|
||||||
}
|
write: [orbitdb.key.getPublic('hex')],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const db = await orbitdb.keyvalue('first-database', access)
|
const db = await orbitdb.keyvalue('first-database', access)
|
||||||
console.log(db.address.toString())
|
console.log(db.address.toString())
|
||||||
@ -192,11 +194,17 @@ const ipfs = new IPFS()
|
|||||||
ipfs.on('ready', async () => {
|
ipfs.on('ready', async () => {
|
||||||
const orbitdb = new OrbitDB(ipfs)
|
const orbitdb = new OrbitDB(ipfs)
|
||||||
|
|
||||||
const access = {
|
const options = {
|
||||||
// Setup write access
|
accessController: {
|
||||||
write: [
|
write: [
|
||||||
// Give access to ourselves
|
// Give write access to ourselves
|
||||||
orbitdb.key.getPublic('hex'),
|
orbitdb.key.getPublic('hex'),
|
||||||
|
// Give access to the second peer
|
||||||
|
'042c07044e7ea51a489c02854db5e09f0191690dc59db0afd95328c9db614a2976e088cab7c86d7e48183191258fc59dc699653508ce25bf0369d67f33d5d77839',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Give access to the second peer
|
// Give access to the second peer
|
||||||
'042c07044e7ea51a489c02854db5e09f0191690dc59db0afd95328c9db614a2976e088cab7c86d7e48183191258fc59dc699653508ce25bf0369d67f33d5d77839',
|
'042c07044e7ea51a489c02854db5e09f0191690dc59db0afd95328c9db614a2976e088cab7c86d7e48183191258fc59dc699653508ce25bf0369d67f33d5d77839',
|
||||||
],
|
],
|
||||||
@ -221,10 +229,12 @@ const ipfs = new IPFS()
|
|||||||
ipfs.on('ready', async () => {
|
ipfs.on('ready', async () => {
|
||||||
const orbitdb = new OrbitDB(ipfs)
|
const orbitdb = new OrbitDB(ipfs)
|
||||||
|
|
||||||
const access = {
|
const options = {
|
||||||
// Give write access to everyone
|
accessController: {
|
||||||
write: ['*'],
|
// Give write access to ourselves
|
||||||
}
|
write: ['*'],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const db = await orbitdb.keyvalue('first-database', access)
|
const db = await orbitdb.keyvalue('first-database', access)
|
||||||
console.log(db.address.toString())
|
console.log(db.address.toString())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user