From 88c0a78426df9838a445c873152a3fa1232288ab Mon Sep 17 00:00:00 2001 From: Taku Shimosawa Date: Tue, 23 Jun 2020 07:29:58 -0700 Subject: [PATCH] [FABCN-393] Fix broken links in documents (#168) This patch fixes broken links to the fabric documents. Signed-off-by: Taku Shimosawa --- apis/fabric-contract-api/README.md | 6 +++--- apis/fabric-contract-api/test/unit/metadata.json | 2 +- apis/fabric-shim-api/README.md | 2 +- docs/_jsdoc/index.md | 2 +- docs/_jsdoc/tutorials/annotated-contract-metadata.md | 6 +++--- docs/_jsdoc/tutorials/deep-dive-contract-interface.md | 2 +- docs/index.md | 2 +- libraries/fabric-shim-crypto/README.md | 2 +- libraries/fabric-shim/README.md | 6 +++--- .../fabric-shim/lib/contract-spi/chaincodefromcontract.js | 2 +- .../test/unit/contract-spi/chaincodefromcontract.js | 4 ++-- .../annotations/src/test_contract/expected-metadata.json | 2 +- test/e2e/scenario.js | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apis/fabric-contract-api/README.md b/apis/fabric-contract-api/README.md index cb9f2da2..a17b179e 100644 --- a/apis/fabric-contract-api/README.md +++ b/apis/fabric-contract-api/README.md @@ -10,7 +10,7 @@ Within Hyperledger Fabric, Smart Contracts can also be referred to as [Chaincode The `fabric-shim` provides the *chaincode interface*, a lower level API for implementing "Smart Contracts". It also _currently_ provides the implementation to support communication with Hyperledger Fabric peers for Smart Contracts written using the `fabric-contract-api`. To confirm that this is the same as the `fabric-shim` in previous versions of Hyperledger Fabric. -Detailed explanation on the concept and programming model can be found here: [http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html](http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html). +Detailed explanation on the concept and programming model can be found here: [https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html). ## Contract Interface @@ -89,7 +89,7 @@ npm install --save fabric-shim ``` ### Usage -The [chaincode interface](https://fabric-shim.github.io/ChaincodeInterface.html) contains two methods to be implemented: +The [chaincode interface](https://hyperledger.github.io/fabric-chaincode-node/master/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented: ```javascript const shim = require('fabric-shim'); @@ -124,7 +124,7 @@ shim.start(new Chaincode()); ``` ### API Reference -Visit [fabric-shim.github.io](https://fabric-shim.github.io/) and click on "Classes" link in the navigation bar on the top to view the list of class APIs. +Visit [API Reference](https://hyperledger.github.io/fabric-chaincode-node/master/api/) and click on "Classes" link in the navigation bar on the top to view the list of class APIs. diff --git a/apis/fabric-contract-api/test/unit/metadata.json b/apis/fabric-contract-api/test/unit/metadata.json index 9eaff633..689a6098 100644 --- a/apis/fabric-contract-api/test/unit/metadata.json +++ b/apis/fabric-contract-api/test/unit/metadata.json @@ -1,5 +1,5 @@ { - "$schema": "https://fabric-shim.github.io/master/contract-schema.json", + "$schema": "https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json", "contracts": { "ShippingContract": { "name": "ShippingContract", diff --git a/apis/fabric-shim-api/README.md b/apis/fabric-shim-api/README.md index 31c1f978..9dd42746 100644 --- a/apis/fabric-shim-api/README.md +++ b/apis/fabric-shim-api/README.md @@ -5,7 +5,7 @@ This `fabric-shim-api` library provides type definitions for the `fabric-shim` module. It is also a dependency of the `fabric-contract-api` As this is a pure interface module it allows the `fabric-contract-api` annotations to be used in client application without the need to pull in unneeded required dependencies. -Detailed explanation on the concepts and programming model can be found here: [http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html](http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html). +Detailed explanation on the concepts and programming model can be found here: [https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html). ## License diff --git a/docs/_jsdoc/index.md b/docs/_jsdoc/index.md index 3fa75b55..98e89331 100644 --- a/docs/_jsdoc/index.md +++ b/docs/_jsdoc/index.md @@ -91,7 +91,7 @@ npm install --save fabric-shim ``` ### Usage -The [chaincode interface](https://fabric-shim.github.io/ChaincodeInterface.html) contains two methods to be implemented: +The [chaincode interface](https://hyperledger.github.io/fabric-chaincode-node/master/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented: ```javascript const shim = require('fabric-shim'); diff --git a/docs/_jsdoc/tutorials/annotated-contract-metadata.md b/docs/_jsdoc/tutorials/annotated-contract-metadata.md index b4240e3b..c49dc829 100644 --- a/docs/_jsdoc/tutorials/annotated-contract-metadata.md +++ b/docs/_jsdoc/tutorials/annotated-contract-metadata.md @@ -5,9 +5,9 @@ The Contract Metadata can be supplied either by the Contract developer or it can ## Metadata Schema -The metadata itself is in JSON, and there is a JSON-Schema definition that defines the contents; this schema is available online at http://fabric-shim.github.io/contract-schema.json +The metadata itself is in JSON, and there is a JSON-Schema definition that defines the contents; this schema is available online at https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json -This is the latest ga copy of the schema. Specific version can be obtained using urls http://fabric-shim.github.io/{release}/contract-schema.json where releases matches the release name, for example +This is the latest ga copy of the schema. Specific version can be obtained using urls https://hyperledger.github.io/fabric-chaincode-node/{release}/api/contract-schema.json where releases matches the release name, for example `master` `release-1.4`. Note that metadata was first introduced at v1.4. A lot of the elements of this metadata are heavily inspired from the [OpenAPI v3.0 specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md) and [JSON Schema](http://json-schema.org/) @@ -16,7 +16,7 @@ Adding a reference at the top of the metadata file to this schema, permits edito ```json { - "$schema": "http://fabric-shim.github.io/contract-schema.json", + "$schema": "https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json", } ``` diff --git a/docs/_jsdoc/tutorials/deep-dive-contract-interface.md b/docs/_jsdoc/tutorials/deep-dive-contract-interface.md index 9769e9ec..fd3809dd 100644 --- a/docs/_jsdoc/tutorials/deep-dive-contract-interface.md +++ b/docs/_jsdoc/tutorials/deep-dive-contract-interface.md @@ -117,7 +117,7 @@ A correctly specified metadata file, at the top level has this structure ```json { - "$schema" : "https://fabric-shim.github.io/master/contract-schema.json", + "$schema" : "https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json", "info" : { }, diff --git a/docs/index.md b/docs/index.md index 1ad956dc..019af38d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ in various programming languages. There are two other smart contract SDKs availa ## Documentation -Detailed explanation on the concepts and programming model for smart contracts can be found in the [Chaincode for developers tutorial in the Hyperledger Fabric documentation](https://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html). +Detailed explanation on the concepts and programming model for smart contracts can be found in the [Smart Contracts and Chaincode section in the Hyperledger Fabric documentation](https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html). API documentation is available for each release: diff --git a/libraries/fabric-shim-crypto/README.md b/libraries/fabric-shim-crypto/README.md index f1121ac3..45234da2 100644 --- a/libraries/fabric-shim-crypto/README.md +++ b/libraries/fabric-shim-crypto/README.md @@ -5,7 +5,7 @@ This `fabric-shim-crypto` library provides supporting encryption and decryption functions that might be useful for developers. -Detailed explanation on the concepts and programming model can be found here: [http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html](http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html). +Detailed explanation on the concepts and programming model can be found here: [https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html). ## License diff --git a/libraries/fabric-shim/README.md b/libraries/fabric-shim/README.md index 15a690e7..6e9d85b7 100644 --- a/libraries/fabric-shim/README.md +++ b/libraries/fabric-shim/README.md @@ -7,7 +7,7 @@ The `fabric-shim` provides the *chaincode interface*, a lower level API for implementing "Smart Contracts". To confirm that this is the same as the `fabric-shim` in previous versions of Hyperledger Fabric. -Detailed explanation on the concept and programming model can be found here: [http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html](http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html). +Detailed explanation on the concept and programming model can be found here: [https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html). ## Chaincode Interface @@ -18,7 +18,7 @@ npm install --save fabric-shim ``` ### Usage -The [chaincode interface](https://fabric-shim.github.io/ChaincodeInterface.html) contains two methods to be implemented: +The [chaincode interface](https://hyperledger.github.io/fabric-chaincode-node/master/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented: ```javascript const shim = require('fabric-shim'); @@ -53,7 +53,7 @@ shim.start(new Chaincode()); ``` ### API Reference -Visit [fabric-shim.github.io](https://fabric-shim.github.io/) and click on "Classes" link in the navigation bar on the top to view the list of class APIs. +Visit [API Reference](https://hyperledger.github.io/fabric-chaincode-node/master/api/) and click on "Classes" link in the navigation bar on the top to view the list of class APIs. ## Support Tested with node.js 8.9.0 (LTS). diff --git a/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js b/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js index 788b669f..d519385b 100644 --- a/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js +++ b/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js @@ -183,7 +183,7 @@ class ChaincodeFromContract { _augmentMetadataFromCode(metadata) { if (!metadata.$schema) { - metadata.$schema = 'https://fabric-shim.github.io/master/contract-schema.json'; + metadata.$schema = 'https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json'; } if (!metadata.contracts || Object.keys(metadata.contracts).length === 0) { diff --git a/libraries/fabric-shim/test/unit/contract-spi/chaincodefromcontract.js b/libraries/fabric-shim/test/unit/contract-spi/chaincodefromcontract.js index 159e98a2..b25db118 100644 --- a/libraries/fabric-shim/test/unit/contract-spi/chaincodefromcontract.js +++ b/libraries/fabric-shim/test/unit/contract-spi/chaincodefromcontract.js @@ -1209,7 +1209,7 @@ describe('chaincodefromcontract', () => { const metadata = fakeCcfc._augmentMetadataFromCode(partialMetadata); const correctData = { - '$schema': 'https://fabric-shim.github.io/master/contract-schema.json', + '$schema': 'https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json', 'components': { 'schemas': {} }, @@ -1344,7 +1344,7 @@ describe('chaincodefromcontract', () => { metadata.components.should.deep.equal(metadataToSend.components); metadata.contracts.should.deep.equal(metadataToSend.contracts); metadata.info.should.deep.equal(metadataToSend.info); - metadata.$schema.should.deep.equal('https://fabric-shim.github.io/master/contract-schema.json'); + metadata.$schema.should.deep.equal('https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json'); }); }); diff --git a/test/chaincodes/annotations/src/test_contract/expected-metadata.json b/test/chaincodes/annotations/src/test_contract/expected-metadata.json index 63293306..d4b8f53d 100644 --- a/test/chaincodes/annotations/src/test_contract/expected-metadata.json +++ b/test/chaincodes/annotations/src/test_contract/expected-metadata.json @@ -1,5 +1,5 @@ { - "$schema": "https://fabric-shim.github.io/master/contract-schema.json", + "$schema": "https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json", "contracts": { "TestContract": { "name": "TestContract", diff --git a/test/e2e/scenario.js b/test/e2e/scenario.js index a825327c..80185b0d 100644 --- a/test/e2e/scenario.js +++ b/test/e2e/scenario.js @@ -47,7 +47,7 @@ const queryFunctions = async () => { const metadata = JSON.parse(stdout); - const expectedMetadata = '{"$schema":"https://fabric-shim.github.io/master/contract-schema.json","contracts":{"UpdateValues":{"name":"UpdateValues","contractInstance":{"name":"UpdateValues","logBuffer":{"output":[]},"default":true},"transactions":[{"name":"setup","tags":["submitTx"]},{"name":"setNewAssetValue","tags":["submitTx"],"parameters":[{"name":"arg0","description":"Argument 0","schema":{"type":"string"}}]},{"name":"doubleAssetValue","tags":["submitTx"]}],"info":{"title":"","version":""}},"RemoveValues":{"name":"RemoveValues","contractInstance":{"name":"RemoveValues"},"transactions":[{"name":"quarterAssetValue","tags":["submitTx"]},{"name":"getAssetValue","tags":["submitTx"]}],"info":{"title":"","version":""}},"org.hyperledger.fabric":{"name":"org.hyperledger.fabric","contractInstance":{"name":"org.hyperledger.fabric"},"transactions":[{"name":"GetMetadata"}],"info":{"title":"","version":""}}},"info":{"version":"1.0.0","title":"chaincode"},"components":{"schemas":{}}}'; + const expectedMetadata = '{"$schema":"https://hyperledger.github.io/fabric-chaincode-node/master/api/contract-schema.json","contracts":{"UpdateValues":{"name":"UpdateValues","contractInstance":{"name":"UpdateValues","logBuffer":{"output":[]},"default":true},"transactions":[{"name":"setup","tags":["submitTx"]},{"name":"setNewAssetValue","tags":["submitTx"],"parameters":[{"name":"arg0","description":"Argument 0","schema":{"type":"string"}}]},{"name":"doubleAssetValue","tags":["submitTx"]}],"info":{"title":"","version":""}},"RemoveValues":{"name":"RemoveValues","contractInstance":{"name":"RemoveValues"},"transactions":[{"name":"quarterAssetValue","tags":["submitTx"]},{"name":"getAssetValue","tags":["submitTx"]}],"info":{"title":"","version":""}},"org.hyperledger.fabric":{"name":"org.hyperledger.fabric","contractInstance":{"name":"org.hyperledger.fabric"},"transactions":[{"name":"GetMetadata"}],"info":{"title":"","version":""}}},"info":{"version":"1.0.0","title":"chaincode"},"components":{"schemas":{}}}'; const schema = fs.readFileSync(path.join(__dirname, '../../apis/fabric-contract-api/schema/contract-schema.json'));