@ruvector/edge-net 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +279 -0
- package/agents.js +965 -0
- package/cli.js +17 -0
- package/join.html +985 -0
- package/join.js +1333 -0
- package/network.js +820 -0
- package/networks.js +817 -0
- package/package.json +33 -5
- package/webrtc.js +964 -0
package/cli.js
CHANGED
|
@@ -109,6 +109,7 @@ function printHelp() {
|
|
|
109
109
|
|
|
110
110
|
${c('bold', 'COMMANDS:')}
|
|
111
111
|
${c('green', 'start')} Start an edge-net node in the terminal
|
|
112
|
+
${c('green', 'join')} Join network with public key (multi-contributor support)
|
|
112
113
|
${c('green', 'benchmark')} Run performance benchmarks
|
|
113
114
|
${c('green', 'info')} Show package and WASM information
|
|
114
115
|
${c('green', 'demo')} Run interactive demonstration
|
|
@@ -119,6 +120,9 @@ ${c('bold', 'EXAMPLES:')}
|
|
|
119
120
|
${c('dim', '# Start a node')}
|
|
120
121
|
$ npx @ruvector/edge-net start
|
|
121
122
|
|
|
123
|
+
${c('dim', '# Join with new identity (multi-contributor)')}
|
|
124
|
+
$ npx @ruvector/edge-net join --generate
|
|
125
|
+
|
|
122
126
|
${c('dim', '# Run benchmarks')}
|
|
123
127
|
$ npx @ruvector/edge-net benchmark
|
|
124
128
|
|
|
@@ -408,6 +412,16 @@ async function runDemo() {
|
|
|
408
412
|
console.log(`${c('dim', 'For full P2P features, run in a browser environment.')}`);
|
|
409
413
|
}
|
|
410
414
|
|
|
415
|
+
async function runJoin() {
|
|
416
|
+
// Delegate to join.js
|
|
417
|
+
const { spawn } = await import('child_process');
|
|
418
|
+
const args = process.argv.slice(3);
|
|
419
|
+
const child = spawn('node', [join(__dirname, 'join.js'), ...args], {
|
|
420
|
+
stdio: 'inherit'
|
|
421
|
+
});
|
|
422
|
+
child.on('close', (code) => process.exit(code));
|
|
423
|
+
}
|
|
424
|
+
|
|
411
425
|
// Main
|
|
412
426
|
const command = process.argv[2] || 'help';
|
|
413
427
|
|
|
@@ -415,6 +429,9 @@ switch (command) {
|
|
|
415
429
|
case 'start':
|
|
416
430
|
startNode();
|
|
417
431
|
break;
|
|
432
|
+
case 'join':
|
|
433
|
+
runJoin();
|
|
434
|
+
break;
|
|
418
435
|
case 'benchmark':
|
|
419
436
|
case 'bench':
|
|
420
437
|
runBenchmark();
|