diff --git a/README.md b/README.md index 80b6f55f..0d720378 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 diff --git a/tools/ipfs/README.md b/tools/ipfs/README.md new file mode 100644 index 00000000..9ddf6d61 --- /dev/null +++ b/tools/ipfs/README.md @@ -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. diff --git a/tools/ipfs/configure.sh b/tools/ipfs/configure.sh new file mode 100755 index 00000000..849976d8 --- /dev/null +++ b/tools/ipfs/configure.sh @@ -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 diff --git a/tools/ipfs/run.sh b/tools/ipfs/run.sh new file mode 100755 index 00000000..4dc91c86 --- /dev/null +++ b/tools/ipfs/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run the IPFS server. To stop it, press Ctrl+C. + +ipfs daemon --enable-namesys-pubsub