Skip to content

Commit

Permalink
docs: request-ipfs image for local node (#1083) (#1172)
Browse files Browse the repository at this point in the history
Signed-off-by: OjusWiZard <ojuswimail@gmail.com>
Co-authored-by: MantisClone <david.huntmateo@request.network>
  • Loading branch information
OjusWiZard and MantisClone committed Sep 21, 2023
1 parent 0fa63d6 commit 1e7e2ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
14 changes: 5 additions & 9 deletions packages/ethereum-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,22 @@ TRUFFLE_GANACHE_HOST="host" TRUFFLE_GANACHE_PORT=1010 yarn run deploy

## IPFS

In order to use the package in a test environment, IPFS should be [installed locally](https://docs.ipfs.io/guides/guides/install/) and can then be started with the following commands:

```bash
yarn init-ipfs # documented below
ipfs daemon
```

In order to use the package in a test environment, IPFS should be running locally.
Local IPFS listening on port 5001 is used by default by the `ethereum-storage` package.

### Setup IPFS private network

Request uses an IPFS private network to allow all nodes to connect to each other directly,
instead of having to navigate through the public IPFS network.

To setup your IPFS node to the private network, you can run the following utility script:
You may use the [Request IPFS docker image](https://github.com/RequestNetwork/docker-images/tree/master/request-ipfs) to setup your IPFS node to the private network. Make sure that [docker is installed](https://docs.docker.com/get-docker/) on your system and then run the following command:

```bash
yarn init-ipfs
docker run -p 4001:4001 -p 5001:5001 requestnetwork/request-ipfs
```

This will pull the [request-ipfs](https://hub.docker.com/r/requestnetwork/request-ipfs) docker image and run it locally.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-storage/scripts/init-ipfs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
*
* This script is deprecated and will be removed in the future.
* Use the Request IPFS docker image (https://hub.docker.com/r/requestnetwork/request-ipfs) instead.
*
*
*/

const shell = require('shelljs');
const fs = require('fs');
const path = require('path');
Expand Down
26 changes: 10 additions & 16 deletions packages/request-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ The Request Node uses IPFS to store and share transactions in a private network.
We use a private network to allow all nodes to connect to each other directly,
instead of having to navigate through the public IPFS network.

To setup your IPFS node to the private network, you can run the following utility script:
To setup your IPFS node to the private network, you can use the [request-ipfs](https://hub.docker.com/r/requestnetwork/request-ipfs) docker image. Make sure that [docker is installed](https://docs.docker.com/get-docker/) on your system and then run the following command:

```bash
yarn init-ipfs
docker run -p 4001:4001 -p 5001:5001 requestnetwork/request-ipfs
```

This will pull the [request-ipfs](https://hub.docker.com/r/requestnetwork/request-ipfs) docker image and run it locally.

#### TheGraph mode

An alternative data access relies on a [Graph](https://thegraph.com/) node, for better indexing & performance.
Expand Down Expand Up @@ -310,48 +312,40 @@ cd requestNetwork

#### 2. Install and build all the dependencies.

Install IPFS Kubo (go-ipfs)
https://docs.ipfs.tech/install/command-line/#install-ipfs-kubo

```bash
yarn install
yarn build
```

#### 3. On a new terminal, launch a local IPFS node

```bash
ipfs daemon
```

#### 4. On a new terminal, configure your IPFS node to connect to the private Request IPFS network
Make sure the [Docker](https://docs.docker.com/get-docker/) is installed.

```bash
cd packages/request-node
yarn init-ipfs
docker run -p 4001:4001 -p 5001:5001 requestnetwork/request-ipfs
```

#### 5. Launch [ganache](https://github.com/trufflesuite/ganache-cli#installation) with the default Request Node mnemonic
#### 4. Launch [ganache](https://github.com/trufflesuite/ganache-cli#installation) with the default Request Node mnemonic

```bash
ganache-cli -l 90000000 -p 8545 -m \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\"
```

#### 6. Deploy the smart contracts on ganache
#### 5. Deploy the smart contracts on ganache

```bash
cd packages/smart-contracts
yarn deploy
```

#### 7. Run the Request Node
#### 6. Run the Request Node

```bash
cd ../packages/request-node
yarn start
```

#### 8. Test
#### 7. Test

Open a browser and navigate towards: http://localhost:3000/status
You can see the details of your local Request & IPFS nodes.
Expand Down

0 comments on commit 1e7e2ce

Please sign in to comment.