Esempio n. 1
0
    def supply(cls):
        supply = 0
        data = utils.make_request('getblockchaininfo')
        height = data['result']['blocks']
        for height in range(0, height + 1):
            supply += utils.reward(height)

        return {'supply': supply, 'mining': supply, 'height': height}
Esempio n. 2
0
    def _calc_supply(cls, height):
        snapshot = 443863973624633
        supply = 0

        for height in range(0, height + 1):
            supply += utils.reward(height)

        return {
            "supply": snapshot + supply,
            "mining": supply,
            "height": height
        }
Esempio n. 3
0
    def info(cls):
        data = utils.make_request('getblockchaininfo')

        if data['error'] is None:
            data['result']['reward'] = utils.reward(data['result']['blocks'])
            data['result']['debug'] = config.debug
            data['result'].pop('verificationprogress')
            data['result'].pop('initialblockdownload')
            data['result'].pop('pruned')
            data['result'].pop('softforks')
            data['result'].pop('bip9_softforks')
            data['result'].pop('warnings')
            data['result'].pop('size_on_disk')

        return data
Esempio n. 4
0
    def info(cls):
        data = utils.make_request("getblockchaininfo")

        if data["error"] is None:
            data["result"]["supply"] = utils.supply(data["result"]["blocks"])["supply"]
            data["result"]["reward"] = utils.reward(data["result"]["blocks"])
            data["result"].pop("verificationprogress")
            data["result"].pop("pruned")
            data["result"].pop("softforks")
            data["result"].pop("bip9_softforks")
            data["result"].pop("warnings")
            data["result"].pop("size_on_disk")

            nethash = utils.make_request("getnetworkhashps", [120, data["result"]["blocks"]])
            if nethash["error"] is None:
                data["result"]["nethash"] = int(nethash["result"])

        return data
Esempio n. 5
0
    def info(cls):
        data = utils.make_request('getblockchaininfo')

        if data['error'] is None:
            data['result']['supply'] = utils.supply(
                data['result']['blocks'])['supply']
            data['result']['reward'] = utils.reward(data['result']['blocks'])
            data['result'].pop('verificationprogress')
            data['result'].pop('initialblockdownload')
            data['result'].pop('pruned')
            data['result'].pop('softforks')
            data['result'].pop('bip9_softforks')
            data['result'].pop('warnings')
            data['result'].pop('size_on_disk')

            nethash = utils.make_request('getnetworkhashps',
                                         [120, data['result']['blocks']])
            if nethash['error'] is None:
                data['result']['nethash'] = int(nethash['result'])

        return data