Exemplo n.º 1
0
    def stopChain(self):

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

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

        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:
                time.sleep(10)
                self.change_value_did_run_chain.emit(False)
                print("Zincir Çalışmıyor")
                break
        print("THREAD BİTTİ")
Exemplo n.º 2
0
    def refreshInfo(self):

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

        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("-------")

        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]
        self.change_value_information_get_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)
Exemplo n.º 3
0
    def details(self):

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

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

        self.change_value_information.emit(out_)
Exemplo n.º 4
0
    def refreshRequest(self):

        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

        print(self.command_mcl_credit_request_list)
        stdout = ssh.command(self.command_mcl_credit_request_list)
        lines = stdout.readlines()
        out_ = ""

        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]

        print(out_)

        self.change_value_information.emit(out_)
Exemplo n.º 5
0
    def accept(self):

        print("Sunucya bağlanmak için bilgiler alindi.")

        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

        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 = []

        print("=========")
        print(len(y))
        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.5)
            except:
                self.change_value_information_wallet.emit("0")
                print("stopped chain")
                break
        print("NOOOOLLDUUUU")
        self.change_value_information_wallet.emit("0")
Exemplo n.º 6
0
    def sendCoin(self):

        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

        print(self.command_mcl_send_coin)
        stdout = ssh.command(self.command_mcl_send_coin)
        lines = stdout.readlines()
        out_ = ""

        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]

        print(out_)
        out_ = out_.strip()

        self.change_value_information_txid.emit(out_)
Exemplo n.º 7
0
    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_)
Exemplo n.º 8
0
    def unlockCoin(self):

        print("Sunucya bağlanmak için bilgiler alindi.")

        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

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

        print("Get Info Bitti")
        print("-------")
        print(out_)

        out_ = out_.strip()

        try:
            y = json.loads(out_)
            tmp = y["result"]
            self.change_value_information_get_unlock.emit(False)

        except:
            # Hex Onay
            # ---------------------------------------------------------------

            print(self.command_mcl_unlock_coin_sendrawtransaction + "\"" +
                  out_ + "\"")
            stdout = ssh.command(
                self.command_mcl_unlock_coin_sendrawtransaction + "\"" + out_ +
                "\"")

            lines = stdout.readlines()
            out_ = ""
            for deger in lines:
                deger = deger.split("\n")
                out_ = out_ + " " + deger[0]
            print(out_)
            self.change_value_information_get_transactionID.emit(out_)
            self.change_value_information_get_unlock.emit(True)
Exemplo n.º 9
0
    def lockCoin(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_lock_coin)
        stdout = ssh.command(self.command_mcl_lock_coin)
        print("Get Info")
        lines = stdout.readlines()
        out_ = ""
        for deger in lines:
            deger = deger.split("\n")
            out_ = out_ + " " + deger[0]

        print("Get Info Bitti")
        print("-------")

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

        if y["result"] == "success":

            # ---------------------------------------------------------------
            # Hex Onay

            print(self.command_mcl_lock_coin_sendrawtransaction + "\"" +
                  y["hex"] + "\"")
            stdout = ssh.command(
                self.command_mcl_lock_coin_sendrawtransaction + "\"" +
                y["hex"] + "\"")

            lines = stdout.readlines()
            out_ = ""
            for deger in lines:
                deger = deger.split("\n")
                out_ = out_ + " " + deger[0]
            print(out_)
            self.change_value_information_get_transactionID.emit(out_)
            self.change_value_information_get_lock.emit(True)
        else:
            self.change_value_information_get_lock.emit(False)
Exemplo n.º 10
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_)
Exemplo n.º 11
0
    def accept(self):

        print("Sunucya bağlanmak için bilgiler alindi.")

        ssh = ServerConnect(self.server_hostname, self.server_username,
                            self.server_password)

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

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

        print(y["result"])

        # Hex Onay
        # ---------------------------------------------------------------
        if y["result"] == "success":
            print(y["hex"])
            print(y["requesttxid"])
            print(y["receiverpk"])

            print(self.command_mcl_credit_request_sendrawtransaction + "\"" +
                  y["hex"] + "\"")
            stdout = ssh.command(
                self.command_mcl_credit_request_sendrawtransaction + "\"" +
                y["hex"] + "\"")

            lines = stdout.readlines()
            out_ = ""
            for deger in lines:
                deger = deger.split("\n")
                out_ = out_ + " " + deger[0]
            print(out_)
            self.change_value_information_get_transactionID.emit(out_)
            self.change_value_information_accept.emit(True)
        else:
            self.change_value_information_accept.emit(False)
Exemplo n.º 12
0
    def importPrivkey(self):

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

        #----------------------------------------------
        #Import Privkey and Get Wallet Address
        print(self.command_mcl_import_privkey)
        stdout = ssh.command(self.command_mcl_import_privkey)
        print("^^^^^^^^")
        print(stdout)
        lines = stdout.readlines()
        print(lines)
        if 0 == len(lines):
            self.change_value_information_get_wallet.emit("")
            self.change_value_information_get_pubkey.emit("")
        else:
            out_ = ""
            for deger in lines:
                deger = deger.split("\n")
                out_ = out_ + " " + deger[0]

            self.change_value_information_get_wallet.emit(out_)

            #----------------------------------------------
            #Get Pubkey
            print(self.command_mcl_get_pubkey + " " + out_)
            stdout = ssh.command(self.command_mcl_get_pubkey + " " + out_)
            print("^^^^^^^")
            print(stdout)
            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"])
            self.change_value_information_get_pubkey.emit(
                wallet_info["pubkey"])
Exemplo n.º 13
0
    def startChain(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 + self.pubkey)
        stdout = ssh.command(self.command_mcl_start_chain + self.pubkey)

        print("Başlangıç Çıktı")
        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:
                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İ")
Exemplo n.º 14
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.self.command_mcl_start_chain_without_pubkey)

            print("Başlangıç Çıktı")
            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_)

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

        convertpassphrase_out = json.loads(out_)

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

        self.change_value_information_adress.emit(
            convertpassphrase_out["address"])
        self.change_value_information_pubkey.emit(
            convertpassphrase_out["pubkey"])
        self.change_value_information_privkey.emit(
            convertpassphrase_out["wif"])
        print("THREAD BİTTİ")
Exemplo n.º 15
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İ")
Exemplo n.º 16
0
    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)
        stdout = ssh.command(self.command_mcl_start_chain_without_pubkey)

        print("Başlangıç Çıktı")
        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.")
                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İ")