DMS integration with WebApp and Management Dashboard
Description
Click to expand
Who
- @sntshk -- developer
- @janaina.senna @dagiopia -- advisors and reviewers
What
-
Implement new calls on DMS so the WebApp and the Management Dashboard can request data and inform results of blockchain interactions.
-
Create these functionalities on DMS so the WebApp can use them (the numbers are related to the calls on the Entity diagram detailed here):
-
- Request data to fund the NuNet's smart contract
-
- Return blockchain info so the WebApp can interact with the blockchain via wallet (to fund the contract)
-
- Inform the status of the blockchain interaction, i.e. inform if the funding was successfully done)
-
-
Create these functionalities on DMS so the Management Dashboard can use them (the numbers are related to the calls onn the Entity diagram detailed here):
-
- Request data to withdraw from NuNet's smart contract
-
- Return blockchain info so the WebApp can interact with the blockchain via wallet (to withdraw from the contract)
-
- Inform the status of blockchain interaction, i.e. inform if the withdraw was successfully done)
-
-
Since these functionalities are similar to WebApp and Management Dashboard, we can use the same calls just passing different parameters.
How
Implement these calls to the DMS using websocket (DMS is the server). Follows the description of each call:
-
request service
- inputs: service provider user address, max tokens amount, type of blockchain (cardano or ethereum)
- outputs: compute provider user address, estimated price, signature, oracle message
-
request reward
- inputs: none
- outputs: signature, oracle message, reward type (withdraw, refund, distribute)
-
send status (blockchain transaction)
- inputs: transaction type (fund, withdraw, refund, distribute), status of transaction (success, error)
- outputs: none
The functionalities below are implemented in the DMS and they will be used to send parameters to the Oracle as defined here:
- choose the compute that will run the service (ML job), using parameters informed by the user on the WebApp, and obtain the compute provider user address;
- calculate the price and time also using the user's input on WebApp;
- if the price fits the max tokens amount, call the FundingRequest on Oracle's gRPC (without any parameters).
Why
- We need to implement the sequence diagram for running a ML on a GPU and compensate the computer provider described here.
When
- @sntshk @dagiopia @kikokhaledu We need to discuss about the protocol that we will be using for these calls considering that (1) WebApp is interacting with DMS using websocket and (2) DMS is also using REST API to export functionalities.
Acceptance Criteria
Click to expand
- Merge request
- Code review by @dagiopia
- Demo to the dev team
Work Breakdown Structure (WBS)
Task | Description | Duration | Status | Start Date | End Date | Comment |
---|---|---|---|---|---|---|
A | Gather information | 8 Hrs | Done | 23rd Feb | 24rd Feb | |
B | Add endpoint to claim reward | 2-4 Hrs | Done | 28th Feb | 28th Feb | Will send dummy response for now. This endpoint has to talk to oracle. See #123 (closed). Unit test will be defined after oracle is integrated |
C | Send data to oracle on request service side | 8 Hrs | Done | 28th Feb | 6th Mar | Will be a stub until oracle is functional |
D | Send status | 8 Hrs | Done | 7th Mar | 9th Mar | We might not need a send status endpoint |