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

CLI - ensure it's scriptable #1591

Open
2 tasks
Lezek123 opened this issue Oct 26, 2020 · 3 comments
Open
2 tasks

CLI - ensure it's scriptable #1591

Lezek123 opened this issue Oct 26, 2020 · 3 comments
Assignees
Labels
estimate-12h Time estimation for issues in a project - 12h

Comments

@Lezek123
Copy link
Contributor

Lezek123 commented Oct 26, 2020

Based on #1571 and #1586

  • Allow providing input as flags/args/json where this is not yet implemented (some commands only provide interactive interface)
  • Give user the ability to choose between more human-readable output (ie. a table) and output that can be redirected to a file / other commands (ie. raw json, created entity id etc.). Some OCLIF funcionality can probably help facilitate this (ie. --no-color flag can be used to strip any custom colors from the output, cli.table can be converted to csv by passing an additional option etc.)
@Lezek123 Lezek123 added the estimate-12h Time estimation for issues in a project - 12h label Oct 26, 2020
@Lezek123 Lezek123 self-assigned this Oct 26, 2020
@traumschule
Copy link
Collaborator

account:choose was removed in 0334bd3. I assume a merge error or was this intentional?

./cli/bin/run account:choose
 ›   Warning: account:choose is not a joystream-cli command.
Did you mean account:create? [y/n]: n

@joystream/cli/0.6.0 linux-x64 node-v14.16.1
giza_staging

@Lezek123
Copy link
Contributor Author

This was intentional, since from now on the CLI will try to infer the key based on permissions required to send the associated extrinsic and potentially some additional context provided by the user (ie. memberId, workerId etc.). There will be no need to manually choose a specific key before executing a command.

For example:
api.tx.someWorkingGroup.leaveRole extrinsic sent by working-groups:leaveRole command needs to be signed with worker's role key. Based on that and optionally provided workerId (in case multiple worker role keys have been imported) the CLI can infer which key should be used for signing this extrinsic.

@traumschule
Copy link
Collaborator

Great news!

# cli/bin/run working-groups:startReviewPeriod 2 -g operationsAlpha                                                                  
Current Group: operationsAlpha

Sending operationsWorkingGroupAlpha.beginApplicantReview extrinsic from jsmoon...
Tx params: [ 2 ]
? Tx fee of 0 will be deduced from you account, do you confirm the transfer? Yes
Extrinsic successful!
Opening 2 status changed to: In Review

~/joystream# cli/bin/run working-groups:fillOpening 2 -g operationsAlpha
Current Group: operationsAlpha
 Select succesful applicants  3: freakstatic,  4: giza1
 Do you want to provide the optional RewardPolicy parameter? Yes
  Providing values for RewardPolicy struct:
    Provide value for amount_per_payout 10000000
    Provide value for next_payment_at_block 22000
    Do you want to provide the optional payout_interval parameter? Yes
      Provide value for u32 600

Sending operationsWorkingGroupAlpha.fillOpening extrinsic from jsmoon...
Tx params: [
  2,
  [ '3', '4' ],
  {
    amount_per_payout: '10,000,000',
    next_payment_at_block: '22,000',
    payout_interval: '600'
  }
]
? Tx fee of 0 will be deduced from you account, do you confirm the transfer? Yes
Extrinsic successful!
Opening 2 successfully filled!
Accepted working group application IDs: 3, 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate-12h Time estimation for issues in a project - 12h
Projects
None yet
Development

No branches or pull requests

2 participants