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

Add token commands to CLI #5550

Merged
merged 5 commits into from
Aug 10, 2020
Merged

Add token commands to CLI #5550

merged 5 commits into from
Aug 10, 2020

Conversation

mrmr1993
Copy link
Member

@mrmr1993 mrmr1993 commented Aug 3, 2020

This PR exposes the tokens commands from the CLI. (I thought we had already done this, but when I went to write up docs it seems we hadn't..)

This adds 3 commands:

  • coda.exe client create-token
    • This creates a new token, which allocates a new token ID and adds a new account to the ledger for the (token, public_key) pair
      • The fee for creating the new account is charged in addition to the transaction fee.
    • This account then owns the token, and can mint more of the token.
    • This account will also (eventually) have the power to enable/disable accounts, and to set whether new accounts may be created.
    • The corresponding GraphQL API endpoint is createToken
  • coda.exe client create-token-account
    • This creates a new account for an existing token.
      • Token accounts are never implicitly created by other commands: this must always be used to pay for a new account for non-default tokens. In particular, an account must be explicitly created before a public key may receive non-default tokens as part of a transaction
      • The fee for creating this account is charged in addition to the transaction fee.
    • The GraphQL API requires the token owner to be passed explicitly. If the token owner is not given on the CLI, a GraphQL query is sent to find the token owner. If no owner is found, the command fails with an error.
    • The corresponding GraphQL API endpoint is createTokenAccount
  • coda.exe client mint-tokens
    • This 'mints' new tokens, increasing the supply of a particular token.
      • This is how all non-default tokens are created; there are no other protocol events or commands that can create non-default tokens.
      • This command may only be issued by the token owner, but the tokens may be minted in any existing account for that token.
    • The corresponding GraphQL API endpoint is mintTokens

This also exposes a token flag on the send-payment command, which allows non-default tokens to be transferred.

Checklist:

  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them:

@mrmr1993 mrmr1993 requested review from a team as code owners August 3, 2020 17:40
@mrmr1993 mrmr1993 added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Aug 3, 2020
@netlify
Copy link

netlify bot commented Aug 7, 2020

Preview:

Built with commit d2a9185

https://deploy-preview-5550--o1website2.netlify.app

@bkase bkase force-pushed the feature/tokens-cli branch from 4100485 to 5783bf1 Compare August 7, 2020 20:43
Copy link
Member

@nholland94 nholland94 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit d57e35a into develop Aug 10, 2020
@mergify mergify bot deleted the feature/tokens-cli branch August 10, 2020 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge-into-develop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants