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

channel_config module API modifications #278

Open
4 tasks
alxiong opened this issue Jun 8, 2020 · 1 comment
Open
4 tasks

channel_config module API modifications #278

alxiong opened this issue Jun 8, 2020 · 1 comment

Comments

@alxiong
Copy link
Contributor

alxiong commented Jun 8, 2020

This issue contains several discussions over the current channel_config API

  • the logic of checking a channel already exists should be included in the create channel_config task -- leaving this to be manually specified by users are slightly troublesome and prone to errors.
    So the return value might require changes:
    path shouldn't be returned since it is required as an input parameter;
    exist: bool could be added as the return of create action

  • AFAIU, create contains both "creating a new channel" AND "updating an existing channel". If so, maybe this should be noted in the documentation, as the task is being named as "creating a new channel config"

  • fetch operation should be of a separate module called channel_config_info which follows the commonly shared pattern of other modules (certificate_authority and certificate_authority_info etc.)
    The primary reason for this separation is cleaner, consistent API, since fetch would return a channel_config object whereas create, update, sign and update might at most returns a status bit.

  • in the doc, *-policy.json is used whereas in tutorial/08-*.yml, *.json.j2 is used. Might be great to document down the various format supported and give example of commonly used policies including m-out-of-n channel update policy, operator, writer, reader permission etc.

To summarize, here is a tentative todo list:

  • merge channel existence check into create API logic
  • revise on return API of channel_config module
  • move fetch into a separate module named channel_config_info
  • update documentations on "create & update channel config", and on "policy examples & supported format"

👍 thanks! All suggestions above would be subjected to further discussions. Please let me know your thought~

@sstone1
Copy link
Contributor

sstone1 commented Jul 20, 2020

Haven't forgotten about this one!

FYI, operation: create only allows you to create new channels, it does not allow you to update them.

I'm not sure about the splitting out of operation: fetch into a channel_config_info. The _info modules generally return information as the result, and are read-only. However operation: fetch fetches the latest config and writes it to the file system, and does not return any useful information in the result.

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

No branches or pull requests

2 participants