Verify blocktivity numbers for Hive and Blurt

in HiveDevs3 years ago (edited)

@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:

HiveSteemBlurt
Blocks287562846628634
Duration128.855117.7128016.021
Blocks/s223.17241.833.57
Trx8839291958926942
Ops8948562009687461
Ratio of Trx to Bitcion Trx0.980.2210.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

Sort:  

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

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.

There is an ARM version of blurtd being worked on, but it’s not in use yet. I believe most nodes are being run on VPS. They are using 4-core VPS with 16 MB RAM for the full nodes if I’m not mistaken.

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

image.png
This tells almost everything.

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

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

@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~


Congratulations, @theguruasia You Successfully Trended The Post Shared By @holger80.
You Utilized 2/3 Daily Summon Bot Calls.

TAN Current Market Price : 1.940 HIVE

Thanks for looking into this @holger80

I was also curious how Blurt was so highly ranked.


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