示例#1
0
 def get_miner_key(self):
     try:
         self.miner_key = wallet.f_import_private(_program_dir +
                                                  "/minerkey",
                                                  net=self.net)
     except Exception as e:
         print(f"Import miner key error [{e}]")
示例#2
0
 def do_import(self, file_path):
     if self.key_pair != 0:
         print("Already there is key pair, if continue it would be deleted. Continue ? (n/y):")
         if input() == "n": 
             return False
     file_path= file_path.strip()
     try:
         self.key_pair = wallet.f_import_private(file_path, net=self.net)
         with open(_program_dir + "/address", 'a') as f:
             f.write(f"{self.key_pair.get_address()}\n")
     except Exception as error:
         print(error)
         return False
     print(f"Private key(WIF): {wallet.to_WIF(self.key_pair.get_secret_key().hex())}")        
     print(f"Address         : {self.key_pair.get_address()}")
示例#3
0
 def get_miner_key(self):
     self.miner_key = wallet.f_import_private(
         os.path.abspath(".") + "/minerkey")