hyperledger / hyperledger/fabric-admin-sdk

to support GetConfigBlockFromOrdererByNumber

Open
#124 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
36
Forks
28
Avg merge
26m
Merged PRs (30d)
2

Description

For an exist channel , when a new org need to be added to channel:
the channel's configBlock is updated first, then the org's peers join the channel

code may like as follows
```
//code update the configblock
...
...

//code to get the latest configblock
block, err = channel.GetConfigBlockFromOrderer(context.Background(), orderer0.Conn, orderer0.Signer, channelID, orderer0.KeyPair)
if err != nil {
logger.Error(err)
return err
}
//code to make peer join the channel
err := channel.JoinChannel(block, peerCli.Signer, peer.NewEndorserClient(peerCli.Conn))
if err != nil {
logger.Error(err)
return err
}
```
JoinChannel(...) will give an error: unsuccessful response received with status 500 (INTERNAL_SERVER_ERROR): cannot create ledger from genesis block: expected block number=0, received block number=1

So when a peer join the channl it will always need the number 0 ConfigBlock, is it correct?
but channel.GetConfigBlockFromOrderer(...) always return the latest ConfigBlock
so we need a func like channel.GetConfigBlockFromOrdererByNumber(0) or channel.GetFirstConfigBlockFromOrderer() to get the first ConfigBlock to support peer join

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.