Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Copy changes + more emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
avive committed Jul 14, 2019
1 parent 87460e8 commit b839dbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def released_tick(msg):
def print_layer_stats(layer):
l = str(layer - 1)
total_blocks = sum([len(node2blocks[x]["layers"][l]) for x in layer_miners[l]])
print(bcolors.HEADER + "layer %s ended, %s miners created %s blocks" % (layer - 1, len(layer_miners[l]), total_blocks) + bcolors.ENDC)
print(bcolors.HEADER + "Layer %s ended, %s miners created %s blocks" % (layer - 1, len(layer_miners[l]), total_blocks) + bcolors.ENDC)
if layer % layers_per_epoch == 0:
print(bcolors.OKBLUE + "an epoch has finished, atxs published in this epoch: %s" %
print(bcolors.OKBLUE + "An epoch has finished, atxs published in this epoch: %s" %
len(epoch_atxs[str(int(layer/layers_per_epoch) -1)]) + bcolors.ENDC)


Expand All @@ -68,16 +68,16 @@ def parse_transactions(msg):
# print(tx_id)
transactions[tx_id].append(m)
if len(transactions[tx_id]) == num_of_instances:
print(bcolors.OKGREEN + "confirmed tx: orig: %s dest: %s amount %s nonce: %s" % (m[0], m[1], m[2], m[3]) + bcolors.ENDC)
print(bcolors.OKGREEN + "Confirmed tx: orig: %s dest: %s amount %s nonce: %s" % (m[0], m[1], m[2], m[3]) + bcolors.ENDC)


def parse_transaction_recv(msg):
m = re.findall(r'(?<=\b:\s)(\w+)', msg["M"])
print(bcolors.OKYELLOW + "tx received by node, dst %s amount %s" % (m[0], m[2]) + bcolors.ENDC)
print(bcolors.OKYELLOW + "Tx received by node, dst %s amount %s" % (m[0], m[2]) + bcolors.ENDC)


def app_started(msg):
print(bcolors.OKGREEN + "App started in %s at %s" % (msg["T"], msg["container_name"]) + bcolors.ENDC)
print(bcolors.OKGREEN + "App started in %s at %s 🎉" % (msg["T"], msg["container_name"]) + bcolors.ENDC)


def parse_rewards(msg):
Expand All @@ -86,7 +86,7 @@ def parse_rewards(msg):
rewards[reward].append(m)
# print(m, " ", len(rewards[reward]))
if len(rewards[reward]) % num_of_instances == 0:
print(bcolors.OKGREEN + "applied reward for node %s, reward: %s " % (m[0], m[1]) + bcolors.ENDC)
print(bcolors.OKGREEN + "Applied reward for node %s, reward: %s Spacemesh Coins (SMC) 🏅" % (m[0], m[1]) + bcolors.ENDC)


def parse_reward(msg):
Expand All @@ -95,13 +95,13 @@ def parse_reward(msg):
rewards[reward].append(m)
# print(m, " ", len(rewards[reward]))
if len(rewards[reward]) % num_of_instances == 0:
print(bcolors.OKGREEN + "applied reward for nodes, total reward: %s " % (m[0]) + bcolors.ENDC)
print(bcolors.OKGREEN + "Applied reward for nodes, total reward: %s Spacemesh Coins (SMC)🏅" % (m[0]) + bcolors.ENDC)


def post_proof(msg):
m = re.findall(r'(?<=\b:\s)(\w+)', msg["M"])
id = re.split(r'\.', msg["N"])[0]
print(bcolors.ORANGE + "commitment finished for node: %s size: %s (bytes) 💾⏰💪" % (id, m[2]) + bcolors.ENDC)
print(bcolors.ORANGE + "Commitment finished for node: %s size: %s (bytes) 💾⏰💪" % (id, m[2]) + bcolors.ENDC)


# node added event
Expand Down
Empty file modified setup.sh
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def create_nodes(clients, boot_ip, bootID, poet_ip, network_name):
# client.networks.get(network_name).connect(node)
containers.append({"cont": node})
# idxes[node.name] = i
print(tools.bcolors.OKYELLOW + "client created " + node.name + " connect wallet to 127.0.0.1:" + str(baseport) + " to access this node" + tools.bcolors.ENDC)
print(tools.bcolors.OKYELLOW + "Client created " + node.name + " connect wallet to 127.0.0.1:" + str(baseport) + " to access this node" + tools.bcolors.ENDC)
baseport += 1
print("finished creating clients")
print("Finished creating clients")


def load_fluentd(network_name):
Expand Down Expand Up @@ -144,7 +144,7 @@ def runMultiple(func, afterfunc):
for res in as_completed(futures):
if afterfunc is not None:
if isinstance(afterfunc, list):
# a list of function
# a list of function
for f in afterfunc:
f(res.result())
elif callable(afterfunc):
Expand Down Expand Up @@ -228,7 +228,7 @@ def count(success):
print("Bootnode is at - " + bootstrap.name + ": " + bootIP + ":7513/" + bootID)

create_nodes(params.genesis_accounts, bootIP, bootID, POET_IP, NETWORK_NAME)
print("Spinned up " + str(netsize) + " more instances booting from bootnode")
print("Started " + str(netsize) + " more instances booting from bootnode")

tools.parse_logs(fluentd, queries.events)
except KeyboardInterrupt:
Expand Down

0 comments on commit b839dbd

Please sign in to comment.