var osmdb = require('osm-p2p-db')
var memdb = require('memdb')
var hyperlog = require('hyperlog')
var memstore = require('memory-chunk-store')

var slowdb = require('./slowdb.js')

var DELAY = process.env.OSM_P2P_DB_DELAY

function testDb (cb) {
  return osmdb({
    db: DELAY ? slowdb({delay: DELAY}) : memdb(),
    log: hyperlog(memdb(), { valueEncoding: 'json' }),
    store: memstore(4096)
  })
}

module.exports = testDb

@@ -1,17 +1,16 @@
 var 
+k
 osm
-db
  = requi
@@ -17,30 +17,29 @@
 re('
-osm-p2p-db
+kappa-osm
 ')%0Avar 
-memdb
+kcore
  = r
@@ -50,93 +50,89 @@
 re('
-memdb')%0Avar hyperlog = require('hyperlog')%0Avar memstore = require('memory-chunk-store
+kappa-core')%0Avar memdb = require('memdb')%0Avar ram = require('random-access-memory
 ')%0A%0A
@@ -246,22 +246,24 @@
 urn 
+k
 osm
-db
 (%7B%0A    
-db
+index
 : DE
@@ -310,29 +310,23 @@
     
-log: hyperlog(memdb()
+core: kcore(ram
 , %7B 
@@ -363,25 +363,52 @@
 stor
+ag
 e: 
-memstore(4096)
+function (name, cb) %7B cb(null, ram()) %7D
 %0A  %7D

update test_db to use kappa-osm