Browse Source

advancing SNH-Multiverse

psy 2 năm trước cách đây
mục cha
commit
651992b420
7 tập tin đã thay đổi với 4781 bổ sung699 xóa
  1. 4513 636
      package-lock.json
  2. 37 5
      package.json
  3. 157 35
      src/server.js
  4. 10 0
      src/ssb/cli-cmd-aliases.js
  5. 19 22
      src/ssb/flotilla.js
  6. 0 1
      src/ssb/index.js
  7. 45 0
      src/ssb/progress.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4513 - 636
package-lock.json


+ 37 - 5
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@krakenslab/oasis",
-  "version": "0.2.1",
+  "version": "0.2.2",
   "description": "SNH-Oasis Project Network GUI",
   "repository": {
     "type": "git",
@@ -17,7 +17,7 @@
     "fix": "common-good fix",
     "prestart": "",
     "start": "npm run start-server && npm run start-client",
-    "start-server": "node src/server.js &",
+    "start-server": "node src/server.js start &",
     "start-client": "node src/index.js",
     "test": "tap --timeout 240 && common-good test",
     "preversion": "npm test",
@@ -39,21 +39,36 @@
     "lodash": "^4.17.11",
     "lodash.shuffle": "^4.2.0",
     "markdown-it": "^12.0.2",
-    "muxrpc-validation": "^3",
-    "muxrpcli": "^3.1",
+    "broadcast-stream": "^0.2.1",
+    "has-network": "0.0.1",
+    "ip": "^1.1.5",
+    "mdmanifest": "^1.0.8",
+    "minimist": "^1.1.3",
+    "mkdirp": "^1.0.4",
+    "multiblob": "^1.13.0",
+    "multiserver": "^3.3.1",
+    "multiserver-address": "^1.0.1",
+    "muxrpc-validation": "^3.0.2",
+    "muxrpcli": "^3.1.2",
+    "muxrpc": "^6.7.3",
     "open": "^8.0.1",
     "piexifjs": "^1.0.4",
     "pretty-ms": "^7.0.1",
+    "pull-cat": "~1.1.5",
+    "pull-file": "^1.0.0",
+    "pull-many": "~1.0.6",
+    "pull-pushable": "^2.2.0",
     "pull-abortable": "^4.1.1",
     "pull-paramap": "^1.2.2",
     "pull-sort": "^1.0.2",
     "pull-stream": "^3.6.12",
     "request": "^2.88.1",
     "require-style": "^1.1.0",
-    "secret-stack": "^6.3.1",
+    "secret-stack": "^6.4.1",
     "ssb-about": "^2.0.1",
     "ssb-backlinks": "^2.1.1",
     "ssb-blobs": "^2.0.1",
+    "ssb-caps": "^1.0.1",
     "ssb-client": "^4.9.0",
     "ssb-config": "^3.4.4",
     "ssb-conn": "^6.0.3",
@@ -79,6 +94,7 @@
     "ssb-query": "^2.4.5",
     "ssb-ref": "^2.16.0",
     "ssb-replicate": "^1.3.0",
+    "ssb-tribes": "^3.1.1",
     "ssb-room": "^1.3.0",
     "ssb-search": "^1.3.0",
     "ssb-server": "^15.3.0",
@@ -88,6 +104,22 @@
     "ssb-ws": "^6.2.3",
     "ssb-gossip": "^1.1.1",
     "ssb-tunnel": "^2.0.0",
+    "ssb-legacy-conn": "^2.0.0",
+    "ssb-db2": "^6.1.1",
+    "ssb-box": "^1.0.1",
+    "ssb-threads": "^10.0.4",
+    "ssb-conn-db": "^1.0.5",
+    "ssb-search2": "^2.1.3",
+    "ssb-friend-pub": "^1.0.7",
+    "ssb-invite-client": "^1.3.3",
+    "ssb-conn-query": "^1.2.2",
+    "ssb-conn-hub": "^1.2.0",
+    "ssb-conn-staging": "^1.0.0",
+    "ssb-peer-invites": "^2.1.0",
+    "ssb-device-address": "^1.1.6",
+    "scuttle-poll": "^1.5.1",
+    "ssb-replication-scheduler": "^2.0.5",
+    "ssb-partial-replication": "^3.0.1",
     "yargs": "^17.0.0"
   },
   "devDependencies": {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 157 - 35
src/server.js


+ 10 - 0
src/ssb/cli-cmd-aliases.js

@@ -0,0 +1,10 @@
+module.exports = {
+  feed: 'createFeedStream',
+  history: 'createHistoryStream',
+  hist: 'createHistoryStream',
+  public: 'getPublicKey',
+  pub: 'getPublicKey',
+  log: 'createLogStream',
+  logt: 'messagesByType',
+  conf: 'config'
+}

+ 19 - 22
src/ssb/flotilla.js

@@ -1,5 +1,4 @@
 const stack = require("secret-stack");
-const shuffle = require("lodash.shuffle");
 const debug = require("debug")("oasis");
 const ssbConfig = require("ssb-config");
 
@@ -10,27 +9,25 @@ const plugins = [
   require("ssb-replicate"),
   require("ssb-backlinks"),
   require("ssb-conn"),
-  shuffle([
-    require("ssb-about"),
-    require("ssb-blobs"),
-    require("ssb-ebt"),
-    require("ssb-friends"),
-    require("ssb-invite"),
-    require("ssb-lan"),
-    require("ssb-logging"),
-    require("ssb-meme"),
-    require("ssb-no-auth"),
-    require("ssb-onion"),
-    require("ssb-ooo"),
-    require("ssb-plugins"),
-    require("ssb-private1"),
-    require("ssb-query"),
-    require("ssb-room/tunnel/client"),
-    require("ssb-search"),
-    require("ssb-tangle"),
-    require("ssb-unix-socket"),
-    require("ssb-ws"),
-  ]),
+  require("ssb-about"),
+  require("ssb-blobs"),
+  require("ssb-ebt"),
+  require("ssb-friends"),
+  require("ssb-invite"),
+  require("ssb-lan"),
+  require("ssb-logging"),
+  require("ssb-meme"),
+  require("ssb-no-auth"),
+  require("ssb-onion"),
+  require("ssb-ooo"),
+  require("ssb-plugins"),
+  require("ssb-private1"),
+  require("ssb-query"),
+  require("ssb-room/tunnel/client"),
+  require("ssb-search"),
+  require("ssb-tangle"),
+  require("ssb-unix-socket"),
+  require("ssb-ws"),
 ];
 
 module.exports = (config) => {

+ 0 - 1
src/ssb/index.js

@@ -46,7 +46,6 @@ const connect = (options) =>
     const onSuccess = (ssb) => {
       resolve(ssb);
     };
-
     ssbClient(process.env.OASIS_TEST ? ssbConfig.keys : null, options)
       .then(onSuccess)
       .catch(reject);

+ 45 - 0
src/ssb/progress.js

@@ -0,0 +1,45 @@
+module.exports = function (progress) {
+  function bar (r) {
+    var s = '\r', M = 50
+    for(var i = 0; i < M; i++)
+      s += i < M*r ? '*' : '.'
+
+    return s
+  }
+
+  function round (n, p) {
+    return Math.round(n * p) / p
+  }
+
+  function percent (n) {
+    return (round(n, 1000)*100).toString().substring(0, 4)+'%'
+  }
+
+  function rate (prog) {
+    if(prog.target == prog.current) return 1
+    return (prog.current - prog.start) / (prog.target - prog.start)
+  }
+
+  var prog = -1
+  var int = setInterval(function () {
+    var p = progress()
+    var r = 1, c = 0
+    var tasks = []
+    for(var k in p) {
+      var _r = rate(p[k])
+      if(_r < 1)
+        tasks.push(k+':'+percent(_r))
+      r = Math.min(_r, r)
+      c++
+    }
+    if(r != prog) {
+      prog = r
+      var msg = tasks.join(', ')
+      process.stdout.write('\r'+bar(prog) + ' ('+msg+')\x1b[K\r')
+    }
+  }, 333)
+  int.unref && int.unref()
+}
+
+
+