From e28cf00b1026432500cb98d6000050c457f2530f Mon Sep 17 00:00:00 2001 From: Md Tanjin Alam Date: Wed, 14 Aug 2024 13:52:15 +0600 Subject: [PATCH] Fixed command-line argument parameter parsing across files from process.argv[2] to process.argv[3] (#115) --- howto/connect-two-peers-by-key-with-hyperdht.md | 4 ++-- .../create-a-full-peer-to-peer-filesystem-with-hyperdrive.md | 2 +- howto/share-append-only-databases-with-hyperbee.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/howto/connect-two-peers-by-key-with-hyperdht.md b/howto/connect-two-peers-by-key-with-hyperdht.md index c0027bd..b49e0ac 100644 --- a/howto/connect-two-peers-by-key-with-hyperdht.md +++ b/howto/connect-two-peers-by-key-with-hyperdht.md @@ -67,8 +67,8 @@ import DHT from 'hyperdht' import b4a from 'b4a' import process from 'bare-process' -console.log('Connecting to:', process.argv[2]) -const publicKey = b4a.from(process.argv[2], 'hex') +console.log('Connecting to:', process.argv[3]) +const publicKey = b4a.from(process.argv[3], 'hex') const dht = new DHT() const conn = dht.connect(publicKey) diff --git a/howto/create-a-full-peer-to-peer-filesystem-with-hyperdrive.md b/howto/create-a-full-peer-to-peer-filesystem-with-hyperdrive.md index 4f5f0c8..1859ae9 100644 --- a/howto/create-a-full-peer-to-peer-filesystem-with-hyperdrive.md +++ b/howto/create-a-full-peer-to-peer-filesystem-with-hyperdrive.md @@ -188,7 +188,7 @@ Pear.teardown(() => swarm.destroy()) swarm.on('connection', conn => store.replicate(conn)) // create/get the hypercore instance using the public key supplied as command-line arg -const core = store.get({ key: b4a.from(process.argv[2], 'hex') }) +const core = store.get({ key: b4a.from(process.argv[3], 'hex') }) // create a hyperbee instance using the hypercore instance const bee = new Hyperbee(core, { diff --git a/howto/share-append-only-databases-with-hyperbee.md b/howto/share-append-only-databases-with-hyperbee.md index 7d62a36..266c2ae 100644 --- a/howto/share-append-only-databases-with-hyperbee.md +++ b/howto/share-append-only-databases-with-hyperbee.md @@ -188,7 +188,7 @@ Pear.teardown(() => swarm.destroy()) swarm.on('connection', conn => store.replicate(conn)) // create or get the hypercore using the public key supplied as command-line argument -const core = store.get({ key: b4a.from(process.argv[2], 'hex') }) +const core = store.get({ key: b4a.from(process.argv[3], 'hex') }) // wait till the properties of the hypercore instance are initialized await core.ready()