Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Hello, WebVR! - A-Frame</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script type="text/javascript" src="lib/aframe.min.js" charset="utf-8"></script>
<script type="text/javascript" src="lib/orbitdb.min.js" charset="utf-8"></script>
<script type="text/javascript" src="lib/ipfs-browser-daemon.min.js" charset="utf-8"></script>
</head>
<body>
'use strict'
const path = require('path')
const AccessController = require('./access-controller')
class OrbitDBAccessController extends AccessController {
constructor (orbitdb) {
super()
this._orbitdb = orbitdb
this._db = null
/* Sketch of how muport identities could be used in OrbitDB */
const identitySignerFn = async (id, data) => {
// One can check here too that identity-to-be-signed is actually
// the same muport identity
if (id !== muport.getDid()) throw new Error("Trying to sign with a different identity!")
return await muport.sign(data)
}
const identityVerifierFn = async (identity) => {