diff --git a/seedemu/services/EthereumService.py b/seedemu/services/EthereumService.py index 2eec9f4b1..b3050b629 100644 --- a/seedemu/services/EthereumService.py +++ b/seedemu/services/EthereumService.py @@ -1255,9 +1255,30 @@ def getValidatorIds(self) -> List[str]: def getBeaconSetupNodeIp(self) -> str: return self.__beacon_setup_node_address + def setDisplayName(self, node:Node, server: EthereumServer): + displayName = 'Ethereum-{consensus}-{id}{role}' + if node.getDisplayName() != None: + return + else: + consensus = server.getConsensusMechanism().name + id = server.getId() + role = "" + if server.isStartMiner(): + if consensus == "POW": + role += "-Miner" + else: + role += "-Signer" + if server.isBootNode(): + role += "-BootNode" + node.setDisplayName(displayName.format(consensus=consensus, id=id, role=role)) + + + def _doConfigure(self, node: Node, server: EthereumServer): self._log('configuring as{}/{} as an eth node...'.format(node.getAsn(), node.getName())) + self.setDisplayName(node, server) + ifaces = node.getInterfaces() assert len(ifaces) > 0, 'EthereumService::_doConfigure(): node as{}/{} has not interfaces'.format() addr = '{}:{}'.format(str(ifaces[0].getAddress()), server.getBootNodeHttpPort())