Metadata-Version: 2.1
Name: moonstreamapi
Version: 0.4.11
Summary: The Bugout blockchain inspector API.
Home-page: https://github.com/bugout-dev/moonstream
Author: Bugout.dev
Author-email: engineering@bugout.dev
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
Requires-Dist: appdirs
Requires-Dist: boto3
Requires-Dist: bugout>=0.2.15
Requires-Dist: fastapi
Requires-Dist: moonstream>=0.1.2
Requires-Dist: moonstreamdb>=0.4.6
Requires-Dist: moonstreamdb-v3>=0.1.3
Requires-Dist: humbug
Requires-Dist: pydantic==1.10.2
Requires-Dist: pyevmasm
Requires-Dist: python-dateutil
Requires-Dist: python-multipart
Requires-Dist: python-slugify
Requires-Dist: uvicorn
Requires-Dist: web3<6,>=5.30.0
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: types-python-dateutil; extra == "dev"
Provides-Extra: distribute
Requires-Dist: build; extra == "distribute"
Requires-Dist: twine; extra == "distribute"

# moonstream backend

### Installation and setup

To set up Moonstream API for development, do the following:

- Clone the git repository
- Install postgresql (https://www.postgresql.org/download/linux/ubuntu/)

#### Run server with Docker

To be able to run Moonstream API with your existing local or development services as database, you need to build your own setup. **Be aware! The files with environment variables `docker.dev.env` lives inside your docker container!**

- Copy `configs/sample.env` to `configs/docker.dev.env`, or use your local configs from `configs/dev.env` to `configs/docker.dev.env`
- Edit in `docker.dev.env` file `MOONSTREAM_DB_URI` and other variables if required
- Clean environment file from `export ` prefix and quotation marks to be able to use it with Docker

```bash
sed --in-place 's|^export * ||' configs/docker.dev.env
sed --in-place 's|"||g' configs/docker.dev.env
```

Build container on your machine

```bash
docker build -t moonstreamapi-dev .
```

Run `moonstreamapi-dev` container, with following command we specified `--network="host"` setting which allows to Docker container use localhost interface of your machine (https://docs.docker.com/network/host/)

```bash
docker run --name moonstreamapi-dev \
  --network="host" \
  --env-file="configs/docker.dev.env" \
  -p 7481:7481/tcp \
  -ti -d moonstreamapi-dev
```

Attach to container to see logs

```bash
docker container attach moonstreamapi-dev
```
