Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pyaleph-ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
68 changes: 0 additions & 68 deletions INSTALL.md

This file was deleted.

33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -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).
33 changes: 14 additions & 19 deletions deployment/docker-build/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand All @@ -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.
2 changes: 1 addition & 1 deletion deployment/docker-build/build.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion deployment/docker-build/publish-alpha.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion deployment/docker-build/publish.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions deployment/docker-build/pyaleph.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ 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/
RUN /opt/venv/bin/python3 /opt/build/extract_requirements.py /opt/pyaleph/setup.cfg -o /opt/build/requirements.txt
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
Expand All @@ -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
4 changes: 2 additions & 2 deletions deployment/migrations/config_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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__":
Expand Down
4 changes: 2 additions & 2 deletions deployment/migrations/scripts/0001-update-keys-for-p2pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
8 changes: 4 additions & 4 deletions deployment/samples/README.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 3 additions & 2 deletions deployment/samples/docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 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/).

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.
8 changes: 4 additions & 4 deletions deployment/samples/docker-monitoring/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down