Skip to content

Commit e06da3c

Browse files
authored
I suggest the "per channel create" command to make deprecated. (#5238)
For this functionality, you need to use the Order Service Node (OSN) Signed-off-by: Fedor Partanskiy <[email protected]>
1 parent 77db242 commit e06da3c

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

docs/source/commands/peerchannel.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Usage:
3131
peer channel [command]
3232
3333
Available Commands:
34-
create Create a channel
34+
create [DEPRECATED] Create a channel
3535
fetch Fetch a block
3636
getinfo get blockchain information of a specified channel.
3737
join Joins the peer to a channel.
@@ -59,7 +59,7 @@ Use "peer channel [command] --help" for more information about a command.
5959

6060
## peer channel create
6161
```
62-
Create a channel and write the genesis block to a file.
62+
[DEPRECATED] Create a channel and write the genesis block to a file. Instead of this command, use Orderer Service Node (OSN).
6363
6464
Usage:
6565
peer channel create [flags]
@@ -277,7 +277,7 @@ Global Flags:
277277

278278
## Example Usage
279279

280-
### peer channel create examples
280+
### peer channel create examples (deprecated)
281281

282282
Here's an example that uses the `--orderer` global flag on the `peer channel
283283
create` command.

docs/wrappers/peer_channel_postscript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Example Usage
22

3-
### peer channel create examples
3+
### peer channel create examples (deprecated)
44

55
Here's an example that uses the `--orderer` global flag on the `peer channel
66
create` command.

integration/nwo/commands/peer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func (n NodeUnjoin) Args() []string {
102102
}
103103
}
104104

105+
// deprecated
105106
type ChannelCreate struct {
106107
ChannelID string
107108
Orderer string
@@ -110,10 +111,12 @@ type ChannelCreate struct {
110111
ClientAuth bool
111112
}
112113

114+
// deprecated
113115
func (c ChannelCreate) SessionName() string {
114116
return "peer-channel-create"
115117
}
116118

119+
// deprecated
117120
func (c ChannelCreate) Args() []string {
118121
args := []string{
119122
"channel", "create",

integration/nwo/network.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ func (n *Network) CreateChannel(channelName string, o *Orderer, p *Peer, additio
10891089
Eventually(createChannel, n.EventuallyTimeout).Should(Equal(0))
10901090
}
10911091

1092+
// deprecated
10921093
// CreateChannelExitCode will submit an existing create channel transaction to
10931094
// the specified orderer, wait for the operation to complete, and return the
10941095
// exit status of the "peer channel create" command.

internal/peer/channel/create.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ func (e InvalidCreateTx) Error() string {
3838
return fmt.Sprintf("Invalid channel create transaction : %s", string(e))
3939
}
4040

41+
// deprecated
4142
func createCmd(cf *ChannelCmdFactory) *cobra.Command {
4243
createCmd := &cobra.Command{
4344
Use: "create",
44-
Short: "Create a channel",
45-
Long: "Create a channel and write the genesis block to a file.",
45+
Short: "[DEPRECATED] Create a channel",
46+
Long: "[DEPRECATED] Create a channel and write the genesis block to a file. Instead of this command, use Orderer Service Node (OSN).",
4647
RunE: func(cmd *cobra.Command, args []string) error {
4748
return create(cmd, args, cf)
4849
},
@@ -58,6 +59,7 @@ func createCmd(cf *ChannelCmdFactory) *cobra.Command {
5859
return createCmd
5960
}
6061

62+
// deprecated
6163
func createChannelFromDefaults(cf *ChannelCmdFactory) (*cb.Envelope, error) {
6264
chCrtEnv, err := encoder.MakeChannelCreationTransaction(
6365
channelID,
@@ -71,6 +73,7 @@ func createChannelFromDefaults(cf *ChannelCmdFactory) (*cb.Envelope, error) {
7173
return chCrtEnv, nil
7274
}
7375

76+
// deprecated
7477
func createChannelFromConfigTx(configTxFileName string) (*cb.Envelope, error) {
7578
cftx, err := os.ReadFile(configTxFileName)
7679
if err != nil {
@@ -80,6 +83,7 @@ func createChannelFromConfigTx(configTxFileName string) (*cb.Envelope, error) {
8083
return protoutil.UnmarshalEnvelope(cftx)
8184
}
8285

86+
// deprecated
8387
func sanityCheckAndSignConfigTx(envConfigUpdate *cb.Envelope, signer identity.SignerSerializer) (*cb.Envelope, error) {
8488
payload, err := protoutil.UnmarshalPayload(envConfigUpdate.Payload)
8589
if err != nil {
@@ -137,6 +141,7 @@ func sanityCheckAndSignConfigTx(envConfigUpdate *cb.Envelope, signer identity.Si
137141
return protoutil.CreateSignedEnvelope(cb.HeaderType_CONFIG_UPDATE, channelID, signer, configUpdateEnv, 0, 0)
138142
}
139143

144+
// deprecated
140145
func sendCreateChainTransaction(cf *ChannelCmdFactory) error {
141146
var err error
142147
var chCrtEnv *cb.Envelope
@@ -167,6 +172,7 @@ func sendCreateChainTransaction(cf *ChannelCmdFactory) error {
167172
return err
168173
}
169174

175+
// deprecated
170176
func executeCreate(cf *ChannelCmdFactory) error {
171177
err := sendCreateChainTransaction(cf)
172178
if err != nil {
@@ -195,6 +201,7 @@ func executeCreate(cf *ChannelCmdFactory) error {
195201
return nil
196202
}
197203

204+
// deprecated
198205
func getGenesisBlock(cf *ChannelCmdFactory) (*cb.Block, error) {
199206
timer := time.NewTimer(timeout)
200207
defer timer.Stop()
@@ -220,6 +227,7 @@ func getGenesisBlock(cf *ChannelCmdFactory) (*cb.Block, error) {
220227
}
221228
}
222229

230+
// deprecated
223231
func create(cmd *cobra.Command, args []string, cf *ChannelCmdFactory) error {
224232
// the global chainID filled by the "-c" command
225233
if channelID == common.UndefinedParamValue {

0 commit comments

Comments
 (0)