Skip to content

Commit

Permalink
Remove deprecated legacy chaincode lifecycle commands
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Barger <artem@bargr.net>
  • Loading branch information
C0rWin committed Jan 2, 2024
1 parent fc588b5 commit ac41752
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 2,212 deletions.
16 changes: 1 addition & 15 deletions docs/source/commands/ledgerutil.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,7 @@ Args:

## ledgerutil verify
```
usage: ledgerutil verify [<flags>] [<blockStorePath>]
Verify the integrity of a ledger
Flags:
--help Show context-sensitive help (also try --help-long
and --help-man).
-o, --outputDir=OUTPUTDIR Location for verification result output directory.
Default is the current directory.
Args:
[<blockStorePath>] Path to file system of target peer, used to access
block store. Defaults to '/var/hyperledger/production'.
IMPORTANT: If the configuration for target peer's file
system path was changed, the new path MUST be provided.
ledgerutil: error: parsing arguments: expected command but got "verify". Try --help
```

## Exit Status
Expand Down
195 changes: 2 additions & 193 deletions docs/source/commands/peerchaincode.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ different chaincode operations that are relevant to a peer. For example, use the
the `peer chaincode query` subcommand option to query a chaincode for the
current value on a peer's ledger.

Some subcommands take flag `--ctor`, of which the value must be a JSON string
that has either key 'Args' or 'Function' and 'Args'. These keys are
Some subcommands take flag `--ctor`, of which the value must be a JSON string
that has either key 'Args' or 'Function' and 'Args'. These keys are
case-insensitive.

If the JSON string only has the Args key, the key value is an array, where the
Expand Down Expand Up @@ -89,74 +89,6 @@ values. For example, you will use `--peerAddresses localhost:9051
--peerAddresses localhost:7051` rather than `--peerAddresses "localhost:9051
localhost:7051"`.

## peer chaincode install
```
Install a chaincode on a peer. This installs a chaincode deployment spec package (if provided) or packages the specified chaincode before subsequently installing it.
Usage:
peer chaincode install [flags]
Flags:
--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-h, --help help for install
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
--peerAddresses stringArray The addresses of the peers to connect to
--tlsRootCertFiles stringArray If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode instantiate
```
Deploy the specified chaincode to the network.
Usage:
peer chaincode instantiate [flags]
Flags:
-C, --channelID string The channel on which this command should be executed
--collections-config string The fully qualified path to the collection JSON file including the file name
--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-h, --help help for instantiate
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
--peerAddresses stringArray The addresses of the peers to connect to
-P, --policy string The endorsement policy associated to this chaincode
--tlsRootCertFiles stringArray If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode invoke
```
Invoke the specified chaincode. It will try to commit the endorsed transaction to the network.
Expand Down Expand Up @@ -190,68 +122,6 @@ Global Flags:
```


## peer chaincode list
```
Get the instantiated chaincodes in the channel if specify channel, or get installed chaincodes on the peer
Usage:
peer chaincode list [flags]
Flags:
-C, --channelID string The channel on which this command should be executed
--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
-h, --help help for list
--installed Get the installed chaincodes on a peer
--instantiated Get the instantiated chaincodes on a channel
--peerAddresses stringArray The addresses of the peers to connect to
--tlsRootCertFiles stringArray If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode package
```
Package a chaincode and write the package to a file.
Usage:
peer chaincode package [outputfile] [flags]
Flags:
-s, --cc-package create CC deployment spec for owner endorsements instead of raw CC deployment spec
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-h, --help help for package
-i, --instantiate-policy string instantiation policy for the chaincode
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-S, --sign if creating CC deployment spec package for owner endorsements, also sign it with local MSP
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode query
```
Get endorsed result of chaincode function call and print it. It won't generate transaction.
Expand Down Expand Up @@ -283,67 +153,6 @@ Global Flags:
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode signpackage
```
Sign the specified chaincode package
Usage:
peer chaincode signpackage [flags]
Flags:
-h, --help help for signpackage
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```


## peer chaincode upgrade
```
Upgrade an existing chaincode with the specified one. The new chaincode will immediately replace the existing chaincode upon the transaction committed.
Usage:
peer chaincode upgrade [flags]
Flags:
-C, --channelID string The channel on which this command should be executed
--collections-config string The fully qualified path to the collection JSON file including the file name
--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-h, --help help for upgrade
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
--peerAddresses stringArray The addresses of the peers to connect to
-P, --policy string The endorsement policy associated to this chaincode
--tlsRootCertFiles stringArray If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer
--tls Use TLS when communicating with the orderer endpoint
--tlsHandshakeTimeShift duration The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
```

## Example Usage

### peer chaincode instantiate examples
Expand Down
2 changes: 1 addition & 1 deletion docs/wrappers/osnadmin_channel_postscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here's an example of the `osnadmin channel join` command.

Here are some examples of the `osnadmin channel list` command.

* Listing all the channels that the orderer has joined.
* Listing all the channels that the orderer has joined.
Note that the system channel will always be NULL because it is no longer supported from release v3.0 onwards.

```
Expand Down
4 changes: 2 additions & 2 deletions docs/wrappers/peer_chaincode_preamble.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ different chaincode operations that are relevant to a peer. For example, use the
the `peer chaincode query` subcommand option to query a chaincode for the
current value on a peer's ledger.

Some subcommands take flag `--ctor`, of which the value must be a JSON string
that has either key 'Args' or 'Function' and 'Args'. These keys are
Some subcommands take flag `--ctor`, of which the value must be a JSON string
that has either key 'Args' or 'Function' and 'Args'. These keys are
case-insensitive.

If the JSON string only has the Args key, the key value is an array, where the
Expand Down
18 changes: 1 addition & 17 deletions internal/peer/chaincode/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
chainFuncName = "chaincode"
chainCmdDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list."
chainCmdDes = "Query or invoke a chaincode: invoke|query."
)

var logger = flogging.MustGetLogger("chaincodeCmd")
Expand All @@ -41,14 +41,8 @@ func addFlags(cmd *cobra.Command) {
func Cmd(cf *ChaincodeCmdFactory, cryptoProvider bccsp.BCCSP) *cobra.Command {
addFlags(chaincodeCmd)

chaincodeCmd.AddCommand(installCmd(cf, nil, cryptoProvider))
chaincodeCmd.AddCommand(instantiateCmd(cf, cryptoProvider))
chaincodeCmd.AddCommand(invokeCmd(cf, cryptoProvider))
chaincodeCmd.AddCommand(packageCmd(cf, nil, nil, cryptoProvider))
chaincodeCmd.AddCommand(queryCmd(cf, cryptoProvider))
chaincodeCmd.AddCommand(signpackageCmd(cf, cryptoProvider))
chaincodeCmd.AddCommand(upgradeCmd(cf, cryptoProvider))
chaincodeCmd.AddCommand(listCmd(cf, cryptoProvider))

return chaincodeCmd
}
Expand Down Expand Up @@ -121,10 +115,6 @@ func resetFlags() {
"The name of the verification system chaincode to be used for this chaincode")
flags.BoolVarP(&isInit, "isInit", "I", false,
"Is this invocation for init (useful for supporting legacy chaincodes in the new lifecycle)")
flags.BoolVarP(&getInstalledChaincodes, "installed", "", false,
"Get the installed chaincodes on a peer")
flags.BoolVarP(&getInstantiatedChaincodes, "instantiated", "", false,
"Get the instantiated chaincodes on a channel")
flags.StringVar(&collectionsConfigFile, "collections-config", common.UndefinedParamValue,
"The fully qualified path to the collection JSON file including the file name")
flags.StringArrayVarP(&peerAddresses, "peerAddresses", "", []string{common.UndefinedParamValue},
Expand All @@ -137,12 +127,6 @@ func resetFlags() {
"Whether to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully")
flags.DurationVar(&waitForEventTimeout, "waitForEventTimeout", 30*time.Second,
"Time to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully")
flags.BoolVarP(&createSignedCCDepSpec, "cc-package", "s", false,
"create CC deployment spec for owner endorsements instead of raw CC deployment spec")
flags.BoolVarP(&signCCDepSpec, "sign", "S", false,
"if creating CC deployment spec package for owner endorsements, also sign it with local MSP")
flags.StringVarP(&instantiationPolicy, "instantiate-policy", "i", "",
"instantiation policy for the chaincode")
}

func attachFlags(cmd *cobra.Command, names []string) {
Expand Down
Loading

0 comments on commit ac41752

Please sign in to comment.