-
Notifications
You must be signed in to change notification settings - Fork 0
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
17 changed files
with
96 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,9 @@ __pycache__/ | |
# C extensions | ||
*.so | ||
|
||
#vscode | ||
.vscode/ | ||
|
||
# npm packages | ||
node_modules/ | ||
|
||
|
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
""" | ||
Cache configuration for the application. | ||
""" | ||
from flask_caching import Cache | ||
|
||
cache = Cache(config={'CACHE_TYPE': 'simple'}) | ||
cache = Cache(config={'CACHE_TYPE': 'simple'}) |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# config.py | ||
from dotenv import load_dotenv | ||
""" | ||
Function for loading .env files | ||
""" | ||
|
||
import os | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
api_url = os.getenv("API_URL") | ||
print(api_url) # Add this line | ||
print(api_url) |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
""" | ||
Gunicorn config file | ||
""" | ||
|
||
import multiprocessing | ||
|
||
bind = "0.0.0.0:5000" | ||
worker_class = 'eventlet' | ||
workers = multiprocessing.cpu_count() * 2 + 1 | ||
bind = "0.0.0.0:5000" # pylint: disable=invalid-name | ||
worker_class = 'eventlet' # pylint: disable=invalid-name | ||
workers = multiprocessing.cpu_count() * 2 + 1 |
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
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
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
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
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
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
from .common import get_supplies, peerplays, ASSET_IDS | ||
""" | ||
Circulating supply endpoint | ||
""" | ||
from peerplays.asset import Asset | ||
from flask import Response | ||
from src.supply.common import get_supplies, peerplays, ASSET_IDS | ||
|
||
|
||
def circulating_supply(coin_name): | ||
""" | ||
This endpoint returns the circulating supply for the given coin name. | ||
""" | ||
asset_id = ASSET_IDS.get(coin_name) | ||
if asset_id is None: | ||
return Response("Invalid coin name", status=400) | ||
A = Asset(asset_id, blockchain_instance=peerplays) | ||
supply = get_supplies(A)["circulating"] | ||
return Response(supply, content_type='text/plain') | ||
return Response(supply, content_type='text/plain') |
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
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
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
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
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