Skip to content

Commit

Permalink
[FABCN-393] Fix broken links in documents (#169)
Browse files Browse the repository at this point in the history
This patch fixes broken links to the fabric documents.
This patch also fixes links to point to those for the proper version
(2.1).

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>
  • Loading branch information
shimos authored Jun 23, 2020
1 parent e8361de commit 8966eed
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions apis/fabric-contract-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

[![Version](https://badge.fury.io/js/fabric-shim.svg)](http://badge.fury.io/js/fabric-shim)

The `fabric-contract-api` provides the *contract interface* a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#smart-contract). Working with this API provides a high level entry point to writing business logic.
The `fabric-contract-api` provides the *contract interface* a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#smart-contract). Working with this API provides a high level entry point to writing business logic.

Within Hyperledger Fabric, Smart Contracts can also be referred to as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#chaincode). To be more specific, the term chaincode is preferred to be used to refer to the overall container that is hosting the contracts.
Within Hyperledger Fabric, Smart Contracts can also be referred to as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#chaincode). To be more specific, the term chaincode is preferred to be used to refer to the overall container that is hosting the contracts.

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/release-2.1/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/release-2.1/smartcontract/smartcontract.html).

## Contract Interface

Expand Down Expand Up @@ -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/release-2.1/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented:
```javascript
const shim = require('fabric-shim');

Expand Down Expand Up @@ -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/release-2.1/api/) and click on "Classes" link in the navigation bar on the top to view the list of class APIs.



Expand Down
2 changes: 1 addition & 1 deletion apis/fabric-contract-api/test/unit/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://fabric-shim.github.io/master/contract-schema.json",
"$schema": "https://hyperledger.github.io/fabric-chaincode-node/release-2.1/api/contract-schema.json",
"contracts": {
"ShippingContract": {
"name": "ShippingContract",
Expand Down
2 changes: 1 addition & 1 deletion apis/fabric-shim-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/release-2.1/smartcontract/smartcontract.html).


## License
Expand Down
6 changes: 3 additions & 3 deletions docs/_jsdoc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

## Overview

The `fabric-contract-api` provides the *contract interface*. a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#smart-contract). Within Hyperledger Fabric, Smart Contracts are also known as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#chaincode). Working with this API provides a high level entry point to writing business logic.
The `fabric-contract-api` provides the *contract interface*. a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#smart-contract). Within Hyperledger Fabric, Smart Contracts are also known as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#chaincode). Working with this API provides a high level entry point to writing business logic.

The `fabric-shim` provides the *chaincode interface*, a lower level API for implementing "Smart Contracts". It also provides the implementation to support communication with Hyperledger Fabric peers for Smart Contracts written using the `fabric-contract-api` together with the `fabric-chaincode-node` cli to launch Chaincode or Smart Contracts.

To confirm that the `fabric-shim` maintains API and functional compatibility with previous versions of Hyperledger Fabric.

A more detailed explanation on the concept and programming model can be found in the [smart contract processing topic](https://hyperledger-fabric.readthedocs.io/en/latest/developapps/smartcontract.html).
A more detailed explanation on the concept and programming model can be found in the [smart contract processing topic](https://hyperledger-fabric.readthedocs.io/en/release-2.1/developapps/smartcontract.html).

## Contract Interface

Expand Down Expand Up @@ -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/release-2.1/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented:
```javascript
const shim = require('fabric-shim');

Expand Down
8 changes: 4 additions & 4 deletions docs/_jsdoc/tutorials/annotated-contract-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ 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/release-2.1/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
`master` `release-1.4`. Note that metadata was first introduced at v1.4.
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` `release-2.1`. 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/)

Adding a reference at the top of the metadata file to this schema, permits editors and tools to be able to perform validation on the JSON at the point of editing.

```json
{
"$schema": "http://fabric-shim.github.io/contract-schema.json",
"$schema": "https://hyperledger.github.io/fabric-chaincode-node/release-2.1/api/contract-schema.json",

}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/_jsdoc/tutorials/deep-dive-contract-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/api/contract-schema.json",
"info" : {

},
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/smartcontract/smartcontract.html).

API documentation is available for each release:

Expand Down
2 changes: 1 addition & 1 deletion libraries/fabric-shim-crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/release-2.1/smartcontract/smartcontract.html).


## License
Expand Down
6 changes: 3 additions & 3 deletions libraries/fabric-shim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/smartcontract/smartcontract.html](https://hyperledger-fabric.readthedocs.io/en/release-2.1/smartcontract/smartcontract.html).


## Chaincode Interface
Expand All @@ -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/release-2.1/api/fabric-shim.ChaincodeInterface.html) contains two methods to be implemented:
```javascript
const shim = require('fabric-shim');

Expand Down Expand Up @@ -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/release-2.1/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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/api/contract-schema.json';
}

if (!metadata.contracts || Object.keys(metadata.contracts).length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/fabric-shim/lib/utils/statebased.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ROLE_TYPE_PEER = 'PEER';
* into validation parameter byte arrays, the shim provides convenience functions
* that allow the chaincode developer to deal with endorsement policies in terms
* of the MSP identifiers of organizations.
* For more informations, please read the [documents]{@link https://hyperledger-fabric.readthedocs.io/en/latest/endorsement-policies.html#setting-key-level-endorsement-policies}
* For more informations, please read the [documents]{@link https://hyperledger-fabric.readthedocs.io/en/release-2.1/endorsement-policies.html#setting-key-level-endorsement-policies}
*
* @class
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/api/contract-schema.json',
'components': {
'schemas': {}
},
Expand Down Expand Up @@ -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/release-2.1/api/contract-schema.json');
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://fabric-shim.github.io/master/contract-schema.json",
"$schema": "https://hyperledger.github.io/fabric-chaincode-node/release-2.1/api/contract-schema.json",
"contracts": {
"TestContract": {
"name": "TestContract",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/release-2.1/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'));

Expand Down

0 comments on commit 8966eed

Please sign in to comment.