def refreshInfo(self):

        print("Sunucya bağlanmak için bilgiler alindi.")
        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

        # ---------------------------------------------------------------
        # Get Marmara
        print(self.command_mcl_get_marmara_info + self.pubkey)
        stdout = ssh.command(self.command_mcl_get_marmara_info + self.pubkey)
        print("Marmara Info")
        lines = stdout.readlines()
        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]
        print(out_)
        self.change_value_information_get_marmara_info.emit(out_)
示例#2
0
    def getPrivateKey(self):

        print("Sunucya bağlanmak için bilgiler alindi.")
        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)
        print("bağlantı tamam.")

        # ---------------------------------------------------------------
        # Get Privkey
        command_getprivkey = self.command_mcl_get_privkey
        print(self.command_mcl_get_privkey)
        stdout = ssh.command(self.command_mcl_get_privkey)
        lines = stdout.readlines()
        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]
        print(out_)
        self.change_value_information_privkey.emit(out_)
    def startChain(self):

        print(
            "---------------------------------------------------------------")
        print("Sunucya bağlanmak için bilgiler alindi.")
        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)
        print("bağlantı tamam.")

        print(self.command_mcl_start_chain + self.pubkey)
        std_out = ssh.command(self.command_mcl_start_chain + self.pubkey)

        while True:
            print(self.command_mcl_get_info)
            stdout = ssh.command(self.command_mcl_get_info)
            lines = stdout.readlines()
            print("Get Info")
            print(lines)
            print("Get Info Bitti")
            print("-------")

            if not lines:
                self.change_value_did_run_chain.emit(False)
                print("Zincir Çalışmıyor")
                time.sleep(1)
            else:

                self.is_chain_run = True
                print("Zincir çalışıyor.")
                # --------------------------------------------------
                #Get info
                out_ = ""
                for deger in lines:
                    deger = deger.split("\n")
                    out_ = out_ + " " + deger[0]
                self.change_value_information_get_info.emit(out_)

                # ---------------------------------------------------------------
                #Get Marmara
                print(self.command_mcl_get_marmara_info + self.pubkey)
                stdout = ssh.command(self.command_mcl_get_marmara_info +
                                     self.pubkey)
                print("Marmara Info")
                lines = stdout.readlines()
                out_ = ""
                for deger in lines:
                    deger = deger.split("\n")
                    out_ = out_ + " " + deger[0]

                self.change_value_information_get_marmara_info.emit(out_)

                # ---------------------------------------------------------------
                # Get Generate
                print(self.command_mcl_get_stacking_and_mining)
                stdout = ssh.command(self.command_mcl_get_stacking_and_mining)
                lines = stdout.readlines()
                out_ = ""
                for deger in lines:
                    deger = deger.split("\n")
                    out_ = out_ + " " + deger[0]

                self.change_value_information_get_generate.emit(out_)
                self.change_value_did_run_chain.emit(True)
                break

        print("THREAD BİTTİ")
示例#4
0
    def startChainForCreatingWallet(self):

        print("Sunucya bağlanmak için bilgiler alindi.")
        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)
        print("bağlantı tamam.")

        print(self.command_mcl_get_info)
        stdout = ssh.command(self.command_mcl_get_info)
        lines = stdout.readlines()
        print("Get Info")
        print(lines)
        print("Get Info Bitti")
        print("-------")

        if not lines:
            print("Zincir Çalışmıyor")
            time.sleep(1)

            print(self.command_mcl_start_chain_without_pubkey)
            stdout = ssh.command(self.command_mcl_start_chain_without_pubkey)
            print(stdout)

            while True:
                print(self.command_mcl_get_info)
                stdout = ssh.command(self.command_mcl_get_info)
                lines = stdout.readlines()
                print("Get Info")
                print(lines)
                print("Get Info Bitti")
                print("-------")

                if not lines:
                    print("Zincir Çalışmıyor")
                    time.sleep(1)
                else:
                    print("Zincir çalışıyor.")
                    # --------------------------------------------------
                    # Get New Adress
                    out_ = ""
                    for deger in lines:
                        deger = deger.split("\n")
                        out_ = out_ + " " + deger[0]
                    break
        else:
            out_ = ""
            for deger in lines:
                deger = deger.split("\n")
                out_ = out_ + " " + deger[0]

        self.change_value_information_getinfo_check_chain_with_pubkey.emit(
            out_)

        # ---------------------------------------------------------------
        # Get Adress
        print(self.command_mcl_create_wallet_adress)
        stdout = ssh.command(self.command_mcl_create_wallet_adress)
        lines = stdout.readlines()
        adress_ = ""
        for deger in lines:
            deger = deger.split("\n")
            adress_ = adress_ + " " + deger[0]
        self.change_value_information_adress.emit(adress_)

        # ---------------------------------------------------------------
        # Get Privkey
        command_getprivkey = self.command_mcl_get_privkey + adress_
        print(self.command_mcl_get_privkey + adress_)
        stdout = ssh.command(self.command_mcl_get_privkey + adress_)
        lines = stdout.readlines()
        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]
        print(out_)
        self.change_value_information_privkey.emit(out_)

        # ---------------------------------------------------------------
        # Get Pubkey
        print(self.command_mcl_get_pubkey + " " + adress_)
        stdout = ssh.command(self.command_mcl_get_pubkey + " " + adress_)
        lines = stdout.readlines()
        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]

        y = json.loads(out_)
        print(y["pubkey"])

        self.change_value_information_pubkey.emit(y["pubkey"])
        print("THREAD BİTTİ")
    def startChainWithoutPubkey(self):

        print("Sunucya bağlanmak için bilgiler alindi.")
        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)
        print("bağlantı tamam.")
        print(self.command_mcl_start_chain_without_pubkey)
        __ = ssh.command(self.command_mcl_start_chain_without_pubkey)

        while True:
            print(self.command_mcl_get_info)
            stdout = ssh.command(self.command_mcl_get_info)
            lines = stdout.readlines()
            print("Get Info")
            print(lines)
            print("Get Info Bitti")
            print("-------")

            if not lines:
                print("Zincir Çalışmıyor")
                time.sleep(1)
            else:
                print("Zincir çalışıyor.")
                out_ = ""
                for deger in lines:
                    deger = deger.split("\n")
                    out_ = out_ + " " + deger[0]

                self.change_value_information_getinfo_check_chain_with_pubkey.emit(
                    out_)

                # ---------------------------------------------------------------
                print(self.command_mcl_all_wallet_list)
                stdout = ssh.command(self.command_mcl_all_wallet_list)
                lines = stdout.readlines()
                out_ = ""
                for deger in lines:
                    deger = deger.split("\n")
                    out_ = out_ + " " + deger[0]

                print(out_)
                y = json.loads(out_)

                wallets = []

                for w in y:
                    try:
                        print(w)
                        wallets.append(w)
                        stdout = ssh.command(self.command_mcl_get_pubkey + w)
                        lines = stdout.readlines()
                        out_ = ""
                        for deger in lines:
                            deger = deger.split("\n")
                            out_ = out_ + " " + deger[0]

                        wallet_info = json.loads(out_)
                        print(wallet_info["pubkey"])
                        wallet_and_pubkey = w + "," + wallet_info["pubkey"]
                        self.change_value_information_wallet.emit(
                            wallet_and_pubkey)
                        print("----------")
                        time.sleep(0.3)
                    except:
                        self.change_value_information_wallet.emit("0")
                        print("stopped chain")
                        break
                self.change_value_information_wallet.emit("0")
                break
        print("THREAD BİTTİ")