diff --git a/.gitignore b/.gitignore index 3229a7aa..f274a208 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ test/keystore/ test-keys/ test/browser/bundle.js test/browser/bundle.js.map -benchmarks/ipfs-log-benchmarks +ipfs-log-benchmarks/ examples/browser/bundle.js.map examples/browser/ipfs.min.js examples/browser/ipfslog.min.js diff --git a/benchmarks/benchmark-append.js b/benchmarks/benchmark-append.js index 8883d9e4..d4cbd64c 100644 --- a/benchmarks/benchmark-append.js +++ b/benchmarks/benchmark-append.js @@ -7,9 +7,6 @@ const Log = require('../src/log') const IdentityProvider = require('orbit-db-identity-provider') const Keystore = require('orbit-db-keystore') -const leveldown = require('leveldown') -const storage = require('orbit-db-storage-adapter')(leveldown) - // State let ipfs let log @@ -56,9 +53,7 @@ let run = (() => { // const memstore = new MemStore() // ipfs.dag.put = memstore.put.bind(memstore) // ipfs.dag.get = memstore.get.bind(memstore) - const signingKeysPath = './benchmarks/ipfs-log-benchmarks/keys1' - const store = await storage.createStore(signingKeysPath) - const keystore = new Keystore(store) + const keystore = new Keystore('./ipfs-log-benchmarks/keys/') const identities = new IdentityProvider({ keystore }) const identity = await identities.createIdentity({ id: 'userA' }) diff --git a/benchmarks/benchmark-from-entry-hash.js b/benchmarks/benchmark-from-entry-hash.js index f9703e54..79f82a27 100644 --- a/benchmarks/benchmark-from-entry-hash.js +++ b/benchmarks/benchmark-from-entry-hash.js @@ -7,8 +7,6 @@ const Log = require('../src/log') const IdentityProvider = require('orbit-db-identity-provider') const Keystore = require('orbit-db-keystore') -const leveldown = require('leveldown') -const storage = require('orbit-db-storage-adapter')(leveldown) // State let ipfs let log @@ -30,7 +28,7 @@ let run = (() => { } ipfs = new IPFS({ - repo: new IPFSRepo('./ipfs-log-benchmarks/fromEntryHash/ipfs', repoConf), + repo: new IPFSRepo('./ipfs-log-benchmarks/ipfs', repoConf), start: false, EXPERIMENTAL: { pubsub: false, @@ -45,9 +43,7 @@ let run = (() => { ipfs.on('ready', async () => { // Create a log - const signingKeysPath = './benchmarks/ipfs-log-benchmarks/keys1' - const store = await storage.createStore(signingKeysPath) - const keystore = new Keystore(store) + const keystore = new Keystore('./ipfs-log-benchmarks/keys/') const identities = new IdentityProvider({ keystore }) const identity = await identities.createIdentity({ id: 'userA' }) diff --git a/benchmarks/benchmark-join.js b/benchmarks/benchmark-join.js index 51012958..4d5e4fd1 100644 --- a/benchmarks/benchmark-join.js +++ b/benchmarks/benchmark-join.js @@ -7,9 +7,6 @@ const Log = require('../src/log') const IdentityProvider = require('orbit-db-identity-provider') const Keystore = require('orbit-db-keystore') -const leveldown = require('leveldown') -const storage = require('orbit-db-storage-adapter')(leveldown) - // State let ipfs let log1, log2 @@ -66,20 +63,11 @@ let run = (() => { // const memstore = new MemStore() // ipfs.dag.put = memstore.put.bind(memstore) // ipfs.dag.get = memstore.get.bind(memstore) + const keystore = new Keystore('./ipfs-log-benchmarks/keys/') - const signingKeysPath1 = './benchmarks/ipfs-log-benchmarks/keys1' - const signingKeysPath2 = './benchmarks/ipfs-log-benchmarks/keys2' - // const identity = await IdentityProvider.createIdentity({ id: 'userA', signingKeysPath1 }) - // const identity2 = await IdentityProvider.createIdentity({ id: 'userB', signingKeysPath2 }) - - const store1 = await storage.createStore(signingKeysPath1) - const store2 = await storage.createStore(signingKeysPath2) - const keystore1 = new Keystore(store1) - const keystore2 = new Keystore(store2) - - const identities = new IdentityProvider({ keystore: keystore1 }) + const identities = new IdentityProvider({ keystore }) const identity = await identities.createIdentity({ id: 'userA' }) - const identity2 = await identities.createIdentity({ id: 'userB', keystore: keystore2 }) + const identity2 = await identities.createIdentity({ id: 'userB' }) log1 = new Log(ipfs, identity, identities, { logId: 'A' }) log2 = new Log(ipfs, identity2, identities, { logId: 'A' }) diff --git a/benchmarks/benchmark-join2.js b/benchmarks/benchmark-join2.js index d77c1b53..d3650fa3 100644 --- a/benchmarks/benchmark-join2.js +++ b/benchmarks/benchmark-join2.js @@ -7,9 +7,6 @@ const Log = require('../src/log') const IdentityProvider = require('orbit-db-identity-provider') const Keystore = require('orbit-db-keystore') -const leveldown = require('leveldown') -const storage = require('orbit-db-storage-adapter')(leveldown) - // State let ipfs let log1, log2 @@ -60,10 +57,7 @@ let run = (() => { // const memstore = new MemStore() // ipfs.dag.put = memstore.put.bind(memstore) // ipfs.dag.get = memstore.get.bind(memstore) - - const signingKeysPath = './benchmarks/ipfs-log-benchmarks/keys1' - const store = await storage.createStore(signingKeysPath) - const keystore = new Keystore(store) + const keystore = new Keystore('./benchmarks/ipfs-log-benchmarks/keys') const identities = new IdentityProvider({ keystore }) const identity = await identities.createIdentity({ id: 'userA' }) const identity2 = await identities.createIdentity({ id: 'userB' })