Skip to content

Commit

Permalink
Merge "FAB-6472 node.js CC API reference links"
Browse files Browse the repository at this point in the history
  • Loading branch information
denyeart authored and Gerrit Code Review committed Oct 16, 2017
2 parents e23196b + 82deeb6 commit 5a0e40e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/source/chaincode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Chaincode Tutorials
What is Chaincode?
------------------

Chaincode is a program, written in `Go <https://golang.org>`_, and eventually
in other programming languages such as Java, that implements a
Chaincode is a program, written in `Go <https://golang.org>`_, `node.js <https://nodejs.org>`_,
and eventually in other programming languages such as Java, that implements a
prescribed interface. Chaincode runs in a secured Docker container isolated from
the endorsing peer process. Chaincode initializes and manages ledger state
through transactions submitted by applications.
Expand Down
18 changes: 12 additions & 6 deletions docs/source/chaincode4ade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Chaincode for Developers
What is Chaincode?
------------------

Chaincode is a program, written in `Go <https://golang.org>`_ that implements a
prescribed interface. Eventually, other programming languages such as Java,
Chaincode is a program, written in `Go <https://golang.org>`_, `node.js <https://nodejs.org>`_,
that implements a prescribed interface. Eventually, other programming languages such as Java,
will be supported. Chaincode runs in a secured Docker container isolated from
the endorsing peer process. Chaincode initializes and manages the ledger state
through transactions submitted by applications.
Expand All @@ -23,17 +23,23 @@ and walk through the purpose of each method in the Chaincode Shim API.
Chaincode API
-------------

Every chaincode program must implement the
`Chaincode interface <http://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#Chaincode>`_
Every chaincode program must implement the ``Chaincode interface``:

- `Go <http://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#Chaincode>`_
- `node.js <https://fabric-shim.github.io/ChaincodeInterface.html>`_

whose methods are called in response to received transactions.
In particular the ``Init`` method is called when a
chaincode receives an ``instantiate`` or ``upgrade`` transaction so that the
chaincode may perform any necessary initialization, including initialization of
application state. The ``Invoke`` method is called in response to receiving an
``invoke`` transaction to process transaction proposals.

The other interface in the chaincode "shim" APIs is the
`ChaincodeStubInterface <http://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#ChaincodeStub>`_
The other interface in the chaincode "shim" APIs is the ``ChaincodeStubInterface``:

- `Go <http://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#ChaincodeStub>`_
- `node.js <https://fabric-shim.github.io/ChaincodeStub.html>`_

which is used to access and modify the ledger, and to make invocations between
chaincodes.

Expand Down

0 comments on commit 5a0e40e

Please sign in to comment.