From 05a6669f7575eea3d8f0303dc3b734c93ec1435d Mon Sep 17 00:00:00 2001 From: mixmix Date: Tue, 11 Oct 2022 20:44:00 +1300 Subject: [PATCH 1/5] configure to run without scheduler, fix pub addresses --- package-lock.json | 39 ++++++++------------------------------- package.json | 1 + src/ssb-server.js | 18 ++++++++++++++---- src/ssb-sync.js | 13 ++++++++++++- 4 files changed, 35 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d7bcb8..86893f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "pull-paramap": "^1.2.2", "pull-stream": "^3.6.14", "run-waterfall": "^1.1.7", + "secret-stack": "^6.4.1", "ssb-about-self": "^1.1.0", "ssb-blobs": "^2.0.1", "ssb-caps": "^1.1.0", @@ -4727,8 +4728,7 @@ "node_modules/map-merge": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/map-merge/-/map-merge-1.1.0.tgz", - "integrity": "sha512-TGNNg3WqoLsS5HnlK6GHIXFvM/0wYMtlyflc1nAQUhgptr9wIu7JwQ2YsqnpFSqbSYFv2U6rgXQTHJmWJOtlzQ==", - "peer": true + "integrity": "sha512-TGNNg3WqoLsS5HnlK6GHIXFvM/0wYMtlyflc1nAQUhgptr9wIu7JwQ2YsqnpFSqbSYFv2U6rgXQTHJmWJOtlzQ==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -4953,7 +4953,6 @@ "version": "6.7.3", "resolved": "https://registry.npmjs.org/muxrpc/-/muxrpc-6.7.3.tgz", "integrity": "sha512-yVr66BigJxHIvHOLsdJzuvrHt46Vq9DiDCBTZiS6q+49mXh4mkDjRiXo9FnGXQv1WJOqnRJk5fcfwV6TaSgNvA==", - "peer": true, "dependencies": { "clarify-error": "^1.0.0", "debug": "^4.3.3", @@ -5362,7 +5361,6 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/packet-stream/-/packet-stream-2.0.6.tgz", "integrity": "sha512-kSxHpoTqlgNEetMp77snCTVILwLw4dJX6pB/z1g1PRG5xylH8cf9upIPygt+epBC3l14XrcZH4/kQYSrzp2Ijg==", - "peer": true, "engines": { "node": ">=8" } @@ -5371,7 +5369,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/packet-stream-codec/-/packet-stream-codec-1.2.0.tgz", "integrity": "sha512-3xoTsSVqCPd+0mPsQGlfYm2ecvJK9tS1HOxrjnKEiB1Ynq0fOJHEXcZV/hxW6BkOSGBsGX7dTN8bjdNTU3nKBA==", - "peer": true, "dependencies": { "pull-reader": "^1.3.1", "pull-through": "^1.0.18" @@ -5654,8 +5651,7 @@ "node_modules/pull-abortable": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/pull-abortable/-/pull-abortable-4.1.1.tgz", - "integrity": "sha512-/zz8tW+T5tvtDc4NQVZTp3lJZoGEpUb2VDV3R5Q2/9lavNTwHK+hC5yF/3Q3LMmdn5AluFy23RFoqXIoySPl1w==", - "peer": true + "integrity": "sha512-/zz8tW+T5tvtDc4NQVZTp3lJZoGEpUb2VDV3R5Q2/9lavNTwHK+hC5yF/3Q3LMmdn5AluFy23RFoqXIoySPl1w==" }, "node_modules/pull-async": { "version": "1.0.0", @@ -5770,7 +5766,6 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/pull-goodbye/-/pull-goodbye-0.0.3.tgz", "integrity": "sha512-fl3RcIHKsxFaygdU3dcwSznLr73HYGOEU9IshpiatYSV+PW3TOUEjtfdu1L8uIsUoDajJz3HM/+mG0mFD4+v5A==", - "peer": true, "dependencies": { "pull-stream": "^3.6.14" } @@ -5790,7 +5785,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/pull-inactivity/-/pull-inactivity-2.1.4.tgz", "integrity": "sha512-W2Q+6Jk0oRMICYXBXom3/ipz2U5YPUSQUfLvVgUqL/daHop7QQB3Jz5XpnnxsekCPoM61lGvXc7kFDZt0uWzMg==", - "peer": true, "dependencies": { "pull-abortable": "^4.1.1", "pull-stream": "^3.4.5" @@ -5880,7 +5874,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/pull-rate/-/pull-rate-1.0.2.tgz", "integrity": "sha512-HH4fXHM7gu2uCO6u2SqTuGGDqPZNVHKXjTdyP9igg8jAROnvSph9plMAQqmv4elYFCm+Bfah2ASGWWe/+NdzMQ==", - "peer": true, "dependencies": { "pull-stream": "^3.6.0" } @@ -6409,7 +6402,6 @@ "version": "6.4.1", "resolved": "https://registry.npmjs.org/secret-stack/-/secret-stack-6.4.1.tgz", "integrity": "sha512-7rRcTEj7t0H3ShMKQvv7QGYAUFjVRmDqNNgrvpdedVlVnEIyfkZu0RaFPpes6yUSiE9Iwi0lHi03+6HsltLCMA==", - "peer": true, "dependencies": { "debug": "^4.1.0", "hoox": "0.0.1", @@ -7804,7 +7796,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-camel-case/-/to-camel-case-1.0.0.tgz", "integrity": "sha512-nD8pQi5H34kyu1QDMFjzEIYqk0xa9Alt6ZfrdEMuHCFOfTLhDG5pgTu/aAM9Wt9lXILwlXmWP43b8sav0GNE8Q==", - "peer": true, "dependencies": { "to-space-case": "^1.0.0" } @@ -7812,8 +7803,7 @@ "node_modules/to-no-case": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", - "integrity": "sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==", - "peer": true + "integrity": "sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==" }, "node_modules/to-regex-range": { "version": "5.0.1", @@ -7831,7 +7821,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", "integrity": "sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA==", - "peer": true, "dependencies": { "to-no-case": "^1.0.0" } @@ -11986,8 +11975,7 @@ "map-merge": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/map-merge/-/map-merge-1.1.0.tgz", - "integrity": "sha512-TGNNg3WqoLsS5HnlK6GHIXFvM/0wYMtlyflc1nAQUhgptr9wIu7JwQ2YsqnpFSqbSYFv2U6rgXQTHJmWJOtlzQ==", - "peer": true + "integrity": "sha512-TGNNg3WqoLsS5HnlK6GHIXFvM/0wYMtlyflc1nAQUhgptr9wIu7JwQ2YsqnpFSqbSYFv2U6rgXQTHJmWJOtlzQ==" }, "media-typer": { "version": "0.3.0", @@ -12167,7 +12155,6 @@ "version": "6.7.3", "resolved": "https://registry.npmjs.org/muxrpc/-/muxrpc-6.7.3.tgz", "integrity": "sha512-yVr66BigJxHIvHOLsdJzuvrHt46Vq9DiDCBTZiS6q+49mXh4mkDjRiXo9FnGXQv1WJOqnRJk5fcfwV6TaSgNvA==", - "peer": true, "requires": { "clarify-error": "^1.0.0", "debug": "^4.3.3", @@ -12466,14 +12453,12 @@ "packet-stream": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/packet-stream/-/packet-stream-2.0.6.tgz", - "integrity": "sha512-kSxHpoTqlgNEetMp77snCTVILwLw4dJX6pB/z1g1PRG5xylH8cf9upIPygt+epBC3l14XrcZH4/kQYSrzp2Ijg==", - "peer": true + "integrity": "sha512-kSxHpoTqlgNEetMp77snCTVILwLw4dJX6pB/z1g1PRG5xylH8cf9upIPygt+epBC3l14XrcZH4/kQYSrzp2Ijg==" }, "packet-stream-codec": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/packet-stream-codec/-/packet-stream-codec-1.2.0.tgz", "integrity": "sha512-3xoTsSVqCPd+0mPsQGlfYm2ecvJK9tS1HOxrjnKEiB1Ynq0fOJHEXcZV/hxW6BkOSGBsGX7dTN8bjdNTU3nKBA==", - "peer": true, "requires": { "pull-reader": "^1.3.1", "pull-through": "^1.0.18" @@ -12685,8 +12670,7 @@ "pull-abortable": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/pull-abortable/-/pull-abortable-4.1.1.tgz", - "integrity": "sha512-/zz8tW+T5tvtDc4NQVZTp3lJZoGEpUb2VDV3R5Q2/9lavNTwHK+hC5yF/3Q3LMmdn5AluFy23RFoqXIoySPl1w==", - "peer": true + "integrity": "sha512-/zz8tW+T5tvtDc4NQVZTp3lJZoGEpUb2VDV3R5Q2/9lavNTwHK+hC5yF/3Q3LMmdn5AluFy23RFoqXIoySPl1w==" }, "pull-async": { "version": "1.0.0", @@ -12800,7 +12784,6 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/pull-goodbye/-/pull-goodbye-0.0.3.tgz", "integrity": "sha512-fl3RcIHKsxFaygdU3dcwSznLr73HYGOEU9IshpiatYSV+PW3TOUEjtfdu1L8uIsUoDajJz3HM/+mG0mFD4+v5A==", - "peer": true, "requires": { "pull-stream": "^3.6.14" } @@ -12820,7 +12803,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/pull-inactivity/-/pull-inactivity-2.1.4.tgz", "integrity": "sha512-W2Q+6Jk0oRMICYXBXom3/ipz2U5YPUSQUfLvVgUqL/daHop7QQB3Jz5XpnnxsekCPoM61lGvXc7kFDZt0uWzMg==", - "peer": true, "requires": { "pull-abortable": "^4.1.1", "pull-stream": "^3.4.5" @@ -12910,7 +12892,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/pull-rate/-/pull-rate-1.0.2.tgz", "integrity": "sha512-HH4fXHM7gu2uCO6u2SqTuGGDqPZNVHKXjTdyP9igg8jAROnvSph9plMAQqmv4elYFCm+Bfah2ASGWWe/+NdzMQ==", - "peer": true, "requires": { "pull-stream": "^3.6.0" } @@ -13321,7 +13302,6 @@ "version": "6.4.1", "resolved": "https://registry.npmjs.org/secret-stack/-/secret-stack-6.4.1.tgz", "integrity": "sha512-7rRcTEj7t0H3ShMKQvv7QGYAUFjVRmDqNNgrvpdedVlVnEIyfkZu0RaFPpes6yUSiE9Iwi0lHi03+6HsltLCMA==", - "peer": true, "requires": { "debug": "^4.1.0", "hoox": "0.0.1", @@ -14532,7 +14512,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-camel-case/-/to-camel-case-1.0.0.tgz", "integrity": "sha512-nD8pQi5H34kyu1QDMFjzEIYqk0xa9Alt6ZfrdEMuHCFOfTLhDG5pgTu/aAM9Wt9lXILwlXmWP43b8sav0GNE8Q==", - "peer": true, "requires": { "to-space-case": "^1.0.0" } @@ -14540,8 +14519,7 @@ "to-no-case": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", - "integrity": "sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==", - "peer": true + "integrity": "sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==" }, "to-regex-range": { "version": "5.0.1", @@ -14556,7 +14534,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", "integrity": "sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA==", - "peer": true, "requires": { "to-no-case": "^1.0.0" } diff --git a/package.json b/package.json index caad1aa..6db8196 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "pull-paramap": "^1.2.2", "pull-stream": "^3.6.14", "run-waterfall": "^1.1.7", + "secret-stack": "^6.4.1", "ssb-about-self": "^1.1.0", "ssb-blobs": "^2.0.1", "ssb-caps": "^1.1.0", diff --git a/src/ssb-server.js b/src/ssb-server.js index fa4cb2b..84e7252 100644 --- a/src/ssb-server.js +++ b/src/ssb-server.js @@ -11,7 +11,6 @@ const DB_PATH = join(__dirname, '../db') module.exports = function SSB (opts = {}) { const stack = SecretStack({ caps }) .use([ - require('ssb-db2/core'), require('ssb-db2/compat/publish'), require('ssb-classic'), @@ -20,7 +19,6 @@ module.exports = function SSB (opts = {}) { require('ssb-db2/compat/ebt'), // require('ssb-db2/compat/post'), require('ssb-db2/compat/db') - // require('ssb-db2/migrate'), ]) .use(require('ssb-about-self')) @@ -28,8 +26,20 @@ module.exports = function SSB (opts = {}) { .use(require('ssb-friends')) .use(require('ssb-lan')) - .use(require('ssb-conn')) .use(require('ssb-ebt')) + // .use(require('ssb-conn')) + .use(require('ssb-conn/core')) + .use(require('ssb-conn/compat')) // for ssb.gossip + // use a minimal ssb-conn, exlcuding the scheduler, + // which would otherwise prune connections down to 3 + + // Staltz recommends writing own scheduler, see README for template + // simple idea could be: + // 1. bootstrap with hosts above + // 2. live query to discover 'pub' messages with hosts + // 3. cycle through a series of different connections to discover more messages + // outstanding question: getStatus progress stuck? + .use(require('ssb-replication-scheduler')) .use(require('ssb-blobs')) .use(require('ssb-serve-blobs')) @@ -62,7 +72,7 @@ module.exports = function SSB (opts = {}) { [ (cb) => ssb.friends.isFollowing({ source: ssb.id, dest: id }, cb), (isFollowing, cb) => { - if (isFollowing) cb(null, null) + if (isFollowing) cb(null, true) else ssb.friends.follow(id, { state: true }, cb) }, (data, cb) => { diff --git a/src/ssb-sync.js b/src/ssb-sync.js index cf24fa2..e1b0082 100644 --- a/src/ssb-sync.js +++ b/src/ssb-sync.js @@ -1,10 +1,15 @@ const pull = require('pull-stream') const SSB = require('./ssb-server') -const ssb = SSB() +const ssb = SSB({ + ebt: { + // logging: true + } +}) pull( ssb.conn.peers(), + pull.map(updates => updates.map(update => [update[0], update[1].state])), pull.log() ) @@ -14,3 +19,9 @@ pull( pull.asyncMap((_, cb) => setTimeout(cb, 5000)), pull.drain() ) + +ssb.db.onMsgAdded(ev => { + if (ev.kvt.value.author === ssb.id) { + console.log(JSON.stringify(ev.kvt.value.content, null, 2)) + } +}) From c5089f3be50c5a190a45beb6b5c577775521190e Mon Sep 17 00:00:00 2001 From: mixmix Date: Tue, 25 Oct 2022 12:29:00 +1300 Subject: [PATCH 2/5] extract peers --- package-lock.json | 1 + package.json | 1 + src/ssb-server.js | 15 +++++---------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 86893f1..8b65c6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "dotenv": "^16.0.3", "express": "^4.18.1", "graphql": "^15.0.0", + "pull-flatmap": "^0.0.1", "pull-paramap": "^1.2.2", "pull-stream": "^3.6.14", "run-waterfall": "^1.1.7", diff --git a/package.json b/package.json index 6db8196..7f781ef 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "dotenv": "^16.0.3", "express": "^4.18.1", "graphql": "^15.0.0", + "pull-flatmap": "^0.0.1", "pull-paramap": "^1.2.2", "pull-stream": "^3.6.14", "run-waterfall": "^1.1.7", diff --git a/src/ssb-server.js b/src/ssb-server.js index 84e7252..b217455 100644 --- a/src/ssb-server.js +++ b/src/ssb-server.js @@ -4,6 +4,7 @@ const ssbKeys = require('ssb-keys') const { join } = require('path') const waterfall = require('run-waterfall') const pull = require('pull-stream') +const flatMap = require('pull-flatmap') const peers = require('./peers') const DB_PATH = join(__dirname, '../db') @@ -55,16 +56,10 @@ module.exports = function SSB (opts = {}) { ssb.lan.start() pull( ssb.conn.peers(), - pull.map(update => update.map(ev => [ev[1].key, ev[1].state])), + flatMap(evs => evs), + pull.map(ev => [ev[1].key, ev[1].state].join(' - ')), pull.log() ) - ssb.db.onMsgAdded(m => { - if (m.kvt.value.author !== ssb.id) return - console.log( - m.kvt.value.sequence, - JSON.stringify(m.kvt.value.content, null, 2) - ) - }) peers.forEach(({ name, id, host, invite }) => { if (id) { @@ -77,8 +72,8 @@ module.exports = function SSB (opts = {}) { }, (data, cb) => { if (invite) ssb.invite.use(invite, cb) - else cb(null, null) - }, + else cb(null, null) + }, (data, cb) => { if (host) ssb.conn.connect(host, cb) else cb(null) From 3f775d0f84c2d9986a25c092cd80db6388264d93 Mon Sep 17 00:00:00 2001 From: mixmix Date: Tue, 25 Oct 2022 12:51:44 +1300 Subject: [PATCH 3/5] prettier logging for connections --- src/ssb-server.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ssb-server.js b/src/ssb-server.js index b217455..e49dd18 100644 --- a/src/ssb-server.js +++ b/src/ssb-server.js @@ -57,8 +57,21 @@ module.exports = function SSB (opts = {}) { pull( ssb.conn.peers(), flatMap(evs => evs), - pull.map(ev => [ev[1].key, ev[1].state].join(' - ')), - pull.log() + pull.asyncMap((ev, cb) => { + const feedId = ev[1].key + ssb.aboutSelf.get(feedId, (err, details) => { + cb(null, { + state: ev[1].state, + name: err ? feedId : (details.name || feedId) + }) + }) + }), + pull.drain(({ state, name }) => { + const output = `${state.padStart(13, ' ')} - ${name}` + state === 'connected' + ? console.log(green(output)) + : console.log(output) + }) ) peers.forEach(({ name, id, host, invite }) => { @@ -111,3 +124,7 @@ module.exports = function SSB (opts = {}) { return ssb } + +function green (string) { + return '\x1b[32m' + string + '\x1b[0m' +} From ca9d323b7bb4ca9e6e5da3152639ac4ddd7e9909 Mon Sep 17 00:00:00 2001 From: mixmix Date: Tue, 25 Oct 2022 12:53:10 +1300 Subject: [PATCH 4/5] audit fix --- package-lock.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b65c6b..970abf9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -241,13 +241,13 @@ } }, "node_modules/@apollographql/graphql-upload-8-fork": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.3.tgz", - "integrity": "sha512-ssOPUT7euLqDXcdVv3Qs4LoL4BPtfermW1IOouaqEmj36TpHYDmYDIbKoSQxikd9vtMumFnP87OybH7sC9fJ6g==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.4.tgz", + "integrity": "sha512-lHAj/PUegYu02zza9Pg0bQQYH5I0ah1nyIzu2YIqOv41P0vu3GCBISAmQCfFHThK7N3dy7dLFPhoKcXlXRLPoQ==", "dev": true, "dependencies": { "@types/express": "*", - "@types/fs-capacitor": "*", + "@types/fs-capacitor": "^2.0.0", "@types/koa": "*", "busboy": "^0.3.1", "fs-capacitor": "^2.0.4", @@ -1258,14 +1258,14 @@ } }, "node_modules/apollo-server-integration-testing/node_modules/apollo-server-core": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.26.0.tgz", - "integrity": "sha512-z0dAZGu6zLhYLWVaRis6pR1dQbzPhA6xU5z0issR/sQR5kr466vFMF/rq//Jqwpd/A4xfTXZrFmr5urFyl4k4g==", + "version": "2.26.1", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.26.1.tgz", + "integrity": "sha512-YnO1YXhHOnCY7Q2SZ0uUtPq6SLCw+t2uI19l59mzWuCyZYdHrtSy3zUEU6pM3tR9vvUuRGkYIfMRlo/Q8a1U5g==", "dev": true, "dependencies": { "@apollographql/apollo-tools": "^0.5.0", "@apollographql/graphql-playground-html": "1.6.27", - "@apollographql/graphql-upload-8-fork": "^8.1.3", + "@apollographql/graphql-upload-8-fork": "^8.1.4", "@josephg/resolvable": "^1.0.0", "@types/ws": "^7.0.0", "apollo-cache-control": "^0.15.0", @@ -8436,13 +8436,13 @@ } }, "@apollographql/graphql-upload-8-fork": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.3.tgz", - "integrity": "sha512-ssOPUT7euLqDXcdVv3Qs4LoL4BPtfermW1IOouaqEmj36TpHYDmYDIbKoSQxikd9vtMumFnP87OybH7sC9fJ6g==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.4.tgz", + "integrity": "sha512-lHAj/PUegYu02zza9Pg0bQQYH5I0ah1nyIzu2YIqOv41P0vu3GCBISAmQCfFHThK7N3dy7dLFPhoKcXlXRLPoQ==", "dev": true, "requires": { "@types/express": "*", - "@types/fs-capacitor": "*", + "@types/fs-capacitor": "^2.0.0", "@types/koa": "*", "busboy": "^0.3.1", "fs-capacitor": "^2.0.4", @@ -9291,14 +9291,14 @@ } }, "apollo-server-core": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.26.0.tgz", - "integrity": "sha512-z0dAZGu6zLhYLWVaRis6pR1dQbzPhA6xU5z0issR/sQR5kr466vFMF/rq//Jqwpd/A4xfTXZrFmr5urFyl4k4g==", + "version": "2.26.1", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.26.1.tgz", + "integrity": "sha512-YnO1YXhHOnCY7Q2SZ0uUtPq6SLCw+t2uI19l59mzWuCyZYdHrtSy3zUEU6pM3tR9vvUuRGkYIfMRlo/Q8a1U5g==", "dev": true, "requires": { "@apollographql/apollo-tools": "^0.5.0", "@apollographql/graphql-playground-html": "1.6.27", - "@apollographql/graphql-upload-8-fork": "^8.1.3", + "@apollographql/graphql-upload-8-fork": "^8.1.4", "@josephg/resolvable": "^1.0.0", "@types/ws": "^7.0.0", "apollo-cache-control": "^0.15.0", From 205fece2c629358a660d5c77ae77eea9a3181fc1 Mon Sep 17 00:00:00 2001 From: mixmix Date: Tue, 25 Oct 2022 16:21:54 +1300 Subject: [PATCH 5/5] tidy --- src/ssb-server.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ssb-server.js b/src/ssb-server.js index e49dd18..8c79123 100644 --- a/src/ssb-server.js +++ b/src/ssb-server.js @@ -12,6 +12,7 @@ const DB_PATH = join(__dirname, '../db') module.exports = function SSB (opts = {}) { const stack = SecretStack({ caps }) .use([ + require('ssb-db2/core'), require('ssb-db2/compat/publish'), require('ssb-classic'), @@ -20,6 +21,7 @@ module.exports = function SSB (opts = {}) { require('ssb-db2/compat/ebt'), // require('ssb-db2/compat/post'), require('ssb-db2/compat/db') + // require('ssb-db2/migrate'), ]) .use(require('ssb-about-self')) @@ -40,7 +42,6 @@ module.exports = function SSB (opts = {}) { // 2. live query to discover 'pub' messages with hosts // 3. cycle through a series of different connections to discover more messages // outstanding question: getStatus progress stuck? - .use(require('ssb-replication-scheduler')) .use(require('ssb-blobs')) .use(require('ssb-serve-blobs')) @@ -56,6 +57,7 @@ module.exports = function SSB (opts = {}) { ssb.lan.start() pull( ssb.conn.peers(), + pull.through(() => console.log('>')), flatMap(evs => evs), pull.asyncMap((ev, cb) => { const feedId = ev[1].key @@ -80,7 +82,7 @@ module.exports = function SSB (opts = {}) { [ (cb) => ssb.friends.isFollowing({ source: ssb.id, dest: id }, cb), (isFollowing, cb) => { - if (isFollowing) cb(null, true) + if (isFollowing) cb(null, null) else ssb.friends.follow(id, { state: true }, cb) }, (data, cb) => {