Commit 4fe728780fc41a67f0e103a0221e05b4b9c93423
show n tell
Tree committed on 2/25/2017, 3:31:39 AMParent: 8a53f5f8b2c617b3a7f8c929aa7018f8f9a73c0b
Files changed
core/index.js | changed |
readme.md | changed |
core/index.js | |||
---|---|---|---|
@@ -13,9 +13,9 @@ | |||
13 | 13 … | var muxrpc = require('muxrpc') | |
14 | 14 … | var emStream = require('emit-stream') | |
15 | 15 … | var emitter = require('events').EventEmitter | |
16 | 16 … | ||
17 | -var hlkv = require('hyperkv') | ||
17 … | +var hkv = require('hyperkv') | ||
18 | 18 … | var hldex = require('hyperlog-index') | |
19 | 19 … | ||
20 | 20 … | ||
21 | 21 … | var $ = module.exports = {} | |
@@ -70,13 +70,15 @@ | |||
70 | 70 … | var node = dex | |
71 | 71 … | var rpc = {replicate: {}, log: {}} | |
72 | 72 … | var logs = bot.logs | |
73 | 73 … | var peers = {} | |
74 | - var kv = hyperkv({ | ||
74 … | + var kv = hkv({ | ||
75 | 75 … | db: bot.db, | |
76 | 76 … | log: hyperlog(bot.db.sublevel('kvi:' + dex.id)) | |
77 | 77 … | }) | |
78 | - | ||
78 … | + kv.get(dex.id + ':logs', function(err, data){ | ||
79 … | + | ||
80 … | + }) | ||
79 | 81 … | $.permissions.replicate.forEach(function(e){ | |
80 | 82 … | rpc.replicate[e] = function(opts){ | |
81 | 83 … | opts = opts || {} | |
82 | 84 … | var id = opts.id | |
@@ -144,10 +146,11 @@ | |||
144 | 146 … | }, | |
145 | 147 … | 'connect': function(peer, cb){ | |
146 | 148 … | node.connect(peer.host, function(err, rpc){ | |
147 | 149 … | if(err) console.log(err) // publish errloggify this callback if the method sticks | |
148 | - peers[rpc.id] = rpc | ||
150 … | + peers[rpc.id] = {rpc: rpc, id: rpc.id, known_hosts: [peer.address]} | ||
149 | 151 … | if(cb) cb(null, rpc) | |
152 … | + | ||
150 | 153 … | // give peer yr rpc | |
151 | 154 … | /* | |
152 | 155 … | var server = muxrpc({}, dex.getManifest())(dex) | |
153 | 156 … | var rc = rpc.dexbot.rc(bot.keys.id) |
Built with git-ssb-web