Skip to content

Commit

Permalink
README added
Browse files Browse the repository at this point in the history
  • Loading branch information
akolotov committed Oct 27, 2022
1 parent 13c447d commit 00667cc
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Simple web service to provide circulating supply for BOB token
====

This web service is requests totalSupply() through configured RPCs and returns the sum of requested values as a response on GET to `/`.

## Build a docker image

The docker image is built autimatically by GitHub actions and available by

```
docker pull ghcr.io/zkbob/bob-circulating-supply:latest
```

Another option is to build the docker image from scratch:

```
docker build -t ghcr.io/zkbob/bob-circulating-supply .
```

## Run the docker image

By using `.env.example` prepare `.env` file. Tune `UPDATE_INTERVAL` in the file to achieve desired behavior.

The docker container can be run in this case as

```
docker run -ti --rm -p 8000:8000 -e PORT=8000 ghcr.io/zkbob/bob-circulating-supply
```

Another option is to use docker composer to run the service:

```
docker compose up -d
docker compose logs -f
```

## Publishing the docker image on Heroku

Assuming that the app `my-heroku-app` is created on Heroku platform and Heroku CLI is installed on the local machine, the next steps can be executed to release the app:

```
heroku login
heroku container:login
docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
docker tag ghcr.io/zkbob/bob-circulating-supply:main registry.heroku.com/my-heroku-app/web:latest
docker push registry.heroku.com/my-heroku-app/web:latest
heroku container:release -a my-heroku-app web
```

An extra step can be done if you have a [papertrail](https://papertrailapp.com/) account configured and would like to forward logs from the Heroku app to the remote logs storage:

```
heroku drains:add syslog+tls://logsXXX.papertrailapp.com:YYYY -a my-heroku-app
```

Is it possible to see configured drains for the app by:

```
heroku drains --app my-heroku-app
```
File renamed without changes.

0 comments on commit 00667cc

Please sign in to comment.