def _add_node(self, nodetype, nodename, epoch):
        nodetype = int(nodetype)
        if self.debug: self.logger.write("State", "Adding node: %s %s" % (node_names[nodetype],
                                                                          nodename))
        ipaddr,port = nodename.split(":")
        nodepeer = Peer(ipaddr,int(port),nodetype)
        self.replicas[nodepeer] = 0

        # update the revision if nameserver
        if self.isnameserver:
            self.nameserver.update()

        # if leader, increment epoch in the ballotnumber
        temp = (self.ballotnumber[BALLOTEPOCH]+1,
                self.ballotnumber[BALLOTNO],
                self.ballotnumber[BALLOTNODE])
        if self.debug: self.logger.write("State:", "Incremented EPOCH: %s" % str(temp))
        self.ballotnumber = temp

        # check leadership state
        if self.stateuptodate:
            chosenleader = self.find_leader()
            if chosenleader == self.me and not self.isleader:
                # become the leader
                if not self.stateuptodate:
                    self.leader_initializing = True
                self.become_leader()
            elif chosenleader != self.me and self.isleader:
                # unbecome the leader
                self.unbecome_leader()
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica._add_node/original