From 298a0f25b08599b9911b3ed4280316a369abfddb Mon Sep 17 00:00:00 2001 From: haad Date: Tue, 4 Oct 2016 14:11:24 +0200 Subject: [PATCH] Remove obsolete code --- src/cli/index.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/cli/index.js diff --git a/src/cli/index.js b/src/cli/index.js deleted file mode 100644 index 05cb8be..0000000 --- a/src/cli/index.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -const IpfsApi = require('ipfs-api') -const OrbitDB = require('../../src/OrbitDB') - -// Usage: node index - -const username = process.argv[2] || 'testrunner' -const dbname = process.argv[3] || 'testdb' -// const data = process.argv[4] || 'hello world ' + new Date().getTime() - -console.log(">", username, dbname) - -const ipfs = IpfsApi('localhost', '5002') -const id = username -const client = new OrbitDB(ipfs, id) -const db = client.eventlog(dbname) - -setInterval(() => { - const data = { - value: "Hello at " + new Date().getTime(), - from: username - } - - db.add(data).then((hash) => { - const result = db.iterator({ limit: 5 }) - .collect() - .map((e) => { - return e.payload.value - }) - - console.log("RESULT:") - result.forEach((e) => { - console.log(JSON.stringify(e)) - }) - console.log("") - }) -}, 1000)