mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-26 07:52:30 +00:00
ADd host param to reader example
This commit is contained in:
parent
5481334220
commit
7b68e2648a
@ -5,23 +5,24 @@ const await = require('asyncawait/await');
|
||||
const OrbitClient = require('../src/OrbitClient');
|
||||
const Timer = require('./Timer');
|
||||
|
||||
// usage: reader.js <host> <username> <channel> <text>
|
||||
|
||||
// orbit-server
|
||||
const host = 'localhost';
|
||||
const host = process.argv[2] ? process.argv[2] : 'localhost'
|
||||
const port = 3333;
|
||||
|
||||
const username = process.argv[3] ? process.argv[3] : 'LambOfGod';
|
||||
const password = '';
|
||||
|
||||
const prefix = process.argv[4] ? process.argv[4] : 'LambOfGod';
|
||||
const prefix = process.argv[5] ? process.argv[5] : 'Hello';
|
||||
|
||||
let run = (async(() => {
|
||||
try {
|
||||
var orbit = OrbitClient.connect(host, port, username, password);
|
||||
const c1 = process.argv[2] ? process.argv[2] : 'c1';
|
||||
const channel = orbit.channel(c1);
|
||||
const channelName = process.argv[4] ? process.argv[4] : 'test';
|
||||
const channel = orbit.channel(channelName);
|
||||
|
||||
let count = 1;
|
||||
let id = 'Log: Query '
|
||||
let running = false;
|
||||
|
||||
setInterval(async(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user