diff --git a/howto/connect-to-many-peers-by-topic-with-hyperswarm.md b/howto/connect-to-many-peers-by-topic-with-hyperswarm.md index 279ae80..922d7c2 100644 --- a/howto/connect-to-many-peers-by-topic-with-hyperswarm.md +++ b/howto/connect-to-many-peers-by-topic-with-hyperswarm.md @@ -16,7 +16,7 @@ Create the `peer-app` project with the following commands: mkdir peer-app cd peer-app pear init -y -t terminal -npm install hyperswarm hypercore-crypto b4a +npm install hyperswarm hypercore-crypto b4a bare-process ``` Alter the peer-app/index.js file to the following: @@ -25,6 +25,7 @@ Alter the peer-app/index.js file to the following: import Hyperswarm from 'hyperswarm' import crypto from 'hypercore-crypto' import b4a from 'b4a' +import process from 'bare-process' const swarm = new Hyperswarm() Pear.teardown(() => swarm.destroy()) diff --git a/howto/connect-two-peers-by-key-with-hyperdht.md b/howto/connect-two-peers-by-key-with-hyperdht.md index 8faaa8d..c0027bd 100644 --- a/howto/connect-two-peers-by-key-with-hyperdht.md +++ b/howto/connect-two-peers-by-key-with-hyperdht.md @@ -21,7 +21,7 @@ Create the `server-app` project with the following commands: mkdir server-app cd server-app pear init -y -t terminal -npm install hyperdht b4a +npm install hyperdht b4a bare-process ``` Alter `server-app/index.js` to the following: @@ -29,6 +29,7 @@ Alter `server-app/index.js` to the following: ```javascript import DHT from 'hyperdht' import b4a from 'b4a' +import process from 'bare-process' const dht = new DHT() @@ -57,13 +58,14 @@ Create the `client-app` project with the following commands: mkdir client-app cd client-app pear init -y -t terminal -npm install hyperdht b4a +npm install hyperdht b4a bare-process ``` Alter `client-app/index.js` to the following: ``` javascript 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') 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 3d7783f..4f5f0c8 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 @@ -165,7 +165,7 @@ In a new terminal, create the `bee-reader-app` project with these commands: mkdir bee-reader-app cd bee-reader-app pear init -y -t terminal -npm install corestore hyperswarm hyperdrive debounceify b4a +npm install corestore hyperswarm hyperdrive debounceify b4a bare-process ``` Adjust the `bee-reader-app/index.js` file to: @@ -176,6 +176,7 @@ import Corestore from 'corestore' import Hyperbee from 'hyperbee' import debounce from 'debounceify' import b4a from 'b4a' +import process from 'bare-process' // create a Corestore instance const store = new Corestore(Pear.config.storage) diff --git a/howto/share-append-only-databases-with-hyperbee.md b/howto/share-append-only-databases-with-hyperbee.md index d55d828..7d62a36 100644 --- a/howto/share-append-only-databases-with-hyperbee.md +++ b/howto/share-append-only-databases-with-hyperbee.md @@ -164,7 +164,7 @@ Finally create a `core-reader-app` project: mkdir core-reader-app cd core-reader-app pear init -y -t terminal -npm install corestore hyperswarm hyperbee b4a +npm install corestore hyperswarm hyperbee b4a bare-process ``` @@ -174,6 +174,7 @@ Alter the generated `core-reader-app/index.js` file to the following import Hyperswarm from 'hyperswarm' import Corestore from 'corestore' import b4a from 'b4a' +import process from 'bare-process' import { Node } from 'hyperbee/lib/messages.js'