pk check and logging at startup

This commit is contained in:
Dobromir Popov 2024-10-08 00:40:50 +03:00
parent fd08223b89
commit d5812fed03

View File

@ -40,6 +40,10 @@ from typing import List, Dict, Any, Tuple
load_dotenv() load_dotenv()
# Load secret environment variables # Load secret environment variables
load_dotenv('.env.secret') load_dotenv('.env.secret')
pk = os.getenv("PK")
if not pk
logging.error("Private key not found in environment variables. Will not be able to sign transactions.")
app = Flask(__name__) app = Flask(__name__)
@ -604,7 +608,7 @@ async def list_initial_wallet_states():
logging.info(message) logging.info(message)
await send_telegram_message(message) await send_telegram_message(message)
async def get_transaction_details_with_retry(transaction_id, retry_delay = 11, max_retries = 11): async def get_transaction_details_with_retry(transaction_id, retry_delay = 10, max_retries = 10):
# wait for the transaction to be confirmed # wait for the transaction to be confirmed
# await async_client.wait_for_confirmation(Signature.from_string(transaction_id)) # await async_client.wait_for_confirmation(Signature.from_string(transaction_id))
# qwery every 5 seconds for the transaction details untill not None or 30 seconds # qwery every 5 seconds for the transaction details untill not None or 30 seconds