Skip to content

Commit

Permalink
Add configuration scripts for local IPFS server
Browse files Browse the repository at this point in the history
  • Loading branch information
c0llab0rat0r committed May 18, 2021
1 parent caf17d0 commit cab4cd0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ You can submit bug reports using the

### Setting up a local development environment

1. Follow the instructions in the IPFS documentation to install go-IPFS into your `${PATH}`:
https://docs.ipfs.io/install/command-line/
1. [Install and configure a local IPFS server](tools/ipfs/README.md):
2. Follow the instructions in the (Python) tox documentation to install the `tox` Python environment runner:
https://tox.readthedocs.io/en/latest/install.html
3. Clone the GIT repository if you haven't already:
Expand All @@ -235,7 +234,13 @@ make sure that your code passes both the

$ tox -e styleck -e typeck

As well as the unit tests:
As well as the tests:

1. Start IPFS server (do this once in a separate terminal):

$ ./tools/ipfs/run.sh

2. Execute unit and functional tests:

$ tox -e py3 -e py3-httpx

Expand Down
27 changes: 27 additions & 0 deletions tools/ipfs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# Local IPFS Server

`py-ipfs-httpclient` requires a live local server to run its
functional tests.

## Installation

To install it, follow the [official instructions](https://docs.ipfs.io/install/command-line/),
then finish with some [local configuration](configure.sh):

$ ./configure.sh

The above script is run once after installing.

## Running Tests

You can run unit tests without a live server; `pytest` will skip
over the functional tests when our fixtures detect the server
isn't running.

In a separate terminal, start IPFS with:

$ ./run.sh

Stop it with Ctrl+C. You can keep it running across multiple
executions of the functional test suite.
12 changes: 12 additions & 0 deletions tools/ipfs/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Configures, but does not start, the IPFS daemon. Run once in your environment.
#
# Description of experimental features:
# https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#ipfs-filestore

set -e

ipfs init
ipfs config --json Experimental.FilestoreEnabled true
ipfs config --json Experimental.UrlstoreEnabled true
5 changes: 5 additions & 0 deletions tools/ipfs/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Run the IPFS server. To stop it, press Ctrl+C.

ipfs daemon --enable-namesys-pubsub

0 comments on commit cab4cd0

Please sign in to comment.