-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.