git ssb

1+

cheerbitch / dexbot



Commit 4fe728780fc41a67f0e103a0221e05b4b9c93423

show n tell

Tree committed on 2/25/2017, 3:31:39 AM
Parent: 8a53f5f8b2c617b3a7f8c929aa7018f8f9a73c0b

Files changed

core/index.jschanged
readme.mdchanged
core/index.jsView
@@ -13,9 +13,9 @@
1313 var muxrpc = require('muxrpc')
1414 var emStream = require('emit-stream')
1515 var emitter = require('events').EventEmitter
1616
17-var hlkv = require('hyperkv')
17 +var hkv = require('hyperkv')
1818 var hldex = require('hyperlog-index')
1919
2020
2121 var $ = module.exports = {}
@@ -70,13 +70,15 @@
7070 var node = dex
7171 var rpc = {replicate: {}, log: {}}
7272 var logs = bot.logs
7373 var peers = {}
74- var kv = hyperkv({
74 + var kv = hkv({
7575 db: bot.db,
7676 log: hyperlog(bot.db.sublevel('kvi:' + dex.id))
7777 })
78-
78 + kv.get(dex.id + ':logs', function(err, data){
79 +
80 + })
7981 $.permissions.replicate.forEach(function(e){
8082 rpc.replicate[e] = function(opts){
8183 opts = opts || {}
8284 var id = opts.id
@@ -144,10 +146,11 @@
144146 },
145147 'connect': function(peer, cb){
146148 node.connect(peer.host, function(err, rpc){
147149 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]}
149151 if(cb) cb(null, rpc)
152 +
150153 // give peer yr rpc
151154 /*
152155 var server = muxrpc({}, dex.getManifest())(dex)
153156 var rc = rpc.dexbot.rc(bot.keys.id)
readme.mdView
@@ -1,0 +1,1 @@
1 +# bot in progess

Built with git-ssb-web