Skip to content

Commit

Permalink
0.0.70
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-zehentleitner committed Oct 10, 2024
1 parent 938eed7 commit 8912c50
Show file tree
Hide file tree
Showing 26 changed files with 77 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: 0.0.68
name: Release 0.0.68
tag_name: 0.0.70
name: Release 0.0.70
body: |
Please read the [CHANGELOG](https://unicorn-binance-depthcache-cluster.docs.lucit.tech/changelog.html) for further information.
draft: false
Expand Down
2 changes: 1 addition & 1 deletion container/generic_loader/requirements-lucit_ubdcc_dcn.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lucit-ubdcc-dcn==0.0.68
lucit-ubdcc-dcn==0.0.70
unicorn_binance_local_depth_cache>=2.1.1
2 changes: 1 addition & 1 deletion container/generic_loader/requirements-lucit_ubdcc_mgmt.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lucit-ubdcc-mgmt==0.0.68
lucit-ubdcc-mgmt==0.0.70
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lucit-ubdcc-restapi==0.0.68
lucit-ubdcc-restapi==0.0.70
1 change: 1 addition & 0 deletions dev/_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Todo:

2. Manchmal wird lizenz als invalid angezeigt

3. JSON ersatz?

self._set_update_timestamp() kontrolle in DB bei write sachen

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-dcn-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68-latest"
VERSION="0.0.70-latest"

echo Deploying UBDCC DepthCacheCluster $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-dcn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68"
VERSION="0.0.70"

echo Deploying UBDCC DepthCacheCluster $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-mgmt-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68-latest"
VERSION="0.0.70-latest"

echo Deploying UBDCC Mgmt $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-mgmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68"
VERSION="0.0.70"

echo Deploying UBDCC Mgmt $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-restapi-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68-latest"
VERSION="0.0.70-latest"

echo Deploying UBDCC RESTAPI $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/docker/lucit-ubdcc-restapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

VERSION="0.0.68"
VERSION="0.0.70"

echo Deploying UBDCC RESTAPI $VERSION to https://i018oau9.c1.de1.container-registry.ovh.net/harbor/projects/3/repositories

Expand Down
2 changes: 1 addition & 1 deletion dev/set_version_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ files:
- packages/lucit-ubdcc-shared-modules/lucit_ubdcc_shared_modules/App.py
- packages/lucit-ubdcc-shared-modules/pyproject.toml
- packages/lucit-ubdcc-shared-modules/setup.py
version: 0.0.68
version: 0.0.70
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-dcn/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lucit-ubdcc-dcn"
version = "0.0.68"
version = "0.0.70"
description = "LUCIT UBDCC DepthCacheNode"
authors = ["LUCIT Systems and Development <info@lucit.tech>"]
license = "LSOSL - LUCIT Synergetic Open Source License"
Expand All @@ -25,7 +25,7 @@ repository = "https://github.com/LUCIT-Systems-and-Development/unicorn-binance-d
[tool.poetry.dependencies]
python = ">=3.12.0"
lucit-licensing-python = ">=1.8.2"
lucit-ubdcc-shared-modules = "==0.0.68"
lucit-ubdcc-shared-modules = "==0.0.70"

[tool.poetry.dev-dependencies]

Expand Down
2 changes: 1 addition & 1 deletion packages/lucit-ubdcc-dcn/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lucit-ubdcc-shared-modules==0.0.68
lucit-ubdcc-shared-modules==0.0.70
unicorn_binance_local_depth_cache>=2.1.1
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-dcn/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

setup(
name=name,
version="0.0.68",
version="0.0.70",
author="LUCIT Systems and Development",
author_email='info@lucit.tech',
url="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-depthcache-cluster",
description="LUCIT UBDCC REST API",
long_description=long_description,
long_description_content_type="text/markdown",
license='LSOSL - LUCIT Synergetic Open Source License',
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.68'],
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.70'],
keywords='',
project_urls={
'Howto': 'https://www.lucit.tech/unicorn-binance-depthcache-cluster.html#howto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ async def ubdcc_get_responsible_dcn_addresses(self, request: Request):
return self.get_error_response(event=event, error_id="#1012",
message="Missing required parameter: exchange, market")
result = self.db.get_responsible_dcn_addresses(exchange=exchange, market=market)
print(f"RESULT: {result}")
if not result:
return self.get_error_response(event=event, error_id="#1013",
message=f"No addresses of responsible DCN for '{market}' from '{exchange}' "
Expand Down
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-mgmt/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lucit-ubdcc-mgmt"
version = "0.0.68"
version = "0.0.70"
description = "LUCIT UBDCC Mgmt Service"
authors = ["LUCIT Systems and Development <info@lucit.tech>"]
license = "LSOSL - LUCIT Synergetic Open Source License"
Expand All @@ -25,7 +25,7 @@ repository = "https://github.com/LUCIT-Systems-and-Development/unicorn-binance-d
[tool.poetry.dependencies]
python = ">=3.12.0"
lucit-licensing-python = ">=1.8.2"
lucit-ubdcc-shared-modules = "==0.0.68"
lucit-ubdcc-shared-modules = "==0.0.70"

[tool.poetry.dev-dependencies]

Expand Down
2 changes: 1 addition & 1 deletion packages/lucit-ubdcc-mgmt/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lucit-ubdcc-shared-modules==0.0.68
lucit-ubdcc-shared-modules==0.0.70
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-mgmt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

setup(
name=name,
version="0.0.68",
version="0.0.70",
author="LUCIT Systems and Development",
author_email='info@lucit.tech',
url="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-depthcache-cluster",
description="LUCIT UBDCC Mgmt",
long_description=long_description,
long_description_content_type="text/markdown",
license='LSOSL - LUCIT Synergetic Open Source License',
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.68'],
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.70'],
keywords='',
project_urls={
'Howto': 'https://www.lucit.tech/unicorn-binance-depthcache-cluster.html#howto',
Expand Down
64 changes: 38 additions & 26 deletions packages/lucit-ubdcc-restapi/lucit_ubdcc_restapi/RestEndpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#
# Copyright (c) 2024-2024, LUCIT Systems and Development (https://www.lucit.tech)
# All rights reserved.
import json

from lucit_ubdcc_shared_modules.RestEndpointsBase import RestEndpointsBase, Request

Expand Down Expand Up @@ -87,33 +88,12 @@ async def create_depthcache(self, request: Request):
async def get_asks(self, request: Request):
event = "GET_ASKS"
endpoint = "/get_asks"
exchange = request.query_params.get("exchange")
market = request.query_params.get("market")
addresses = await self.app.ubdcc_get_responsible_dcn_addresses(exchange=exchange, market=market)
print(f"addis: {addresses}")
return await self.get_depthcache_data(request=request, event=event, endpoint=endpoint)

# Todo:!
limit_count = request.query_params.get("limit_count")
threshold_volume = request.query_params.get("threshold_volume")
query = (f"?exchange={exchange}&"
f"market={market}")
url = addresses + endpoint + query
result = self.app.request(url=url, method="get")
if result.get('error') is None and result.get('error_id') is None:
return result
elif result.get('error_id') is not None:
return self.get_error_response(event=event, error_id=result.get('error_id'), message=result.get('message'))
else:
response = self.create_cluster_info_response()
response['error'] = str(result)
if self.app.data.get('db') is None:
return self.get_error_response(event=event, error_id="#9000", message=f"Mgmt service not available!",
params=response)
else:
return self.get_error_response(event=event, error_id="#8000",
message=f"Mgmt service not available! This is cached data from pod "
f"'{self.app.id['uid']}'!",
params=response)
async def get_bids(self, request: Request):
event = "GET_BIDS"
endpoint = "/get_bids"
return await self.get_depthcache_data(request=request, event=event, endpoint=endpoint)

async def get_cluster_info(self, request: Request):
event = "GET_CLUSTER_INFO"
Expand All @@ -137,6 +117,38 @@ async def get_cluster_info(self, request: Request):
f"'{self.app.id['uid']}'!",
params=response)

async def get_depthcache_data(self, request: Request, event=None, endpoint=None):
exchange = request.query_params.get("exchange")
market = request.query_params.get("market")
responsible_dcn = await self.app.ubdcc_get_responsible_dcn_addresses(exchange=exchange, market=market)
limit_count = request.query_params.get("limit_count")
threshold_volume = request.query_params.get("threshold_volume")
if responsible_dcn is None:
if not exchange or not market:
return self.get_error_response(event=event, error_id="#1025",
message="Missing required parameter: exchange, market")
addresses = self.app.data['db'].get_responsible_dcn_addresses(exchange=exchange, market=market)
else:
addresses = responsible_dcn['addresses']
if len(addresses) == 0:
return self.get_error_response(event=event, error_id="#4000",
message=f"No DCN found for '{market}' on '{exchange}'!")
query = (f"?exchange={exchange}&"
f"market={market}&"
f"limit_count={limit_count}&"
f"threshold_volume={threshold_volume}")
result_errors = []
for address, port in addresses:
self.app.stdout_msg(f"Connecting http://{address}:{port}/{endpoint}{query} ...")
url = f"http://{address}:{port}" + endpoint + query
result = self.app.request(url=url, method="get")
if result.get('error') is None and result.get('error_id') is None:
return result
result_errors.append([address, port, str(result)])
self.app.stdout_msg(f"No DCN has responded to the requests: {result_errors}")
return self.get_error_response(event=event, error_id="#5000", message=f"No DCN has responded to the requests!",
params={"requests": result_errors})

async def get_depthcache_list(self, request: Request):
event = "GET_DEPTHCACHE_LIST"
endpoint = "/get_depthcache_list"
Expand Down
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-restapi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lucit-ubdcc-restapi"
version = "0.0.68"
version = "0.0.70"
description = "LUCIT UBDCC REST API"
authors = ["LUCIT Systems and Development <info@lucit.tech>"]
license = "LSOSL - LUCIT Synergetic Open Source License"
Expand All @@ -25,7 +25,7 @@ repository = "https://github.com/LUCIT-Systems-and-Development/unicorn-binance-d
[tool.poetry.dependencies]
python = ">=3.12.0"
lucit-licensing-python = ">=1.8.2"
lucit-ubdcc-shared-modules = "==0.0.68"
lucit-ubdcc-shared-modules = "==0.0.70"

[tool.poetry.dev-dependencies]

Expand Down
2 changes: 1 addition & 1 deletion packages/lucit-ubdcc-restapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lucit-ubdcc-shared-modules==0.0.68
lucit-ubdcc-shared-modules==0.0.70
4 changes: 2 additions & 2 deletions packages/lucit-ubdcc-restapi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

setup(
name=name,
version="0.0.68",
version="0.0.70",
author="LUCIT Systems and Development",
author_email='info@lucit.tech',
url="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-depthcache-cluster",
description="LUCIT UBDCC REST API",
long_description=long_description,
long_description_content_type="text/markdown",
license='LSOSL - LUCIT Synergetic Open Source License',
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.68'],
install_requires=['lucit-licensing-python>=1.8.2', 'lucit-ubdcc-shared-modules==0.0.70'],
keywords='',
project_urls={
'Howto': 'https://www.lucit.tech/unicorn-binance-depthcache-cluster.html#howto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
REST_SERVER_PORT_DEV_DCN: int = 42082
REST_SERVER_PORT_DEV_MGMT: int = 42080
REST_SERVER_PORT_DEV_RESTAPI: int = 42081
VERSION: str = "0.0.68"
VERSION: str = "0.0.70"


class App:
Expand Down Expand Up @@ -439,16 +439,14 @@ async def ubdcc_get_responsible_dcn_addresses(self,
query = (f"?exchange={exchange}&"
f"market={market}")
url = host + endpoint + query
while self.is_shutdown() is False:
result = self.request(url=url, method="get")
if result.get('error_id') is None and result.get('error') is None:
self.stdout_msg(f"Successfully caught responsible DCN addresses for {market} on {exchange}!",
log="info")
return result
else:
self.stdout_msg(f"Can not catch responsible DCN addresses: {result}", log="error")
await asyncio.sleep(3)
return None
result = self.request(url=url, method="get")
if result.get('error_id') is None and result.get('error') is None:
self.stdout_msg(f"Successfully caught responsible DCN addresses for {market} on {exchange}!",
log="info")
return result
else:
self.stdout_msg(f"Can not catch responsible DCN addresses: {result}", log="error")
return None

def ubdcc_node_cancellation(self):
self.stdout_msg(f"Cancel node registration ...", log="info")
Expand Down
2 changes: 1 addition & 1 deletion packages/lucit-ubdcc-shared-modules/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lucit-ubdcc-shared-modules"
version = "0.0.68"
version = "0.0.70"
description = "LUCIT UBDCC Shared Modules"
authors = ["LUCIT Systems and Development <info@lucit.tech>"]
license = "LSOSL - LUCIT Synergetic Open Source License"
Expand Down
2 changes: 1 addition & 1 deletion packages/lucit-ubdcc-shared-modules/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

setup(
name=name,
version="0.0.68",
version="0.0.70",
author="LUCIT Systems and Development",
author_email='info@lucit.tech',
url="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-depthcache-cluster",
Expand Down

0 comments on commit 8912c50

Please sign in to comment.