git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 4a1f9a53b0854ec031013d473ac2f51e826d4dc5

created root

wanderer committed on 4/29/2017, 3:53:12 PM
Parent: 93764459c5a9d26427a8995f181e763cee8ace32

Files changed

index.jschanged
index.jsView
@@ -1,17 +1,24 @@
11 const Graph = require('ipld-graph-builder')
22 const multibase = require('multibase')
33 const Kernel = require('./kernel.js')
44
5+class Root {
6+ queue () {
7+ console.log('root queued!')
8+ }
9+}
10+
511 module.exports = class Hypervisor {
612 constructor (opts) {
713 this._opts = {
814 VMs: {}
915 }
1016
1117 this.graph = new Graph(opts.dag)
1218 delete opts.dag
13- this._vmInstances = new Map()
19+ this.root = new Root()
20+ this._vmInstances = new Map([[null, new Root()]])
1421 Object.assign(this._opts, opts)
1522 }
1623
1724 async getInstance (port) {
@@ -72,8 +79,13 @@
7279 return this.graph.flush(port)
7380 }
7481
7582 async generateID (port) {
83+ // root id
84+ if (!port) {
85+ return null
86+ }
87+
7688 let id = await this.graph.flush(port.id)
7789 id = id['/']
7890 if (Buffer.isBuffer(id)) {
7991 id = multibase.encode('base58btc', id).toString()

Built with git-ssb-web