How Many Blocks and Total Rewards for a Steem Witness in the Pas

  • 时间:2020-10-11 15:25:20
  • 分类:网络文摘
  • 阅读:150 次

The blockchain is a public database, this shouldn’t be hard to find out. In this post we know how to call the Steem API to find out the witness that procduce each block and the reward (in VESTS) he/she collects for generating the block (mining).

Let’s create a database in SQLite – with the schema:

sqlite> .schema
CREATE TABLE witnessblocks (
witness text,
number integer,
vests real,
time text,
block integer,
constraint pkey primary key (block)
);
CREATE INDEX index_block on witnessblocks(block);
CREATE INDEX index_witness on witnessblocks(witness);
CREATE INDEX index_time on witnessblocks(time);
CREATE INDEX index_vests on witnessblocks(vests);
CREATE INDEX index_number on witnessblocks(number);

Then, we can run a SQL to find out the number of blocks and total rewards for each witness. Results are sorted by total rewards in SP (which can be computed by simply roughly divided by 1943 SP) – see this number at: steemyy.com

Query:

select witness, count(1), sum(vests/1943.761) as total 
from witnessblocks 
where time >= date('now', '-24 hour') 
group by witness 
order by total desc 
limit 30;

Result (a bit surprising, more than expected, different than what the steemworld says @steemchiller): I double check the data and everything seems correct. My understanding is that a lot of misses are re-scheduled and that is why the TOP witnesses get more turns to produce blocks.

justyy|2326|578.82025257632
steemchiller|2324|578.325146664636
hinomaru-jp|2324|578.322147174472
hivei0|2323|578.073978002953
scissor.sisters|2322|577.826185736312
dlike|2321|577.5771644482
steem-supporter|2320|577.328037061142
inwi|2319|577.082116292075
beargame|2319|577.079035895361
smt-wherein|2318|576.832034089068
steem-dragon|2318|576.831055014993
roundblocknew|2318|576.828982039459
rnt1|2317|576.583037687762
hoasen|2317|576.582024700568
symbionts|2317|576.578049543128
steem-agora|2316|576.338157853255
maiyude|2316|576.336006269803
future.witness|2313|575.584969334193
protoss20|2309|574.593023568226
dev.supporters|2305|573.596812309745
matreshka|193|240.560583586665
parse|192|239.309574386974
cryptoking777|191|238.066390513031
menacamel|191|238.066344493484
juddsmith079|190|236.823358969544
enjoylondon|190|236.815291552305
rlawlstn123|187|233.082098971016
leverfile|186|231.834906382009
upeross|185|230.587764003393
roadofrich|30|37.3927565415707

Once this data is verified, I’ll add it to the witness ranking table.

Update: There is a mistake in the SQL: I should have used `datetime(‘now’, ‘-24 hour’)` instead of `date(‘now’, ‘-24 hour’)`. The datetime returns date and time while the date only returns the date string part in SQLite – so when used, it is actually the same as “YYYY-MM-DD 00:00:00” which makes the timespan more than 24 hours.

–EOF (The Ultimate Computing & Technology Blog) —

推荐阅读:
为什么企业网站不要用模板建站 模板建站有哪些弊端  网站安全渗透测试难度系数有多大  什么内容才是被百度肯定的优质内容?优质内容应该这样做!  seo-网站权重怎么提高?  万词霸屏与SEO优化合二为一才能给企业带来真实效益  熟知百度蜘蛛原理,按照优化规则才能做好seo优化  SEO关键词排名优化原理是什么?  织梦程序如何调用自定义字段?  旅途遇见美  不再遗失的美好 
评论列表
添加评论