scrobble.life
HiveDevs

Verify blocktivity numbers for Hive and Blurt

@therealwolf was wondering on twitter on the high activity numbers on blocktivity.info for blurt:

The stats can be seen here:

blocktivity on 20.12.2020

Lets validate them using beem. I added the script also to my beem github: blockactivity.py.

import sys
from datetime import datetime, timedelta
import argparse
from timeit import default_timer as timer
import logging
from beem.blockchain import Blockchain
from beem.block import Block
from beem import Hive, Blurt, Steem
from beem.utils import parse_time
from beem.nodelist import NodeList

log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)


def parse_args(args=None):
    d = 'Verify blocktivity by counting operations and trx for the last 24 hours.'
    parser = argparse.ArgumentParser(description=d)
    parser.add_argument('blockchain', type=str, nargs='?',
                        default=sys.stdin,
                        help='Blockchain (hive, blurt or steem)')
    return parser.parse_args(args)


def main(args=None):
    
    args = parse_args(args)
    blockchain = args.blockchain
    
    nodelist = NodeList()
    
    if blockchain == "hive" or blockchain is None:
        max_batch_size = 50
        threading = False
        thread_num = 16
        block_debug = 1000
        nodes = nodelist.get_hive_nodes()
        blk_inst = Hive(node=nodes, num_retries=3, num_retries_call=3, timeout=30)
    elif blockchain == "blurt":
        max_batch_size = None
        threading = False
        thread_num = 8
        block_debug = 20
        nodes = ["https://api.blurt.blog", "https://rpc.blurtworld.com", "https://rpc.blurtworld.com"]
        blk_inst = Blurt(node=nodes, num_retries=3, num_retries_call=3, timeout=30)
    elif blockchain == "steem":
        max_batch_size = 50
        threading = False
        thread_num = 16
        block_debug = 1000
        nodes = nodelist.get_steem_nodes()
        blk_inst = Steem(node=nodes, num_retries=3, num_retries_call=3, timeout=30)
    else:
        raise Exception("Wrong parameter, can be hive, blurt or steem")
    print(blk_inst)
    block_count = 0
    total_ops = 0
    total_trx = 0
    blocksperday = 20 * 60 * 24
    
    blockchain = Blockchain(blockchain_instance=blk_inst)
    last_block_id = blockchain.get_current_block_num() - blocksperday

    last_block = Block(last_block_id, blockchain_instance=blk_inst)

    stopTime = last_block.time() + timedelta(seconds=60 * 60 * 24)

    start = timer()
    for entry in blockchain.blocks(start=last_block_id, max_batch_size=max_batch_size, threading=threading, thread_num=thread_num):
        block_count += 1
        if "block" in entry:
            trxs = entry["block"]["transactions"]
        else:
            trxs = entry["transactions"]
        for tx in trxs:
            total_trx += 1
            for op in tx["operations"]:
                total_ops += 1
        if "block" in entry:
            block_time = parse_time(entry["block"]["timestamp"])
        else:
            block_time = entry["timestamp"]
        ops_per_day = total_ops / block_count * blocksperday
        if block_count % (block_debug) == 0:
            print("%d blocks remaining... estimated ops per day: %.1f" % (blocksperday - block_count, ops_per_day))
        if block_time > stopTime:
            break
    duration = timer() - start
    print("Received %.2f blocks/s." % (block_count / duration))
    print("Bocks: %d, duration %.3f s" % (block_count, duration))
    print("Operations per day: %d" % total_ops)
    print("Trx per day: %d" % total_trx)

if __name__ == '__main__':
    sys.exit(main())

Just save the script as blocktivity.py and call it with the blockchain name (can be hive, steem or blurt).

Checking the blockchain activity

I started the script in three terminals to check the activity on hive, steem and blurt:

python3 blocktivity.py hive
python3 blocktivity.py steem
python3 blocktivity.py blurt

Results

The following table shows the obtained:

Hive Steem Blurt
Blocks 28756 28466 28634
Duration 128.855 117.712 8016.021
Blocks/s 223.17 241.83 3.57
Trx 883929 195892 6942
Ops 894856 200968 7461
Ratio of Trx to Bitcion Trx 0.98 0.221 0.008

Hive

It seems that the activity shown at https://blocktivity.info/ counted every operation twice or it sums up the activity for 48 hours.

The block count reaches 99.84% of the maximum block count 28800.

Steem

The block count reaches 98.84% of the maximum block count 28800.

Blurt

The speed for receiving blocks from the API is really slow, it took 62 times longer as on hive.

The shown activity numbers are completely wrong. 549405 operations are reached in around 74 days and not in 24 hours.

The block count reaches 99.42% of the maximum block count 28800.

It seems that the bug was already found and will be fixed soon:

___

If you like what I do, consider casting a vote for me as witness on Hivesigner or on PeakD

Comments · 9

  • @tan.app(45)· 2075d

    Congratulations @holger80, You Earned 1.175 TAN & Curators Made 0.822 TAN.

    tangent.token

    Join CORE / VAULT Token Discord Channel or Trade TANGENT Token TAN Current Market Price : 2.540 HIVE

  • @solominer(82)· 2076d

    Thanks for looking into this @holger80

    I was also curious how Blurt was so highly ranked.

  • @theguruasia(69)· 2078d

    @holger80, You nicely found it! Yeah I don't think Blurt will reach that numbers in near future. For me it's a chain, but it seems like something that all forgotten due to their fashion. $tangent

    Cheers~

  • @marki99(62)· 2078d

    So there's also a bug for hive, we are getting twice as much transactions on there.

  • @ackza(74)· 2078d

    tell @blocktivity they talk to @dapperd and @hellotelos blocktivity also dropped telos and had issues fo eth but got them both back, all was just technical brealkdowns lol lots of neew data feds

    we ned fuckin chainlinky oracle stinkies for ACTIVITY feeds like the price feedahs

    yeeeeeeeeeeeeeeeeeeeeet

  • @marc5(55)· 2079d

    image.png This tells almost everything.

  • @themarkymark(81)· 2079d

    The speed for receiving blocks from the API is really slow, it took 62 times longer as on hive.

    In the Hivefest presentation they said they run nodes on Raspberry Pi’s.

    Wasn’t sure if he meant it is possible or that they do.

    Also the fact their trending page is filled with posts that have 1-10 votes I couldn't imagine they had a lot of activity.

  • @ausbitbank(74)· 2079d

    Thanks for investigating this, I saw therealwolfs tweet and couldn't believe those numbers were accurate. All is well with the world again :)

  • @co2admin(30)· 2079d

    Upvoted to thank you @holger80 for supporting the CO2Fund by, e.g., supporting posts, banner presentation, SP/HP delegation, dustsweeper gifts, helpful tools, etc.