Skip to content

Commit

Permalink
Get the API Tezos account from the API
Browse files Browse the repository at this point in the history
  • Loading branch information
aguillon committed Mar 13, 2024
1 parent f7fdb39 commit 4c1b9b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
# Healthcheck
@router.get("/")
async def root():
return {"message": "Hello World"}
return {
"status": "healthy",
"tezos_address": tezos.public_address
}


# POST endpoints
Expand Down
1 change: 1 addition & 0 deletions src/tezos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
), "Could not read secret key"

admin_key = pytezos.pytezos.key.from_encoded_key(config.SECRET_KEY)
public_address = admin_key.public_key_hash()
ptz = pytezos.pytezos.using(config.TEZOS_RPC, admin_key)
log.info(f"API address is {ptz.key.public_key_hash()}")
constants = ptz.shell.block.context.constants()
Expand Down

0 comments on commit 4c1b9b1

Please sign in to comment.