feat: ctrc+C to stop listening. & move print
This commit is contained in:
parent
8e9f6b47cf
commit
6093742092
@ -94,16 +94,18 @@ class NodeManager():
|
|||||||
print(f"\nWe will register this cluster({self.GPU} * {gpu_num})...")
|
print(f"\nWe will register this cluster({self.GPU} * {gpu_num})...")
|
||||||
receipt = self.scheduler.register_cluster(self.wallet, gpu_id, gpu_num)
|
receipt = self.scheduler.register_cluster(self.wallet, gpu_id, gpu_num)
|
||||||
event = self.scheduler.get_cluster_event(receipt)
|
event = self.scheduler.get_cluster_event(receipt)
|
||||||
print(f"\nOK. this is our cluster event on the blockchain {event[0]['args']}")
|
print("\nOK. this is our cluster event on the blockchain")
|
||||||
|
print(f" {event[0]['args']}")
|
||||||
for cluster in self.scheduler.get_clusters():
|
|
||||||
print(cluster)
|
|
||||||
|
|
||||||
# start waiting
|
# start waiting
|
||||||
print("\nWaiting for the new task from Sepolia testnet...")
|
|
||||||
self.cluster_communication_module.start_listen_task()
|
self.cluster_communication_module.start_listen_task()
|
||||||
next_task = self.scheduler.listen_task(self.wallet.address)
|
print("\nWaiting for the new task from Sepolia testnet...")
|
||||||
print(next_task)
|
print("Ctrl+C to stop the waiting...")
|
||||||
|
try:
|
||||||
|
next_task = self.scheduler.listen_task(self.wallet.address)
|
||||||
|
print(next_task)
|
||||||
|
except:
|
||||||
|
print("[STOP] stop the waiting")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("[ERROR] Connected Failed.")
|
print("[ERROR] Connected Failed.")
|
||||||
|
|||||||
@ -6,7 +6,6 @@ class Scheduler():
|
|||||||
self.w3 = w3
|
self.w3 = w3
|
||||||
abi = load_abi(abi_file)
|
abi = load_abi(abi_file)
|
||||||
self.contract = self.w3.eth.contract(address=address, abi=abi)
|
self.contract = self.w3.eth.contract(address=address, abi=abi)
|
||||||
print(self.contract.functions)
|
|
||||||
|
|
||||||
def signed_and_send_transaction(self, account, function):
|
def signed_and_send_transaction(self, account, function):
|
||||||
tx = function.build_transaction({
|
tx = function.build_transaction({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user