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

[FAB-17709] Support creating system channel genesis block #1055

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

wuxuer
Copy link
Contributor

@wuxuer wuxuer commented Apr 10, 2020

Add a function to create a system channel genesis block.

Signed-off-by: xu wu wuxu1103@163.com

Type of change

  • New feature

Description

Additional details

Related issues

https://jira.hyperledger.org/browse/FAB-17709

@wuxuer wuxuer requested a review from a team as a code owner April 10, 2020 10:24
DereckLuo
DereckLuo previously approved these changes Apr 14, 2020
Copy link
Contributor

@DereckLuo DereckLuo left a 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 Show resolved Hide resolved

block, err := newSystemChannelBlock(ct, channelID)
if err != nil {
return nil, fmt.Errorf("creating system channel block: %v", err)
Copy link

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.

Copy link
Contributor Author

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.

pkg/config/config.go Outdated Show resolved Hide resolved
Copy link

@caod123 caod123 left a 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

pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/config_test.go Outdated Show resolved Hide resolved
pkg/config/config_test.go Outdated Show resolved Hide resolved
pkg/config/config_test.go Outdated Show resolved Hide resolved
pkg/config/config_test.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@C0rWin C0rWin left a 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 Show resolved Hide resolved

block := newBlock(0, nil)
block.Data = &cb.BlockData{Data: [][]byte{blockData}}
block.Header.DataHash = blockDataHash(block.Data)
Copy link
Contributor

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>
@caod123 caod123 merged commit 83b89c9 into hyperledger:master Apr 16, 2020
@wuxuer wuxuer deleted the FAB-17709 branch April 17, 2020 00:54
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.

4 participants