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

feat: add worker.create and worker.get_peer_id #1475

Merged
merged 6 commits into from
Feb 21, 2023
Merged

Conversation

justprosh
Copy link
Member

  • scope.get_peer_id is removed
  • worker.create accepts optional deal_id argument
    • if deal_id is omitted, init_peer_id is used to generate worker
  • spell.install execution on host peer id implicitly call worker.create without deal_id arg
  • worker.create returns error if worker for deal_id exists
  • worker.get_peer_id accepts optional deal_id argument, return worker_id or throws an error

New worker flow for deals:

worker_id <- Worker.create(deal_id)
on worker_id:
     Spell.install(....)
     Spell.remove(...)
     Spell.update_trigger_config
     ...

let is_worker_creator = init_peer_id == worker_creator;
let is_worker = init_peer_id == worker_id;

if !is_spell_owner && !is_worker_creator && !is_worker {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the manager of the peer be able to remove the spell?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right

justprosh and others added 2 commits February 21, 2023 15:00
Co-authored-by: Maria Kuklina <101095419+kmd-fl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants