Exemple #1
0
	def ppcoind(self, argv):

		get = sh.ppcoind("getinfo", _ok_code=[0,3,5,87]).stdout
		pos_diff = sh.ppcoind("getdifficulty", _ok_code=[0,3,5,87]).stdout
		pid = sh.sudo("pidof", "ppcoind").stdout.strip()

		try:
			getinfo = json.loads(get)
			pos = json.loads(pos_diff)['proof-of-stake']
			getinfo["difficulty proof-of-stake"] = pos

		except:
			if pid != None:
				return("ppcoind is running but not ready")
			else:
				return("ppcoind inactive")

		## When posting in public, hide IP and balance.
		if argv == "private":
			del getinfo['balance']
			del getinfo['ip']
			return(getinfo)

		else:
			return(getinfo)
Exemple #2
0
    def ppcoind(self, argv):

        get = sh.ppcoind("getinfo", _ok_code=[0, 3, 5, 87]).stdout
        pos_diff = sh.ppcoind("getdifficulty", _ok_code=[0, 3, 5, 87]).stdout
        pid = sh.sudo("pidof", "ppcoind").stdout.strip()

        try:
            getinfo = json.loads(get)
            pos = json.loads(pos_diff)['proof-of-stake']
            getinfo["difficulty proof-of-stake"] = pos

        except:
            if pid != None:
                return ("ppcoind is running but not ready")
            else:
                return ("ppcoind inactive")

        ## When posting in public, hide IP and balance.
        if argv == "private":
            del getinfo['balance']
            del getinfo['ip']
            return (getinfo)

        else:
            return (getinfo)
Exemple #3
0
def unlock_wallet():

	print
	print(fore.RED + style.BOLD + "WARNING! It is still not recommended to mint coins on Peerbox." + style.RESET)
	print(style.UNDERLINED + "This tool is here mearly to enable faster testing." + style.RESET)
	print

	password = raw_input("Enter wallet password: "******"walletpassphrase", password, "999999999", "true")
	except:
		print("Something went wrong")
Exemple #4
0
	def local(self):
		
		local = {}
		local["heightInt"] = int(sh.ppcoind("getblockcount", _ok_code=[0,3,5,87]).stdout)

		local["hash"] = sh.ppcoind("getblockhash", local["heightInt"],
												_ok_code=[0,3,5,87]).stdout.strip()

		block_info = json.loads(sh.ppcoind("getblock", local["hash"],
												_ok_code=[0,3,5,87]).stdout)

		local["prevHash"] = block_info["previousblockhash"]
		local["mrkRoot"] = block_info["merkleroot"]

		return local
Exemple #5
0
def unlock_wallet():

    print
    print(fore.RED + style.BOLD +
          "WARNING! It is still not recommended to mint coins on Peerbox." +
          style.RESET)
    print(style.UNDERLINED +
          "This tool is here mearly to enable faster testing." + style.RESET)
    print

    password = raw_input("Enter wallet password: "******"walletpassphrase", password, "999999999", "true")
    except:
        print("Something went wrong")
Exemple #6
0
    def local(self):

        local = {}
        local["heightInt"] = int(
            sh.ppcoind("getblockcount", _ok_code=[0, 3, 5, 87]).stdout)

        local["hash"] = sh.ppcoind("getblockhash",
                                   local["heightInt"],
                                   _ok_code=[0, 3, 5, 87]).stdout.strip()

        block_info = json.loads(
            sh.ppcoind("getblock", local["hash"], _ok_code=[0, 3, 5,
                                                            87]).stdout)

        local["prevHash"] = block_info["previousblockhash"]
        local["mrkRoot"] = block_info["merkleroot"]

        return local
Exemple #7
0
	def ppcoind(self, argv):

		get = sh.ppcoind("getinfo", _ok_code=[0,3,5,87]).stdout
		pos_diff = sh.ppcoind("getdifficulty", _ok_code=[0,3,5,87]).stdout

		try:
			getinfo = json.loads(get)
			pos = json.loads(pos_diff)['proof-of-stake']
			getinfo["difficulty proof-of-stake"] = pos
		except:
			return("ppcoind inactive")

		## When posting in public, hide IP and balance.
		if argv == "private":
			del getinfo['balance']
			del getinfo['ip']
			return(getinfo)

		else:
			return(getinfo)