-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[FAB-17709] Support creating system channel genesis block #1055
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 LGTM
pkg/config/config.go
Outdated
|
||
block, err := newSystemChannelBlock(ct, channelID) | ||
if err != nil { | ||
return nil, fmt.Errorf("creating system channel block: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise to my comment on the function name, I think this error will need some rework too. We probably want to focus more on the fact that this is the genesis block as otherwise creating system channel block
can be misconstrued for what this function is intended to be used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added "genesis" in the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small requested changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your contribution I have a few small nits.
pkg/config/config.go
Outdated
|
||
block := newBlock(0, nil) | ||
block.Data = &cb.BlockData{Data: [][]byte{blockData}} | ||
block.Header.DataHash = blockDataHash(block.Data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it might make sense to encapsulate this initialization within newBlock
Add a function to create a system channel genesis block. Remove Consortium for system channel in function newSystemChannelGroup. Set channelGroup.ModPolicy to be Admins in function newChannelGroup and newSystemChannelGroup. Signed-off-by: xu wu <wuxu1103@163.com>
Add a function to create a system channel genesis block.
Signed-off-by: xu wu wuxu1103@163.com
Type of change
Description
Additional details
Related issues
https://jira.hyperledger.org/browse/FAB-17709