moonstream/backend
kompotkot 3458186a1e Organized sample, renamed s3 variable and web3_provider env changed
Func in web3_provider checks if env variable starts with http then
it use it, otherwise it call route53 to fetch ip address of node.
2021-11-30 14:23:13 +00:00
..
configs Organized sample, renamed s3 variable and web3_provider env changed 2021-11-30 14:23:13 +00:00
deploy
moonstreamapi Organized sample, renamed s3 variable and web3_provider env changed 2021-11-30 14:23:13 +00:00
scripts
.dockerignore
.gitignore
README.md
dev.sh
mypy.ini
setup.py

README.md

moonstream backend

Installation and setup

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

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
sed --in-place 's|^export * ||' configs/docker.dev.env
sed --in-place 's|"||g' configs/docker.dev.env

Build container on your machine

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/)

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

docker container attach moonstreamapi-dev