Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/blockchain_lab/blockchain_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -281,7 +284,6 @@ def blockchain_lab_status():

nodenumber = args.nodenumber


blockchain_lab(node_number=nodenumber).status()


Expand Down