Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the interfaces for all the functions in Facilitator #5

Closed
11 tasks
deepesh-kn opened this issue May 29, 2019 · 1 comment · Fixed by #64
Closed
11 tasks

Define the interfaces for all the functions in Facilitator #5

deepesh-kn opened this issue May 29, 2019 · 1 comment · Fixed by #64
Milestone

Comments

@deepesh-kn
Copy link
Contributor

deepesh-kn commented May 29, 2019

Worker facilitates the stake and mint process.

  • It reads the stake requested data from the database.
  • It gets the worker address for the database for each chain.
  • It unlocks the worker address account.
  • It updates the database with the current status of facilitation.
    For more details check the epic Facilitator  #1

This ticket is about defining the interfaces of all the functions in the Worker.

The proposed functions are provided for reference.
The implementer can think this in detail and can add/remove functions.

  • Constructor
    - Accepts mosaic-config, facilitator-config as parameter.
    • Accepts Config object. (store in variable).
    • Creates DB object. (store in variable). (Still in discussion)
  • function to start the worker.
- [ ] **function to get pending items from `stake_request` table. (Create the ticket for this.) - [ ] **function that handles the state machine** (Create a new ticket for this.) - [ ] **function to get the message status from messageOutbox of the gateway.** - [ ] **function to get the message status from messageInbox of the cogateway.** - [ ] **function to get the latest `stateRoot` from the anchor contract (auxiliary chain).**
  • function to update DB with the latest state of facilitation. (Task execution table) (Update the ticket).
    - REQUESTED

    • ACCEPTED
    • ACCOUNT_PROVEN
    • STAKE_INTENT_COMFIRMED
    • PROGRESS_STAKE
    • PROGRESS_MINT
    • COMPLETE
  • function to update DB with hashlock and unlockSecret.
    - [ ] function to update DB with proof data.

- [ ] **function to unlock worker address.** - Get the encrypted_account from Config for the given address. - Read the password from the env variable. - Decrypt the account. - Add it to web3 account wallet. The accounts will be unlocked at the commander level and will update the web3 wallet.
  • function to create hashLock and unlockSecret.

    • Generate hashlock and unlockSecret pair
  • function to approve bounty amount.

  • function to accept stake request.

  • function to generate account proof.

  • function to confirm stake intent.

  • function to progress stake.

  • function to progress mint.

- [ ] **function to stop the worker (handle SIGTERM).** (update the ticket.)
@deepesh-kn
Copy link
Contributor Author

Please note that Worker will be called as Facilitator

@deepesh-kn deepesh-kn changed the title Define the interfaces for all the functions in Worker Define the interfaces for all the functions in Facilitator Jun 6, 2019
@deepesh-kn deepesh-kn added this to the sprint 2 milestone Jun 7, 2019
@abhayks1 abhayks1 self-assigned this Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants