HAF Plug & Play Development - Week 17, 2022

in HiveDevs2 years ago

hive-plug-and-play-new.png

Update on Hive Plug & Play’s development for Week 17 of 2022.

Stability fixes

There was an issue with both the development and production servers, where they would both crash at around the same time after a week or two of operation, due to a PostgreSQL related bug. After debugging and feedback from @blocktrades, I implemented two approaches which are now being monitored on different servers:

  • DEFERRED constraints on fields that reference the HAF registered tables (without inheriting all tables)

  • registered all tables that have dynamic data, with DEFERRED constraints too

I’m monitoring both approaches closely to see which one works out.

Maintenance patches

I released two main patches:

  1. Use of a schema named hpp for all Plug & Play tables, indexes and functions. It was using the global schema previously. This approach allows for easy rollbacks and resets, while providing a more organized data structure.

  2. Health checks: the main system status endpoint now returns a health key with either GOOD or BAD based on the sync status of the main HAF process as well as the individual plugs.

Podping upgrade

@brianoflondon and I implemented a limit parameter to Podping’s historical data endpoint on Plug & Play.

Poll deletion upgrades

Since adding the ability to delete a poll on Plug & Play, I added rules to handle deletion of polls. The rules for deletion are:

  • poll must be a valid one on Plug & Play

  • poll must be active, as in not reached its expiration date

I’m considering adding another rule, to allow deletion for polls only during their first few hours of creation or before votes are cast. Still deliberating on the way forward.

What’s next?

Hive Engine support for NFTs

@stoodkev and I have been talking about adding Hive Engine NFT data to Plug & Play. This would provide balances and transaction history endpoints globally. This initiative is still in pre-alpha stage, so expect to hear more about it in the coming updates.

FastAPI routing

Work is underway to implement a route-based structure in the FastAPI code. This will allow modularity of plug endpoints and make maintenance and upgrades easier.

Automation scripts

I’m working on a number of automation scripts to aid people who intend to run and maintain HAF Plug & Play servers. These include:

  • Install and setup bash scripts

  • Restart bash scripts (to safely reload the Plug & Play service)

  • Reset bash script (to reset Plug & Play data and restart the service, without removing all core HAF data from PostgreSQL)

Updated documentation

As HAF is being developed, changes are being made to upstream setup and installation processes. My documentation still reflects some steps that have either been deprecated or changed when setting up a HAF server. Work to update the documentation is planned, in line with the automated scripts being developed.

Thanks for reading!


witness.png

I run a Hive witness node: