Commit a2427b0d authored by David Enyeart's avatar David Enyeart Committed by Gerrit Code Review
Browse files

Merge "[FAB-12910] Document installation path"

parents 2c795a4c e7bc4733
......@@ -693,7 +693,7 @@ place the specified source code flavor onto our peer's filesystem.
.. code:: bash
# this installs the Go chaincode
# this installs the Go chaincode. For go chaincode -p takes the relative path from $GOPATH/src
peer chaincode install -n mycc -v 1.0 -p github.com/chaincode/chaincode_example02/go/
**Node.js**
......@@ -701,13 +701,16 @@ place the specified source code flavor onto our peer's filesystem.
.. code:: bash
# this installs the Node.js chaincode
# make note of the -l flag; we use this to specify the language
# make note of the -l flag to indicate "node" chaincode
# for node chaincode -p takes the absolute path to the node.js chaincode
peer chaincode install -n mycc -v 1.0 -l node -p /opt/gopath/src/github.com/chaincode/chaincode_example02/node/
**Java**
.. code:: bash
# make note of the -l flag to indicate "java" chaincode
# for java chaincode -p takes the absolute path to the java chaincode
peer chaincode install -n mycc -v 1.0 -l java -p /opt/gopath/src/github.com/chaincode/chaincode_example02/java/
Next, instantiate the chaincode on the channel. This will initialize the
......
......@@ -187,8 +187,9 @@ The CLI internally creates the SignedChaincodeDeploymentSpec for **sacc** and
sends it to the local peer, which calls the ``Install`` method on the LSCC. The
argument to the ``-p`` option specifies the path to the chaincode, which must be
located within the source tree of the user's ``GOPATH``, e.g.
``$GOPATH/src/sacc``. See the `CLI`_ section for a complete description of
the command options.
``$GOPATH/src/sacc``. Note if using ``-l node`` or ``-l java`` for node chaincode
or java chaincode, use ``-p`` with the absolute path of the chaincode location.
See the :doc:`command_ref` for a complete description of the command options.
Note that in order to install on a peer, the signature of the SignedProposal
must be from 1 of the peer's local MSP administrators.
......@@ -297,68 +298,6 @@ Stop would be useful in the workflow for doing upgrade in controlled manner,
where a chaincode can be stopped on a channel on all peers before issuing an
upgrade.
.. _CLI:
CLI
^^^
.. note:: We are assessing the need to distribute platform-specific binaries
for the Hyperledger Fabric ``peer`` binary. For the time being, you
can simply invoke the commands from within a running docker container.
To view the currently available CLI commands, execute the following command from
within a running ``fabric-peer`` Docker container:
.. code:: bash
docker run -it hyperledger/fabric-peer bash
# peer chaincode --help
Which shows output similar to the example below:
.. code:: bash
Usage:
peer chaincode [command]
Available Commands:
install Package the specified chaincode into a deployment spec and save it on the peer's path.
instantiate Deploy the specified chaincode to the network.
invoke Invoke the specified chaincode.
list Get the instantiated chaincodes on a channel or installed chaincodes on a peer.
package Package the specified chaincode into a deployment spec.
query Query using the specified chaincode.
signpackage Sign the specified chaincode package
upgrade Upgrade chaincode.
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)
-h, --help help for chaincode
--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
--transient string Transient map of arguments in JSON encoding
Use "peer chaincode [command] --help" for more information about a command.
To facilitate its use in scripted applications, the ``peer`` command always
produces a non-zero return code in the event of command failure.
Example of chaincode commands:
.. code:: bash
peer chaincode install -n mycc -v 0 -p path/to/my/chaincode/v0
peer chaincode instantiate -n mycc -v 0 -c '{"Args":["a", "b", "c"]}' -C mychannel
peer chaincode install -n mycc -v 1 -p path/to/my/chaincode/v1
peer chaincode upgrade -n mycc -v 1 -c '{"Args":["d", "e", "f"]}' -C mychannel
peer chaincode query -C mychannel -n mycc -c '{"Args":["query","e"]}'
peer chaincode invoke -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n mycc -c '{"Args":["invoke","a","b","10"]}'
.. _System Chaincode:
System chaincode
......
......@@ -78,9 +78,9 @@ 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")
-l, --lang string Language of chaincode, either "golang" (default), "node", or "java"
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-p, --path string Path to chaincode, for "golang" use relative path from $GOPATH/src, for "node" or "java" use absolute path
--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
......@@ -205,9 +205,9 @@ Flags:
-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")
-l, --lang string Language of chaincode, either "golang" (default), "node", or "java"
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-p, --path string Path to chaincode, for "golang" use relative path from $GOPATH/src, for "node" or "java" use absolute path
-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
......@@ -292,9 +292,9 @@ Flags:
-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")
-l, --lang string Language of chaincode, either "golang" (default), "node", or "java"
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-p, --path string Path to chaincode, for "golang" use relative path from $GOPATH/src, for "node" or "java" use absolute path
--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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment