create account

2nd HAF Projects Development Report for 2022 by imwatsi

View this thread on: hive.blogpeakd.comecency.com
· @imwatsi · (edited)
$483.07
2nd HAF Projects Development Report for 2022
![2nd.png](https://files.peakd.com/file/peakd-hive/imwatsi/23r26LESTnkESeKvB3bqeJKAvLXsyERM1jPw41fBMcnzUWL7J3AcYP5Wd5Mh3P5j6EKTt.png)

Thanks and appreciation to everyone who supported my DHF proposal to fund the work I am doing. It is now funded. I hope to provide value to Hive through the work I’m doing and see more features availed to the community through it.

In this report, I provide updates on the state of the two HAF projects I am currently working on: [Plug & Play](https://github.com/imwatsi/haf-plug-play) and [Global Notification System (GNS)](https://github.com/imwatsi/hive-gns).

**TL;DR is at the end of this post**

---

<center>
![plug_play_icon.png](https://files.peakd.com/file/peakd-hive/imwatsi/23tRvMmoWWKbQtY167RwxUPefAs3AEYSryhG1mHnseYG5kd8CFMXtxCsjGH4p57XiHVun.png)
</center>

## Plug & Play

A Version 2 of Plug & Play is under way to:

- expand its capabilities beyond just `custom_json` operations to all HAF-supported operations
- introduce a lot more customisation features
- increase modularity

**Current pull request:** https://github.com/imwatsi/haf-plug-play/pull/20/files#

*Note: the code is not suitable to run yet, as I am testing individual SQL functions on pgAdmin and updating them, before tying it all together. The server is also unavailable at the moment due to the instability caused by the issues detailed below, to avoid taking away development time by fixing the old version. (HAF replays, server holdups, etc)*

#### PostgreSQL for core HAF tasks

I am moving code that handled the synchronisation of plugs from Python to PostgreSQL. This will take away most of the sync related logic from Python, leaving it to handle setup and new DB initialisation and use APIs for data retrieval.

This will improve stability, which was being affected repeatedly when an error occurred, necessitating a replay (taking upwards of 8 hours).

Other issues were encountered during an initial massive sync, where a problem with connection would mean having to re-sync all Plug & Play operations from the beginning.

When I moved most of the sync logic to PostgreSQL, the problems above were confirmed to be solved during tests.

#### Modular plugs

I am making the plugs independent of each other by making them have their own HAF contexts, essentially making them separate “apps” in HAF terms. This means the individual plugs will maintain their own contexts and sync independently of each other. This contains errors within individual plugs and prevents them from cascading to the rest of the system.

#### Plug definitions

I introduced the concept of “plug definitions” (adopted from my work on GNS) to make it possible to add properties to plugs that determine the following and more:
- `start_block`: the block height at which the plug should start processing its data
- `ops`: the operation types and associated SQL function names to be used as triggers the plug

#### Support for more operation types

To expand on the concept of Plug & Play as a turnkey tool to extract, process and create APIs for specific types of data from the Hive blockchain, I am changing how plugs interact with operations to allow for more flexibility. The definitions mentioned in the section above help with that.

#### Documentation

With all these changes, the documentation is being updated to include:
- The latest installation methods of HAF and Plug & Play
- Setting up the plugs and defining them
- Writing the SQL files associated with the plugs

#### ETA

I expect to get a production deployment ready within a few days, barring unforeseen challenges.

---

<center>
![gns_icon.png](https://files.peakd.com/file/peakd-hive/imwatsi/23xAeH4ui2zg25VwFBeg1AeN4Hfb91DexTsvzLYsmduSCuSYnCP1wmndxkLirovZ7Gfch.png)
</center>


## Global Notification System (GNS)

**Current pull request:** https://github.com/imwatsi/hive-gns/pull/12/files#

*Note: this code is also not suitable for deployment yet and the server is unstable for use at this point in time.*

When I initially developed the GNS MVP, focus was on proof-of-concept and some aspects of the system were not suited for the scale and scope that is now planned.

I have been working on some core changes to how GNS works to make it scale and be able to support a wide range of Hive operations without complicating the implementation or making it hard to maintain or upgrade.

#### Preloading of historical account preferences

Since GNS only keeps an active dataset of 30 days to populate its notification database, when a new node is setup or when an existing one is reset, it will not have access to account preferences broadcasted before the 30-day window.

To rectify this, I developed a preload function that processes `gns` operations that were broadcasted since the first public release, to populate "account preferences" state, when none is found in the database.

#### Operation filtering

I am currently working to add filtering support to all HAF operations, which improves how much you can customise notifications. For example, when fully implemented, the following will be possible:

- `custom_json_operation` filtering by the JSON’s contents (key-value pairs for JSON object payloads; index-value pairs for array payloads)
- `transfer_operation` filtering by specifying matching rules (complete phrases or partial matches) in memo field

#### Modular operation processing

I am creating groups of separate SQL functions to handle the various HAF operations available, instead of the somewhat singular approach currently implemented. This enables the system to scale with the addition of new notifications.

It also makes it easier to make system-wide changes to how specific Hive operations are handled without breaking other parts. In effect, there will be individual `.sql` files for each HAF operation type, with functions that define how to process that operation.

#### More notification types

Work on this will be delayed a bit, since my current work on the above aspects blocks the development of additional notification types until it’s done.

#### ETA

I expect to finish up the core changes within a week, after which the focus will shift to expanding the notifications available on GNS.

---

## TL;DR

**Plug & Play:**
- New Version 2 in progress
- Support for more Hive operations, not just `custom_json`
- A more PostgreSQL-heavy implementation for core HAF tasks and use Python mostly for data retrieval and API access
- Increased modularity, to make the codebase more manageable and accessible to developers

**Global Notification System (GNS):**
- Operation-level filtering to allow developers to create fine-grained notification features
- Increased modularity, to prepare GNS for scale
- Preloading of historical account preferences for new node setups
- More notifications will be added after work on the above is complete

---

**Thanks for reading. Feel free to leave feedback.**

---

![Witness (1).png](https://files.peakd.com/file/peakd-hive/imwatsi/23tRvege9CWD6DYHPNkfdCMTMZW2FEqi6Z893fSHJjq2MrAwvXpZNEiu8Z2fDDpsqs9B6.png)

To support my witness node:

-   Witness name: `imwatsi`
    
-   [HiveSigner](https://hivesigner.com/sign/account-witness-vote?witness=imwatsi&approve=1)
    
-   [Peakd Witnesses](https://peakd.com/me/witnesses)
    
-   https://wallet.hive.blog/~witnesses
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 374 others
👎  , , , , , , , ,
properties (23)
authorimwatsi
permlink2nd-haf-projects-development-report-for-2022
categoryhive-139531
json_metadata{"app":"peakd/2022.05.9","format":"markdown","tags":["haf","plug-play","gns","development","hive"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/imwatsi/23r26LESTnkESeKvB3bqeJKAvLXsyERM1jPw41fBMcnzUWL7J3AcYP5Wd5Mh3P5j6EKTt.png","https://files.peakd.com/file/peakd-hive/imwatsi/23tRvMmoWWKbQtY167RwxUPefAs3AEYSryhG1mHnseYG5kd8CFMXtxCsjGH4p57XiHVun.png","https://files.peakd.com/file/peakd-hive/imwatsi/23xAeH4ui2zg25VwFBeg1AeN4Hfb91DexTsvzLYsmduSCuSYnCP1wmndxkLirovZ7Gfch.png","https://files.peakd.com/file/peakd-hive/imwatsi/23tRvege9CWD6DYHPNkfdCMTMZW2FEqi6Z893fSHJjq2MrAwvXpZNEiu8Z2fDDpsqs9B6.png"]}
created2022-06-10 13:40:24
last_update2022-06-11 11:24:33
depth0
children10
last_payout2022-06-17 13:40:24
cashout_time1969-12-31 23:59:59
total_payout_value241.566 HBD
curator_payout_value241.501 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7,307
author_reputation131,386,362,730,495
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,940,644
net_rshares1,028,169,517,171,946
author_curate_reward""
vote details (447)
@daje10 ·
This sounds very exciting, I hope we will be able to see these in action soon =)
properties (22)
authordaje10
permlinkreyzwq
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-13 17:48:51
last_update2022-07-13 17:48:51
depth1
children1
last_payout2022-07-20 17:48:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length80
author_reputation56,245,213,654,917
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id114,826,438
net_rshares0
@imwatsi ·
Working as fast as I can :)
👍  
properties (23)
authorimwatsi
permlinkre-daje10-rfdvdx
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.07.1"}
created2022-07-21 18:30:00
last_update2022-07-21 18:30:00
depth2
children0
last_payout2022-07-28 18:30:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation131,386,362,730,495
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,054,063
net_rshares2,023,770,825
author_curate_reward""
vote details (1)
@gangstalking ·
They literally have attempted my murder and are trying to kill me with V2K and RNM. Five years this has been happening to me, it started here, around people that are still here. Homeland security has done nothing at all, they are not here to protect us. Dont we pay them to stop shit like this? The NSA, CIA, FBI, Police and our Government has done nothing. Just like they did with the Havana Syndrome, nothing. Patriot Act my ass. The American government is completely incompetent. The NSA should be taken over by the military and contained Immediately for investigation. I bet we can get to the sources of V2K and RNM then. https://ecency.com/fyrstikken/@fairandbalanced/i-am-the-only-motherfucker-on-the-internet-pointing-to-a-direct-source-for-voice-to-skull-electronic-terrorism ..... https://ecency.com/gangstalking/@acousticpulses/electronic-terrorism-and-gaslighting--if-you-downvote-this-post-you-are-part-of-the-problem if you run into one of them you may want to immediately shoot them in the face. 187, annihilate, asphyxiate, assassinate, behead, bleed, bludgeon, boil, bomb, bone, burn, bury, butcher, cap, casket, choke, chop, club, crucify, crush, curb, decapitate, decimate, deflesh, demolish, destroy, devein, disembowel, dismember, drown, electrocute, eliminate, end, euthanize, eviscerate, execute, explode, exterminate, extinguish, finish, fry, grind, guillotine, gut, hack, hang, hit, ice, implode, incinerate, kill, liquidate, lynch, massacre, maul, microwave, mutilate, neutralize, obliterate, off, pop, poison, punnish, quarter, ruin, shank, shock, shoot, shred, skin, slay, slaughter, smoke, smother, snipe, snuff, squish, stab, strangle, stone, suffocate, suicide, SWAT, swing, terminate, torture, terrorize, whack, waste, wreck. You better fucking kill me.
👎  
properties (23)
authorgangstalking
permlinkre-imwatsi-rdecim
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.05.9"}
created2022-06-13 03:32:45
last_update2022-06-13 03:32:45
depth1
children0
last_payout2022-06-20 03:32:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,784
author_reputation-67,597,107,868,724
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id114,010,574
net_rshares-6,975,683,181
author_curate_reward""
vote details (1)
@hivebuzz ·
Congratulations @imwatsi! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

<table><tr><td><img src="https://images.hive.blog/60x60/http://hivebuzz.me/badges/toppayoutday.png"></td><td>Post with the highest payout of the day.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@imwatsi) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-calendar"><img src="https://images.hive.blog/64x128/https://i.imgur.com/5lTSuY9.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-calendar">Hive Power Month - New Tracking Calendar</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202205-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202205-delegations">Our Hive Power Delegations to the May Power Up Month Winners</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-imwatsi-20220611t012815
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-06-11 01:28:15
last_update2022-06-11 01:28:15
depth1
children0
last_payout2022-06-18 01:28:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,159
author_reputation369,442,862,991,840
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,956,233
net_rshares0
@hivebuzz ·
Congratulations @imwatsi! You received a personal badge!

<table><tr><td>https://images.hive.blog/70x70/http://hivebuzz.me/badges/pud.png?202207010555</td><td>You powered-up at least 10 HIVE on Hive Power Up Day!<br>Wait until the end of Power Up Day to find out the size of your Power-Bee.<br>May the Hive Power be with you!
</td></tr></table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@imwatsi) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>


**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202207"><img src="https://images.hive.blog/64x128/https://i.imgur.com/M9RD8KS.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202207">The 7th edition of the Hive Power Up Month starts today!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202207"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202207">Hive Power Up Day - July 1st 2022</a></td></tr><tr><td><a href="/nftforpeace/@hivebuzz/nft-for-peace-update1"><img src="https://images.hive.blog/64x128/https://i.imgur.com/tBCp4ps.png"></a></td><td><a href="/nftforpeace/@hivebuzz/nft-for-peace-update1">NFT for peace - Thank you for your continuous support</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-imwatsi-20220701t060924
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-07-01 06:09:24
last_update2022-07-01 06:09:24
depth1
children0
last_payout2022-07-08 06:09:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,327
author_reputation369,442,862,991,840
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id114,471,864
net_rshares0
@hivebuzz ·
Congratulations @imwatsi! You received a personal badge!

<table><tr><td>https://images.hive.blog/70x70/http://hivebuzz.me/badges/pud.s1.png?202207020001</td><td>You powered-up at least 10 HIVE on Hive Power Up Day! This entitles you to a level 1 badge.<br>Participate in the next Power Up Day and try to power-up more HIVE to get a bigger Power-Bee.<br>May the Hive Power be with you!</td></tr></table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@imwatsi) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>


**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202207"><img src="https://images.hive.blog/64x128/https://i.imgur.com/M9RD8KS.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202207">The 7th edition of the Hive Power Up Month starts today!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202207"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202207">Hive Power Up Day - July 1st 2022</a></td></tr><tr><td><a href="/nftforpeace/@hivebuzz/nft-for-peace-update1"><img src="https://images.hive.blog/64x128/https://i.imgur.com/tBCp4ps.png"></a></td><td><a href="/nftforpeace/@hivebuzz/nft-for-peace-update1">NFT for peace - Thank you for your continuous support</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-imwatsi-20220702t001931
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-07-02 00:19:30
last_update2022-07-02 00:19:30
depth1
children0
last_payout2022-07-09 00:19:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,385
author_reputation369,442,862,991,840
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id114,494,085
net_rshares0
@russia-btc ·
It's not fucking clear - but it's very interesting!


![orig (2).gif](UPLOAD FAILED)
👍  
properties (23)
authorrussia-btc
permlinkrd9tcr
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-06-10 16:48:33
last_update2022-06-10 16:48:33
depth1
children0
last_payout2022-06-17 16:48:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length84
author_reputation57,707,590,160,430
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,945,109
net_rshares0
author_curate_reward""
vote details (1)
@tobetada ·
$0.13
thank you for all the work!
👍  , ,
properties (23)
authortobetada
permlinkre-imwatsi-rdauil
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.05.9"}
created2022-06-11 06:11:09
last_update2022-06-11 06:11:09
depth1
children1
last_payout2022-06-18 06:11:09
cashout_time1969-12-31 23:59:59
total_payout_value0.066 HBD
curator_payout_value0.066 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation598,320,588,106,999
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,960,325
net_rshares288,216,415,352
author_curate_reward""
vote details (3)
@imwatsi ·
Thanks for your support!
properties (22)
authorimwatsi
permlinkre-tobetada-rdcjbz
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.05.9"}
created2022-06-12 04:04:57
last_update2022-06-12 04:04:57
depth2
children0
last_payout2022-06-19 04:04:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length24
author_reputation131,386,362,730,495
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,984,930
net_rshares0
@urun ·
![untitled.gif](https://media.tenor.com/images/597f7d01c377d41fcfe4a4356b4b8f73/tenor.gif)
properties (22)
authorurun
permlinkre-imwatsi-rda21g
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.05.9"}
created2022-06-10 19:56:03
last_update2022-06-10 19:56:03
depth1
children0
last_payout2022-06-17 19:56:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation94,125,949,460,949
root_title"2nd HAF Projects Development Report for 2022"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,949,412
net_rshares0