factomd icon indicating copy to clipboard operation
factomd copied to clipboard

New Control Panel API

Open stackdump opened this issue 4 years ago • 4 comments

The existing control pane was removed in the Wax build.

It needs to be replaced w/ a new Admin Panel API

Eventually, we will adopt a javascript component library for Inc's Explorer so we will need to develop a POC for how this front end will work.

Steps:

  • Create a new Control panel API
    • Async: It should have a browser-side event feed component were the UI monitors events from factomd maybe making use of https://github.com/alexandrevicenzi/go-sse ?
    • Synchronous: It may have a REST or similar type of synchronous api ( maybe graphQL is suitable? ) to handle synchronous calls for info
  • Integrate w/ new 'internal' pubsub framework
    • to monitor changes from various parts of the system
    • should allow for Admin user to dynamically subscribe/unsubscribe from any publisher

TODO: will add more notes about PubSub

Existing PubSub components use events are defined here https://github.com/FactomProject/factomd/blob/FD-1259_control_panel_rewrite/modules/event/event.go

FD-1259_control_panel_rewrite is the branch to use as a starting place

stackdump avatar Dec 17 '19 22:12 stackdump

@Emyrk @factom-clay adding a note here

I think our understanding of how much is usable via pub/sub vs a synchronous query is evolving

we have a very simple/primitive directory to add hooks to query different objects in the new query architecture

Query module: https://github.com/FactomProject/factomd/blob/FD-1268_election_pubsub_integration/modules/query/query.go Registered in the Elections constructor https://github.com/FactomProject/factomd/blob/FD-1268_election_pubsub_integration/elections/elections.go#L62 used by diagnostic api : https://github.com/FactomProject/factomd/blob/FD-1268_election_pubsub_integration/wsapi/wsapiV2.go#L1582 (edited)

stackdump avatar Jan 09 '20 16:01 stackdump

Some usage of Pub/Sub from leader module WIP Subscribe: https://github.com/FactomProject/factomd/blob/FD-1259_control_panel_rewrite/modules/leader/thread.go#L72-L82

Publish: https://github.com/FactomProject/factomd/blob/FD-1259_control_panel_rewrite/modules/leader/thread.go#L53-L56

stackdump avatar Jan 09 '20 16:01 stackdump

Work-in progress from BIF was merged into wax.

Control panel in WAX build is still incomplete, but the framework in place shows how to make use of Server Send Events :1st_place_medal:

https://github.com/FactomProject/factomd/pull/974

stackdump avatar Mar 03 '20 22:03 stackdump

New control panel won't be in Wax, we are trying to reduce the scope of Wax to get it out.

PaulBernier avatar Aug 14 '20 01:08 PaulBernier