Skip to content

Commit

Permalink
Logger in the prover worked
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Sep 4, 2024
1 parent f168b3a commit 989ef6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/prover/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import subprocess
import os
import json
import logging

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -71,6 +72,9 @@ def gen_proof(circuit_name: str, nonce: str, is_local: bool):
str(is_local_int),
]
)
logger.info(f"Proof generation result: {result.returncode}")
if result.stderr is not None:
logger.error(result.stderr)
print(result.stdout)
print(result.stderr)

Expand Down
6 changes: 4 additions & 2 deletions packages/prover/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
from core import (
gen_email_auth_proof,
)
import logging

app = Flask(__name__)


@app.route("/prove/email_auth", methods=["POST"])
def prove_email_auth():
logger = logging.getLogger(__name__)
req = request.get_json()
logger.info(req)
input = req["input"]
print(input)
print(type(input))
# print(input)
# print(type(input))
nonce = random.randint(
0,
sys.maxsize,
Expand Down
2 changes: 1 addition & 1 deletion packages/prover/modal_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from google.cloud.logging_v2.handlers import setup_logging
from google.oauth2 import service_account


app = modal.App("email-auth-prover-v1.0.4")

image = modal.Image.from_dockerfile("Dockerfile")
Expand All @@ -17,6 +16,7 @@
modal.Mount.from_local_python_packages("core"),
],
cpu=14,
secrets=[modal.Secret.from_name("gc-ether-email-auth-prover")],
)
@modal.wsgi_app()
def flask_app():
Expand Down

0 comments on commit 989ef6a

Please sign in to comment.