diff --git a/src/blockchain_lab/blockchain_lab.py b/src/blockchain_lab/blockchain_lab.py index 967b85b..ee5c82c 100644 --- a/src/blockchain_lab/blockchain_lab.py +++ b/src/blockchain_lab/blockchain_lab.py @@ -29,7 +29,9 @@ def create_docker(self): os.system( "git clone https://github.com/Decentra-Network/Decentra-Network") - os.system("docker build -t ghcr.io/decentra-network/api:latest -f Decentra-Network/docker/local/api/Dockerfile .") + os.system( + "docker build -t ghcr.io/decentra-network/api:latest -f Decentra-Network/docker/local/api/Dockerfile ." + ) os.system( f"python3 Decentra-Network/auto_builders/docker.py -nn {self.node_number} -scn {self.security_circle_number} -i -r -s" ) @@ -82,10 +84,12 @@ def status(self): the_message += str(requests.get("http://localhost:8000/status").text) print(str(requests.get("http://localhost:8000/status").text)) for i in range(self.node_number - 1): - the_message += "- " +str(requests.get(f"http://localhost:{8100 + i + 1}/status").text) - print("- " + - str(requests.get(f"http://localhost:{8100 + i + 1}/status").text)) + the_message += "- " + str( + requests.get(f"http://localhost:{8100 + i + 1}/status").text) + print("- " + str( + requests.get(f"http://localhost:{8100 + i + 1}/status").text)) return the_message + @staticmethod def send_transaction(receiver, amount, data): requests.post( @@ -96,10 +100,9 @@ def send_transaction(receiver, amount, data): "data": data, "password": "123" }, - ) + ) time.sleep(55) - result = requests.get( - "http://localhost:8000/transactions/all").text + result = requests.get("http://localhost:8000/transactions/all").text print("Result of the transaction: ") print(result) @@ -281,7 +284,6 @@ def blockchain_lab_status(): nodenumber = args.nodenumber - blockchain_lab(node_number=nodenumber).status()