mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-05-19 13:26:37 +00:00
Fix benchmark-kv example
This commit is contained in:
parent
79ca785bb7
commit
6746d88bb7
@ -9,13 +9,10 @@ const Timer = require('./Timer');
|
|||||||
// usage: benchmark.js <host> <username> <channel>;
|
// usage: benchmark.js <host> <username> <channel>;
|
||||||
|
|
||||||
// orbit-server
|
// orbit-server
|
||||||
const host = process.argv[2] ? process.argv[2] : 'localhost'
|
const network = 'QmYPobvobKsyoCKTw476yTui611XABf927KxUPCf4gRLRr'; // 'localhost:3333'
|
||||||
const port = 3333;
|
const username = process.argv[2] ? process.argv[2] : 'testrunner';
|
||||||
|
|
||||||
const username = process.argv[3] ? process.argv[3] : 'testrunner';
|
|
||||||
const password = '';
|
const password = '';
|
||||||
|
const channelName = process.argv[3] ? process.argv[3] : 'c1';
|
||||||
const channelName = process.argv[4] ? process.argv[4] : 'c1';
|
|
||||||
|
|
||||||
const startIpfs = () => {
|
const startIpfs = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -30,7 +27,7 @@ let run = (async(() => {
|
|||||||
try {
|
try {
|
||||||
// Connect
|
// Connect
|
||||||
const ipfs = await(startIpfs());
|
const ipfs = await(startIpfs());
|
||||||
const orbit = await(OrbitDB.connect(host, port, username, password, ipfs));
|
const orbit = await(OrbitDB.connect(network, username, password, ipfs));
|
||||||
const db = await(orbit.kvstore(channelName));
|
const db = await(orbit.kvstore(channelName));
|
||||||
|
|
||||||
// Metrics
|
// Metrics
|
||||||
|
Loading…
x
Reference in New Issue
Block a user