Using the FlureeWorker library, a browser service worker can create a local query peer within the browser, making trusted data readily available.
Messages are used communicate between the FlureeWorker and the originating application. Message data to/from the FlureeWorker are expected in the following format:
|the action to be performed (e.g., |
|the connection ID|
|the reference ID to include in the response|
|parameters for the action|
Messages to FlureeWorker
The following messages, or events, are recognized by FlureeWorker.
|Connect||Initiate a connection with a Fluree instance|
|Close Connection||Close a connection to a Fluree instance|
|Log into Fluree Ledger||Authenticate with ledger via username and password|
|Reqister Query||Register a FlureeQL with a connection|
|Reset Connection||Reset a connection to a Fluree instance|
|Unregister Query||De-register/remove a FlureeQL from a connection|
Messages from FlureeWorker
The following messages, or events, may be received from the FlureeWorker.
|Worker Initialized||Worker ready. FlureeWorker service worker is initialized and available for connections|
|Connection Closed||Result of |
|Connection Status||Result of |
|Login||Result of |
|Set State||State has changed for a reference, generally triggered by one or more |
|Connection Reset||Result of |