Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn1F3rt committed Oct 27, 2024
1 parent 54e4a8e commit 769752d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
env:
uv venv

prod:
uv sync --no-dev

dev:
Expand Down
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ NervaAPI is a RESTful API server for the Nerva blockchain. It provides a simple
- Git
- Python >= 3.8
- MongoDB database
- [make](https://www.gnu.org/software/make/) (optional)

## Installation

Expand All @@ -38,22 +39,62 @@ NervaAPI is a RESTful API server for the Nerva blockchain. It provides a simple
cd NervaAPI
```

4. Install dependencies
4. Create a virtual environment

```shell
uv venv
```
or if you have `make` installed

```shell
make env
```

5. Install dependencies

```shell
uv sync --no-dev
```
or if you have `make` installed

```shell
make prod
```

## Configuration

Copy the [`config.example.py`](config.example.py) file to `config.py` and update the variables.

## Running

### Development

```shell
uv run launcher.py
```

or if you have `make` installed

```shell
make
```

### Production

```shell
source .venv/bin/activate
hypercorn --bind 0.0.0.0:8000 launcher:app
```

or if you want to enable SSL support

```shell
source .venv/bin/activate
hypercorn --certfile cert.pem --keyfile key.pem --bind 0.0.0.0:8000 launcher:app
```

The API server will be running at `http://localhost:8000`. The certificate and key files are required for SSL support.

## License

[GNU General Public License v3.0](LICENSE)
Expand Down

0 comments on commit 769752d

Please sign in to comment.