From c235316ba11edf5a44a5750afd8767d943ce8192 Mon Sep 17 00:00:00 2001 From: Olivier Desenfans Date: Tue, 22 Feb 2022 12:51:58 +0100 Subject: [PATCH] [Docs] Rename PyAleph to Core Channel Node --- .github/workflows/pyaleph-ci.yml | 2 +- INSTALL.md | 68 ------------------- README.md | 33 ++++++--- deployment/docker-build/README.md | 33 ++++----- deployment/docker-build/build.sh | 2 +- deployment/docker-build/publish-alpha.sh | 2 +- deployment/docker-build/publish.sh | 2 +- deployment/docker-build/pyaleph.dockerfile | 8 +-- deployment/migrations/config_updater.py | 4 +- .../scripts/0001-update-keys-for-p2pd.py | 4 +- deployment/samples/README.md | 8 +-- deployment/samples/docker-compose/README.md | 5 +- .../samples/docker-monitoring/README.md | 8 +-- 13 files changed, 62 insertions(+), 117 deletions(-) delete mode 100644 INSTALL.md diff --git a/.github/workflows/pyaleph-ci.yml b/.github/workflows/pyaleph-ci.yml index abaec818d..ca8735278 100644 --- a/.github/workflows/pyaleph-ci.yml +++ b/.github/workflows/pyaleph-ci.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: PyAleph +name: Unit tests on: push: diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index c86567d30..000000000 --- a/INSTALL.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Local Installation - -This document contains the instruction to install PyAleph locally without Docker. -Note that it may not be entirely up to date, since the Docker deployment is the most tested procedure. - - -## Dependencies - -To install PyAleph, you must first install its dependencies. -Here are the requirements on Ubuntu: - -`$ sudo apt install python3-dev build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libgmp-dev libsecp256k1-dev` - -You need to install the requirements, ideally in an empty virtualenv (I let -that part to you): - -```bash -pip install git+https://github.com/aleph-im/py-libp2p.git -pip install git+https://github.com/aleph-im/nuls2-python.git -pip install git+https://github.com/aleph-im/aleph-client.git - -pip install -U aioipfs - -python setup.py develop -``` - -Then, once it's installed, you need to copy the sample-config.yaml file elsewhere, -and edit it to your liking (see configuration section). - -To run PyAleph, run this command: - -`$ pyaleph -c config.yaml` (where config.yaml is your configuration file you -edited earlier) - - -## Running tests - -Install in develop with all extras: - -`$ pip install -e ".[pokadot,cosmos,testing]"` - -Then run the tests: - -`$ pytest` - - - -## Running services required - -### IPFS - -You can have a running go IPFS instance running and linked in the configuration file (TODO: write details), if you don't you need to set ipfsd.enabled to false in configuration. - -PubSub should be active and configured to use GossipSub. -More info there: https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#ipfs-pubsub - -You can add our bootstrap node and connect to it on your ipfs node to be connected to the aleph network faster: - -``` -$ ipfs bootstrap add /dnsaddr/bootstrap.aleph.im/ipfs/QmPR8m8WCmYKuuxg5Qnadd4LbnTCD2L93cV2zPW5XGVHTG -$ ipfs swarm connect /dnsaddr/bootstrap.aleph.im/ipfs/QmPR8m8WCmYKuuxg5Qnadd4LbnTCD2L93cV2zPW5XGVHTG -``` - -### Mongodb - -A local running mongodb instance is required, by default it's connected to localhost port 27017, you can change -the configuration file if needed. diff --git a/README.md b/README.md index b09d371e3..2984d51bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PyAleph: Python node for the Aleph network +# Aleph Core Channel Node (CCN) Next generation network of decentralized big data applications. Development follows the [Aleph Whitepaper](https://github.com/moshemalawach/aleph-whitepaper). @@ -16,17 +16,34 @@ section of the documentation to install a node. ## Development -[//]: # (TODO update) -Since PyAleph requires the installation of a few dependencies, the easiest way to start is the -[Docker and Docker Compose](https://github.com/aleph-im/pyaleph/tree/master/deployment/docker-build) -setup. +Do you want to contribute to the development of the CCN? +Here is the procedure to install the development environment. +We recommend using Ubuntu 20.04. + +### 1. Install dependencies + +```bash +sudo apt install python3 python3-pip python3-venv build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libgmp-dev libsecp256k1-dev +``` + +### 2. Install Python requirements + +Clone the repository and run the following commands from the root directory: + +``` +python3 -m virtualenv venv +source venv/bin/activate +pip install -e .[testing,docs] +``` + +You're ready to go! ## Software used -PyAleph is written in Python and requires Python v3.6+. It will not work with older versions of Python. +The Aleph CCN is written in Python and requires Python v3.6+. It will not work with older versions of Python. -PyAleph also relies on [MongoDB](https://www.mongodb.com/) and [IPFS](https://ipfs.io/). +It also relies on [MongoDB](https://www.mongodb.com/) and [IPFS](https://ipfs.io/). ## License -PyAleph is open-source software, released under [The MIT License (MIT)](LICENSE.txt). +The Aleph CCN is open-source software, released under [The MIT License (MIT)](LICENSE.txt). diff --git a/deployment/docker-build/README.md b/deployment/docker-build/README.md index 20b5d8dd3..50165245a 100644 --- a/deployment/docker-build/README.md +++ b/deployment/docker-build/README.md @@ -1,6 +1,7 @@ -# PyAleph Docker (Beta) +# Aleph Core Channel Node (CCN) Docker (Beta) -This directory contains the `Dockerfile` to build and run PyAleph in production. +This directory contains the `Dockerfile` to build and run the CCN in production, +as well as a Docker Compose file for use during development. ## Build the Docker image @@ -14,12 +15,14 @@ or by running the Docker build command from the root of the repository: docker build -t alephim/pyaleph-node -f deployment/docker/pyaleph.dockerfile . ``` -## Configure PyAleph +## Configure the CCN -We provide a template configuration in the file `deployment/docker/config.yml`, +We provide a template configuration in the file `samples/docker-compose/config.yml`, which you will want to customize for your system. -Change the Ethereum API URL to the endpoint you want PyAleph to use. +Change the Ethereum API URL to the endpoint you want the CCN to use. + +To run the local dev environment, you will need to set the P2P daemon, IPFS and MongoDB hosts to `127.0.0.1`. ### Generate your node's private key @@ -30,23 +33,15 @@ You can generate this key using the following commands after building the Docker docker run --rm -ti --user root -v $(pwd)/node-secret.key:/opt/pyaleph/node-secret.key alephim/pyaleph-node:latest pyaleph --gen-keys ``` -## Running with Docker Compose +## Start the dev environment -You can run PyAleph and it's dependencies MongoDB and IPFS using Docker Compose. +Run the Docker Compose file to start all the required services: -The configuration we provide allows you to run a reverse-proxy for HTTPS termination -on a docker network named `reverse-proxy`, so you will need to create it first: - -```shell script -docker network create reverse-proxy ``` - -You can then run PyAleph using Docker Compose: -```shell script -docker-compose -f deployment/docker/docker-compose.yml up +docker-compose -f deployment/docker-build/docker-compose.yml up -d ``` -## Running with another infrastructure +This will instantiate the services for MongoDB, IPFS and the P2P daemon. -Have a look at the `docker-compose.yml` configuration to understand how PyAleph -can be run. +You can now start the Core Channel Node locally using the `pyaleph` command or by running the `aleph.commands` module, +for example from PyCharm. diff --git a/deployment/docker-build/build.sh b/deployment/docker-build/build.sh index d56a06d51..d8e094bad 100755 --- a/deployment/docker-build/build.sh +++ b/deployment/docker-build/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Use this script to build the Docker image of PyAleph +# Use this script to build the Docker image of the Core Channel Node set -euo pipefail diff --git a/deployment/docker-build/publish-alpha.sh b/deployment/docker-build/publish-alpha.sh index 1163e5c02..fd051fdc6 100755 --- a/deployment/docker-build/publish-alpha.sh +++ b/deployment/docker-build/publish-alpha.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Use this script to publish the current Docker image of PyAleph on Docker Hub +# Use this script to publish the current Docker image of the CCN on Docker Hub set -euo pipefail diff --git a/deployment/docker-build/publish.sh b/deployment/docker-build/publish.sh index 2727b36bc..4f8b690f9 100755 --- a/deployment/docker-build/publish.sh +++ b/deployment/docker-build/publish.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Use this script to publish the current Docker image of PyAleph on Docker Hub +# Use this script to publish the current Docker image of the CCN on Docker Hub set -euo pipefail diff --git a/deployment/docker-build/pyaleph.dockerfile b/deployment/docker-build/pyaleph.dockerfile index c8b0311de..0f0fc4248 100644 --- a/deployment/docker-build/pyaleph.dockerfile +++ b/deployment/docker-build/pyaleph.dockerfile @@ -58,7 +58,7 @@ ENV PIP_NO_CACHE_DIR yes RUN /opt/venv/bin/python3 -m pip install --upgrade pip wheel ENV PATH="/opt/venv/bin:${PATH}" -# === Install PyAleph dependencies === +# === Install CCN dependencies === # Install dependencies early to cache them and accelerate incremental builds. COPY setup.cfg /opt/pyaleph/ COPY deployment/scripts/extract_requirements.py /opt/build/ @@ -66,11 +66,11 @@ RUN /opt/venv/bin/python3 /opt/build/extract_requirements.py /opt/pyaleph/setup. RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/build/requirements.txt RUN rm /opt/build/extract_requirements.py /opt/build/requirements.txt -# === Install PyAleph itself === +# === Install the CCN itself === COPY deployment/migrations /opt/pyaleph/migrations COPY setup.py /opt/pyaleph/ COPY src /opt/pyaleph/src -# Git data is used to determine PyAleph's version +# Git data is used to determine the version of the CCN COPY .git /opt/pyaleph/.git USER root @@ -87,5 +87,5 @@ RUN /opt/venv/bin/pip freeze > /opt/build-frozen-requirements.txt USER aleph CMD ["pyaleph"] -# PyAleph API +# CCN API EXPOSE 8000 diff --git a/deployment/migrations/config_updater.py b/deployment/migrations/config_updater.py index 034da2e9b..7bc366ff5 100644 --- a/deployment/migrations/config_updater.py +++ b/deployment/migrations/config_updater.py @@ -39,7 +39,7 @@ def cli_parse() -> argparse.Namespace: action="store", required=True, type=str, - help="Path to the PyAleph configuration file.", + help="Path to the Core Channel Node configuration file.", ) parser.add_argument( "--key-dir", @@ -103,7 +103,7 @@ def main(args: argparse.Namespace): migration_func = getattr(migration_module, args.command) migration_func(config_file=args.config, key_dir=args.key_dir, key_file=args.key_file) - LOGGER.info(f"Successfully ran %s. You can now start PyAleph.", command) + LOGGER.info(f"Successfully ran %s. You can now start the Core Channel Node.", command) if __name__ == "__main__": diff --git a/deployment/migrations/scripts/0001-update-keys-for-p2pd.py b/deployment/migrations/scripts/0001-update-keys-for-p2pd.py index a233788ed..15cb1fb9e 100644 --- a/deployment/migrations/scripts/0001-update-keys-for-p2pd.py +++ b/deployment/migrations/scripts/0001-update-keys-for-p2pd.py @@ -31,10 +31,10 @@ def populate_key_dir(private_key_str: str, output_dir: Path) -> None: def get_key_from_config(config_file: Path) -> Optional[str]: """ - In previous versions of PyAleph, it was possible to set the key value directly + In previous versions of the CCN, it was possible to set the key value directly in the config file. This function tries to find it in the config or returns None. - :param config_file: Path to the PyAleph configuration file. + :param config_file: Path to the CCN configuration file. :return: The private key used to identify the node on the P2P network, or None if the key is not provided in the config file. """ diff --git a/deployment/samples/README.md b/deployment/samples/README.md index 620fbd06b..bac14e58c 100644 --- a/deployment/samples/README.md +++ b/deployment/samples/README.md @@ -1,7 +1,7 @@ # Deployment samples -This directory provides examples that demonstrate how you can deploy PyAleph. +This directory provides examples that demonstrate how you can deploy your own Aleph Core Channel Node (CCN). -* docker-compose: Deploy PyAleph in the simplest form using Docker Compose -* docker-monitoring: Deploy PyAleph along with Grafana and Prometheus to monitor your node -* native-install: Deploy PyAleph on a Ubuntu server and run it manually. +* docker-compose: Deploy the CCN in the simplest form using Docker Compose +* docker-monitoring: Deploy the CCN along with Grafana and Prometheus to monitor your node +* native-install: Deploy the CCN on a Ubuntu server and run it manually. diff --git a/deployment/samples/docker-compose/README.md b/deployment/samples/docker-compose/README.md index d220cb15d..b55714384 100644 --- a/deployment/samples/docker-compose/README.md +++ b/deployment/samples/docker-compose/README.md @@ -1,4 +1,4 @@ -# PyAleph Deployment +# Core Channel Node Deployment This directory contains the [Docker Compose](https://docs.docker.com/compose/) file to run an Aleph Node in production using the official Docker images on [Docker Hub](https://hub.docker.com/). @@ -6,4 +6,5 @@ to run an Aleph Node in production using the official Docker images on [Docker H See the [Docker-Compose documentation on readthedocs.io](https://pyaleph.readthedocs.io/en/latest/guides/docker-compose.html) for the documentation. -See [deployment/docker-build](../../docker-build) to build your own image of PyAleph and run it with Docker-Compose. +See [deployment/docker-build](../../docker-build) to build your own image of the Core Channel Node +and run it with Docker-Compose. diff --git a/deployment/samples/docker-monitoring/README.md b/deployment/samples/docker-monitoring/README.md index 14ddbc164..34757fc42 100644 --- a/deployment/samples/docker-monitoring/README.md +++ b/deployment/samples/docker-monitoring/README.md @@ -1,6 +1,6 @@ -# PyAleph Deployment with Monitoring +# Aleph Core Channel Node (CCN) deployment with Monitoring -This directory contains a configuration to run a PyAleph node in production with Monitoring. +This directory contains a configuration to run a CCN in production with Monitoring. It is aimed at a starting point for node operators interested in easily getting pre-made basic metrics on their node. @@ -11,12 +11,12 @@ with performance monitoring using [Prometheus](https://prometheus.io/) and [Graf ### Other links -See [../docker-build](../../docker-build) to PyAleph without the monitoring. +See [../docker-compose](../docker-compose) to run a CCN without the monitoring. See the [Docker-Compose documentation on readthedocs.io](https://pyaleph.readthedocs.io/en/latest/guides/docker-compose.html) for the documentation. -See [../docker-build](../../docker-build) to build your own image of PyAleph and run it with Docker-Compose. +See [../docker-build](../../docker-build) to build your own image of the CCN and run it with Docker-Compose. ## Configuration