test: temp change

This commit is contained in:
sangge 2023-10-23 22:21:15 +08:00
parent 5fd39d3c20
commit 2277cd577d
3 changed files with 5 additions and 5 deletions

View File

@ -1,3 +1,3 @@
[settings]
server_address = 10.20.127.226:8000
server_address = 10.20.14.232:8000
version = 1.0

View File

@ -29,7 +29,7 @@ def init():
# load config from config file
init_config()
# get_node_list(6, server_address) # type: ignore
get_node_list(2, server_address) # type: ignore
def init_db():
@ -286,7 +286,7 @@ async def recieve_request(i_m: IP_Message):
if source_ip != i_m.dest_ip:
return HTTPException(status_code=400, detail="Wrong ip")
dest_ip = i_m.source_ip
threshold = random.randrange(1, 6)
threshold = random.randrange(1, 2)
own_public_key = pk
pk_B = i_m.pk
@ -352,4 +352,4 @@ local_ip = get_own_ip()
if __name__ == "__main__":
import uvicorn # pylint: disable=e0401
uvicorn.run("client:app", host="0.0.0.0", port=8003, reload=True)
uvicorn.run("client:app", host="0.0.0.0", port=8002, reload=True)

View File

@ -86,7 +86,7 @@ async def delete_node(ip: str) -> None:
print(f"Node with IP {ip} not found.")
# 接收节点心跳包
@app.post("/server/heartbeat")
@app.get("/server/heartbeat")
async def receive_heartbeat(ip: str):
cursor.execute("UPDATE nodes SET last_heartbeat = ? WHERE ip = ?", (time.time(), ip))
return {"status": "received"}