diff --git a/lib/index.js b/lib/index.js index e3dbb75..2649a13 100644 --- a/lib/index.js +++ b/lib/index.js @@ -36,14 +36,13 @@ module.exports = { function createStream(remoteId, iamClient) { // prettier-ignore debug('Opening a stream with remote %s %s', iamClient ? 'server' : 'client', remoteId) - const stream = new SyncStream(peer.pubkey, debug, goals, algo) + const stream = new SyncStream(peer.shse.pubkey, debug, goals, algo) streams.push(stream) return stream } peer.on('rpc:connect', function onSyncRPCConnect(rpc, iamClient) { - // TODO: eliminate SSB base64 `.id`, use SHSE `.pubkey` instead - if (rpc.id === peer.pubkey) return // local client connecting to local server + if (rpc.shse.pubkey === peer.shse.pubkey) return // local client connecting to local server if (!iamClient) return const local = toPull.duplex(createStream(rpc.id, true)) @@ -51,7 +50,7 @@ module.exports = { const remote = rpc.tangleSync.connect((networkError) => { if (networkError && getSeverity(networkError) >= 3) { if (isMuxrpcMissingError(networkError, 'tangleSync', 'connect')) { - debug('peer %s does not support tangleSync', rpc.id) + debug('peer %s does not support tangleSync', rpc.shse.pubkey) // } else if (isReconnectedError(networkError)) { // TODO: bring back // Do nothing, this is a harmless error } else { diff --git a/package.json b/package.json index d423295..4c3c119 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "prettier": "^2.6.2", "pretty-quick": "^3.1.3", "rimraf": "^4.4.0", - "secret-stack": "^6.4.1", - "secret-handshake-ext": "^0.0.7", + "secret-stack": "ssbc/secret-stack#bare-mode", + "secret-handshake-ext": "^0.0.8", "ssb-box": "^1.0.1" }, "scripts": { diff --git a/test/util.js b/test/util.js index 27fb975..0d8e070 100644 --- a/test/util.js +++ b/test/util.js @@ -14,9 +14,8 @@ function createPeer(opts) { if (!opts.keypair) throw new Error('need opts.keypair in createPeer()') rimraf.sync(opts.path) - return require('secret-stack/lib/api')([], {}) - .use(require('secret-stack/lib/core')) - .use(require('secret-stack/lib/plugins/net')) + return require('secret-stack/bare')() + .use(require('secret-stack/plugins/net')) .use(require('secret-handshake-ext/secret-stack')) .use(require('ppppp-db')) .use(require('ssb-box'))