fix pk read issue

This commit is contained in:
Dobromir Popov
2024-10-09 13:21:00 +03:00
parent e1f28f2f38
commit 9f041f491b
2 changed files with 6 additions and 7 deletions

View File

@ -1160,7 +1160,8 @@ async def subscribe_to_wallet():
pk = os.getenv("PK")
if not pk:
try:
with open('./crypto/sol/secret.pk', 'r') as f:
script_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(script_dir, 'secret.pk'), 'r') as f:
pk = f.read().strip()
if pk:
logging.info("Private key loaded successfully from file.")