Skip to content

Commit

Permalink
Merge pull request #98 from wonkr/ethereum-pos
Browse files Browse the repository at this point in the history
Ethereum pos
  • Loading branch information
wonkr authored Oct 31, 2022
2 parents c903595 + b1cadb6 commit 2a0578e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions seedemu/services/EthereumService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 2a0578e

Please sign in to comment.