diff --git a/docs/source/_static/NetworkYamlFabric1.png b/docs/source/_static/NetworkYamlFabric1.png deleted file mode 100644 index 9b9c3f8faa0..00000000000 Binary files a/docs/source/_static/NetworkYamlFabric1.png and /dev/null differ diff --git a/docs/source/guides/fabric/add-cli.md b/docs/source/guides/fabric/add-cli.md index 46aad8fecde..074a34344eb 100644 --- a/docs/source/guides/fabric/add-cli.md +++ b/docs/source/guides/fabric/add-cli.md @@ -7,9 +7,8 @@ # Adding cli to Hyperledger Fabric - [Prerequisites](#prerequisites) -- [Modifying configuration file](#create_config_file) -- [Running playbook to deploy Hyperledger Fabric network](#run_network) - +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) ## Prerequisites @@ -27,33 +26,21 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`) for adding cli, all the existing organizations should have `org_status` tag as `existing` and the new organization should have `org_status` tag as `new` under `network.channels` e.g. - network: - channels: - - channel: - .. - .. - participants: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:65:139" +``` and under `network.organizations` as - network: - organizations: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:143:155" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:406:414" + .. + .. +``` The `network.yaml` file should contain the specific `network.organization` details along with the orderer information. diff --git a/docs/source/guides/fabric/add-new-channel.md b/docs/source/guides/fabric/add-new-channel.md index 5d7e2480f64..7b9f85183a1 100644 --- a/docs/source/guides/fabric/add-new-channel.md +++ b/docs/source/guides/fabric/add-new-channel.md @@ -7,8 +7,8 @@ # Adding a new channel in Hyperledger Fabric - [Prerequisites](#prerequisites) -- [Modifying configuration file](#create_config_file) -- [Running playbook to deploy Hyperledger Fabric network](#run_network) +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) @@ -27,41 +27,19 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`) for adding new channel, all the existing channel should have `channel_status` tag as `existing` and the new channel should have `channel_status` tag as `new` under `network.channels` e.g. - network: - channels: - - channel: - channel_status: existing - .. - .. - participants: - - organization: - .. - .. - - organization: - .. - .. - - channel: - channel_status: new - .. - .. - participants: - - organization: - .. - .. - - organization: - .. - .. - +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml:66:193" +``` The `network.yaml` file should contain the specific `network.organization` details along with the orderer information. -For reference, see `network-fabric-add-channel.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples). +For reference, see `network-fabric-add-channel.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml). ## Run playbook -The [add-new-channel.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/shared/configuration/add-new-channel.yaml) playbook is used to add a new channel to the existing network. This can be done using the following command +The [add-new-channel.yaml](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/add-new-channel.yaml) playbook is used to add a new channel to the existing network. This can be done using the following command ``` ansible-playbook platforms/hyperledger-fabric/configuration/add-new-channel.yaml --extra-vars "@path-to-network.yaml" diff --git a/docs/source/guides/fabric/add-new-orderer-org.md b/docs/source/guides/fabric/add-new-orderer-org.md index 04f429da068..121760dd237 100644 --- a/docs/source/guides/fabric/add-new-orderer-org.md +++ b/docs/source/guides/fabric/add-new-orderer-org.md @@ -7,9 +7,8 @@ # Adding a new Orderer organization in Hyperledger Fabric - [Prerequisites](#prerequisites) -- [Modifying configuration file](#create_config_file) -- [Running playbook to deploy Hyperledger Fabric network](#run_network) - +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) ## Prerequisites @@ -17,7 +16,7 @@ To add a new Orderer organization, a fully configured Fabric network must be pre --- **NOTE**: Addition of a new Orderer organization has been tested on an existing network which is created by Bevel. Networks created using other methods may be suitable but this has not been tested by Bevel team. -Addition of new Orderer organization only works with Fabric 2.2.2 and RAFT Service. +Addition of new Orderer organization only works with Fabric 2.2.2, 2.5.4 and RAFT Service. --- @@ -28,38 +27,26 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`) for adding new orderer organization, all the existing organizations should have `org_status` tag as `existing` and the new organization should have `org_status` tag as `new` under `network.channels` e.g. - network: - channels: - - channel: - .. - .. - participants: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml:64:138" +``` and under `network.organizations` as - network: - organizations: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml:145:154" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml:230:239" + .. + .. +``` The `network.yaml` file should contain the specific `network.organization` details along with the orderer information. -For reference, see `network-fabric-add-ordererorg.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/add-orderer-organization.yaml). +For reference, see `network-fabric-add-ordererorg.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml). ## Run playbook diff --git a/docs/source/guides/fabric/add-new-orderer-peer.md b/docs/source/guides/fabric/add-new-orderer-peer.md index 47b433dfe5e..8316a7e71f5 100644 --- a/docs/source/guides/fabric/add-new-orderer-peer.md +++ b/docs/source/guides/fabric/add-new-orderer-peer.md @@ -6,10 +6,9 @@ # Adding a new RAFT orderer to existing Orderer organization in Hyperledger Fabric - - [Prerequisites](#prerequisites) - - [Modifying Configuration File](#modifying-configuration-file) - - [Run playbook](#run-playbook) - - [Chaincode Installation](#chaincode-installation) +- [Prerequisites](#prerequisites) +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) @@ -31,24 +30,21 @@ For generic instructions on the Fabric configuration file, refer [this guide](.. While modifying the configuration file(`network.yaml`) for adding new peer, all the existing orderers should have `status` tag as `existing` and the new orderers should have `status` tag as `new` under `network.organizations` as - network: - organizations: - - organization: - org_status: existing # org_status must be existing when adding peer - .. - .. - services: - orderers: - - orderer: - .. - .. - status: new # new for new peers(s) - - orderer: - .. - .. - status: existing # existing for existing peers(s) - +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:126:135" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:174:174" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:185:220" + +``` +and under `network.orderers` the new orderer must be added. + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:42:66" +``` + The `network.yaml` file should contain the specific `network.organization` details. Ensure the following is considered when adding the new orderer on a different cluster: diff --git a/docs/source/guides/fabric/add-new-org.md b/docs/source/guides/fabric/add-new-org.md index 0fe219cdb75..c5abe3baf51 100644 --- a/docs/source/guides/fabric/add-new-org.md +++ b/docs/source/guides/fabric/add-new-org.md @@ -7,8 +7,8 @@ # Adding a new organization in Hyperledger Fabric - [Prerequisites](#prerequisites) -- [Modifying configuration file](#create_config_file) -- [Running playbook to deploy Hyperledger Fabric network](#run_network) +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) @@ -27,38 +27,26 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`) for adding new organization, all the existing organizations should have `org_status` tag as `existing` and the new organization should have `org_status` tag as `new` under `network.channels` e.g. - network: - channels: - - channel: - .. - .. - participants: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:65:139" +``` and under `network.organizations` as - network: - organizations: - - organization: - .. - .. - org_status: new # new for new organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:144:155" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml:406:414" + .. + .. + +``` The `network.yaml` file should contain the specific `network.organization` details along with the orderer information. -For reference, see `network-fabric-add-organization.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples). +For reference, see `network-fabric-add-organization.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml). ## Run playbook diff --git a/docs/source/guides/fabric/add-new-peer.md b/docs/source/guides/fabric/add-new-peer.md index ec79ee4a61e..7ecb7b05f6d 100644 --- a/docs/source/guides/fabric/add-new-peer.md +++ b/docs/source/guides/fabric/add-new-peer.md @@ -24,51 +24,30 @@ To add a new peer a fully configured Fabric network must be present already, i.e ## Modifying Configuration File -A Sample configuration file for adding new peer is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv-add-peer.yaml). Please go through this file and all the comments there and edit accordingly. +A Sample configuration file for adding new peer is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml). Please go through this file and all the comments there and edit accordingly. For generic instructions on the Fabric configuration file, refer [this guide](../networkyaml-fabric.md). While modifying the configuration file(`network.yaml`) for adding new peer, all the existing peers should have `peerstatus` tag as `existing` and the new peers should have `peerstatus` tag as `new` under `network.channels` e.g. - network: - channels: - - channel: - .. - .. - participants: - - organization: - peers: - - peer: - .. - .. - peerstatus: new # new for new peers(s) - gossipAddress: peer0.xxxx.com # gossip Address must be one existing peer - - peer: - .. - .. - peerstatus: existing # existing for existing peers(s) - +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml:60:87" +``` and under `network.organizations` as - network: - organizations: - - organization: - org_status: existing # org_status must be existing when adding peer +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml:94:103" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml:144:144" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml:153:159" + .. .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml:187:192" .. - services: - peers: - - peer: - .. - .. - peerstatus: new # new for new peers(s) - gossipAddress: peer0.xxxx.com # gossip Address must be one existing peer - - peer: - .. - .. - peerstatus: existing # existing for existing peers(s) - + .. +``` The `network.yaml` file should contain the specific `network.organization` details. Orderer information is needed if you are going to install/upgrade the existing chaincodes, otherwise it is not needed. And the `org_status` must be `existing` when adding peer. @@ -100,8 +79,8 @@ ansible-playbook platforms/hyperledger-fabric/configuration/add-peer.yaml --extr Use the same network.yaml if you need to install chaincode on the new peers. --- -**NOTE:** With Fabric 2.2 chaincode lifecyle, re-installing chaincode on new peer is not needed as when the blocks are synced, the new peer will have access to already committed chaincode. If still needed, you can upgrade the version of the chaincode and install on all peers. +**NOTE:** With Fabric 2.2 and 2.5 chaincode lifecyle, re-installing chaincode on new peer is not needed as when the blocks are synced, the new peer will have access to already committed chaincode. If still needed, you can upgrade the version of the chaincode and install on all peers. --- -Refer [this guide](./chaincode-operations.md) for details on installing chaincode. +Refer [Install chaincode guide](./chaincode-operations.md) or [Install external chaincode guide](./external-chaincode-operations.md) for details on installing chaincode. diff --git a/docs/source/guides/fabric/chaincode-operations.md b/docs/source/guides/fabric/chaincode-operations.md index fe89a1ca5ff..1cb85444447 100644 --- a/docs/source/guides/fabric/chaincode-operations.md +++ b/docs/source/guides/fabric/chaincode-operations.md @@ -23,44 +23,23 @@ The `network.yaml` file should contain the specific `network.organizations.servi For reference, following snippet shows that section of `network.yaml` -``` ---- -network: - .. - .. - organizations: - - organization: - name: manufacturer +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:241:248" + .. .. - .. - services: - peers: - - peer: - name: peer0 - .. - chaincodes: - - name: "chaincode_name" #This has to be replaced with the name of the chaincode - version: "chaincode_version" # This has to be different than the current version - maindirectory: "chaincode_main" #The main directory where chaincode is needed to be placed - repository: - username: "git_username" # Git Service user who has rights to check-in in all branches - password: "git_access_token" - url: "github.com/hyperledger/bevel.git" - branch: develop - path: "chaincode_src" #The path to the chaincode - arguments: 'chaincode_args' #Arguments to be passed along with the chaincode parameters - endorsements: "" #Endorsements (if any) provided along with the chaincode +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:297:297" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:304:338" ``` ## Chaincode Operations in Bevel for the deployed Hyperledger Fabric network The playbook [chaincode-ops.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/chaincode-ops.yaml) is used to install and instantiate chaincode for the existing fabric network. -For Fabric v2.2 multiple operations such as approve, commit and invoke the chaincode are available in the same playbook. +For Fabric v2.2 and 2.5 multiple operations such as approve, commit and invoke the chaincode are available in the same playbook. This can be done by using the following command ``` - ansible-playbook platforms/hyperledger-fabric/configuration/chaincode-ops.yaml --extra-vars "@path-to-network.yaml" +ansible-playbook platforms/hyperledger-fabric/configuration/chaincode-ops.yaml --extra-vars "@path-to-network.yaml" ``` --- diff --git a/docs/source/guides/fabric/deploy-fabric-operator.md b/docs/source/guides/fabric/deploy-fabric-operator.md index b4d92c2e0c1..f79df484570 100644 --- a/docs/source/guides/fabric/deploy-fabric-operator.md +++ b/docs/source/guides/fabric/deploy-fabric-operator.md @@ -27,9 +27,17 @@ Due to open issues with bevel-operator-fabric, it is not recommended for Product A Sample configuration file for deploying using bevel-operator-fabric is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-operator-fabric.yaml). Following are the main changes in this file from previous versions: 1. `network.env.type` must be `operator`. This is how Ansible will understand that bevel-operator-fabric will be used. -1. `network.env.proxy` must be `istio` as no other proxy is supported by bevel-operator-fabric. -1. Only `443` is supported as external port because that is what bevel-operator-fabric supports. -1. `vault` and `gitops` sections are removed as they are not applicable. +2. `network.env.proxy` must be `istio` as no other proxy is supported by bevel-operator-fabric. +3. Only `443` is supported as external port because that is what bevel-operator-fabric supports. +4. `vault` and `gitops` sections are removed as they are not applicable. + + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-operator-fabric.yaml:8:21" + .. + .. +``` + For generic instructions on the Fabric configuration file, refer [this guide](../networkyaml-fabric.md). @@ -44,7 +52,7 @@ ansible-playbook platforms/shared/configuration/site.yaml -e "@./build/network.y ``` The `site.yaml` playbook, in turn calls various playbooks depending on the configuration file and sets up your DLT/Blockchain network. -The [deploy-fabric-console.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/deploy-operator-network.yaml) playbook can be used as well if the pre-requisites like Istio and krew is already installed. This can be done using the following command +The [deploy-operator-network.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/deploy-operator-network.yaml) playbook can be used as well if the pre-requisites like Istio and krew is already installed. This can be done using the following command ``` ansible-playbook platforms/hyperledger-fabric/configuration/deploy-operator-network.yaml -e "@/path/to/network.yaml" diff --git a/docs/source/guides/fabric/deploy-operations-console.md b/docs/source/guides/fabric/deploy-operations-console.md index c3a1b4f403b..8d87483ae9f 100644 --- a/docs/source/guides/fabric/deploy-operations-console.md +++ b/docs/source/guides/fabric/deploy-operations-console.md @@ -29,6 +29,15 @@ If you want to create the JSON files automatically by using our ansible playbook A Sample configuration file for deploying Operations Console is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft.yaml). Main change being addition of a new key `organization.fabric_console` which when `enabled` will deploy the operations console for the organization. +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:151:166" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:340:350" + .. + .. +``` + For generic instructions on the Fabric configuration file, refer [this guide](../networkyaml-fabric.md). diff --git a/docs/source/guides/fabric/external-chaincode-operations.md b/docs/source/guides/fabric/external-chaincode-operations.md index 5a4399f6901..0fe9459d084 100644 --- a/docs/source/guides/fabric/external-chaincode-operations.md +++ b/docs/source/guides/fabric/external-chaincode-operations.md @@ -143,33 +143,7 @@ While modifying the configuration file (`network.yaml`), the following two secti - `crypto_mount_path`: If TLS is enabled, path to mount TLS certs and key in the chaincode server pod ```yaml - network: - channels: - - channel: - .. - .. - participants: - organizations: - - organization: - services: - peers: - name: - type: - gossippeeraddress: - cli: - grpc: - port: - chaincodes: - - name: "assettransfer" #This has to be replaced with the name of the chaincode - version: "1" #This has to be replaced with the version of the chaincode - external_chaincode: true - tls: true - buildpack_path: /home/bevel/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder - image: ghcr.io/hyperledger/bevel-samples-example:1.0 - arguments: '\"InitLedger\",\"\"' #Arguments to be passed along with the chaincode parameters - crypto_mount_path: /crypto # OPTIONAL | tls: true | Path where crypto shall be mounted for the chaincode server - .. - .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml:289:319" ``` ## Execute playbook diff --git a/docs/source/guides/fabric/remove-org.md b/docs/source/guides/fabric/remove-org.md index 2a66fdbe42e..87c9d3de0ad 100644 --- a/docs/source/guides/fabric/remove-org.md +++ b/docs/source/guides/fabric/remove-org.md @@ -6,9 +6,9 @@ # Removing an organization in Hyperledger Fabric - - [Prerequisites](#prerequisites) - - [Modifying Configuration File](#modifying-configuration-file) - - [Run playbook](#run-playbook) +- [Prerequisites](#prerequisites) +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) @@ -27,43 +27,30 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`) for removing an organization, all the existing organizations should have `org_status` tag as `existing` and to be deleted organization should have `org_status` tag as `delete` under `network.channels` e.g. - network: - channels: - - channel: - .. - .. - participants: - - organization: - .. - .. - org_status: delete # delete for to be deleted organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml:62:112" +``` and under `network.organizations` as - network: - organizations: - - organization: - .. - .. - org_status: delete # delete for to be deleted organization(s) - - organization: - .. - .. - org_status: existing # existing for old organization(s) +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml:117:128" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml:381:389" + .. + .. +``` The `network.yaml` file should contain the specific `network.organization` details along with the orderer information. -For reference, see `network-fabric-remove-organization.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples). +For reference, see `network-fabric-remove-organization.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml). ## Run playbook -The [remove-organization.yaml](https://github.com/hyperledger/bevel/platforms/hyperledger-fabric/configuration/remove-organization.yaml) playbook is used to remove organization(s) from the existing network. This can be done using the following command +The [remove-organization.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/remove-organization.yaml) playbook is used to remove organization(s) from the existing network. This can be done using the following command ``` ansible-playbook platforms/hyperledger-fabric/configuration/remove-organization.yaml --extra-vars "@path-to-network.yaml" diff --git a/docs/source/guides/fabric/setup-cactus-connector.md b/docs/source/guides/fabric/setup-cactus-connector.md index 6b42500daf8..f404bc84671 100644 --- a/docs/source/guides/fabric/setup-cactus-connector.md +++ b/docs/source/guides/fabric/setup-cactus-connector.md @@ -7,8 +7,8 @@ # Deploy Fabric Cactus connector - [Prerequisites](#prerequisites) -- [Modifying configuration file](#create_config_file) -- [Running playbook to deploy Hyperledger Fabric network](#run_network) +- [Modifying Configuration File](#modifying-configuration-file) +- [Run playbook](#run-playbook) @@ -27,31 +27,17 @@ Refer [this guide](../networkyaml-fabric.md) for details on editing the configur While modifying the configuration file(`network.yaml`)to deploy the cactus connector, all peers in member organizations should have `cactus_connector` tag as `enabled` e.g. - network: - organizations: - - organization: - type: peer +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:242:248" + .. + .. +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:297:297" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:304:312" .. .. - services: - peers: - - peer: - .. - .. - cactus_connector: enabled # set to enabled to create a cactus connector for Fabric - - - organization: - type: peer - .. - .. - services: - peers: - - peer: - .. - .. - cactus_connector: enabled # set to enabled to create a cactus connector for Fabric +``` -For reference, see `network-fabricv2.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples). +For reference, see `network-fabricv2.yaml` file [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml). diff --git a/docs/source/guides/fabric/upgrade-chaincode.md b/docs/source/guides/fabric/upgrade-chaincode.md index e10ca134835..b01e3c84f56 100644 --- a/docs/source/guides/fabric/upgrade-chaincode.md +++ b/docs/source/guides/fabric/upgrade-chaincode.md @@ -6,12 +6,11 @@ # Upgrading chaincode in Hyperledger Fabric -- [Upgrading chaincode in Hyperledger Fabric](#upgrading-chaincode-in-hyperledger-fabric) - - [Pre-requisites](#pre-requisites) - - [Modifying configuration file](#modifying-configuration-file) - - [Run playbook for Fabric version 1.4.x](#run-playbook-for-fabric-version-14x) - - [Run playbook for Fabric version 2.2.x](#run-playbook-for-fabric-version-22x) - - [Run playbook for Fabric version 2.2.x with external chaincode](#run-playbook-for-fabric-version-22x-with-external-chaincode) +- [Pre-requisites](#pre-requisites) +- [Modifying configuration file](#modifying-configuration-file) +- [Run playbook for Fabric version 1.4.x](#run-playbook-for-fabric-version-14x) +- [Run playbook for Fabric version 2.2.x](#run-playbook-for-fabric-version-22x) +- [Run playbook for Fabric version 2.2.x with external chaincode](#run-playbook-for-fabric-version-22x-with-external-chaincode) ## Pre-requisites @@ -26,35 +25,12 @@ The `network.yaml` file should contain the specific `network.organizations.servi For reference, following snippet shows that section of `network.yaml` -``` ---- -network: - .. - .. - organizations: - - organization: - name: manufacturer +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:242:248" + .. .. - .. - services: - peers: - - peer: - name: peer0 - .. - chaincodes: - - name: "chaincode_name" #This has to be replaced with the name of the chaincode - version: "chaincode_version" # This has to be greater than the current version, should be an integer. - sequence: "2" # sequence of the chaincode, update this only for chaincode upgrade depending on the last sequence - maindirectory: "chaincode_main" #The main directory where chaincode is needed to be placed - lang: "java" # The chaincode language, optional field with default vaule of 'go'. - repository: - username: "git_username" # Git Service user who has rights to check-in in all branches - password: "git_access_token" - url: "github.com/hyperledger/bevel.git" - branch: develop - path: "chaincode_src" #The path to the chaincode - arguments: 'chaincode_args' #Arguments to be passed along with the chaincode parameters - endorsements: "" #Endorsements (if any) provided along with the chaincode +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:297:297" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:304:338" ``` When the chaincode is an external service, `network.organizations.services.peers.chaincodes[*].upgrade_chaincode` variable must also be added to change the version. If only the sequence is modified, it isn't necessary to add this field. @@ -63,32 +39,12 @@ The sequence must be incremented in each execution regardless of whether the ver For reference, following snippet shows that section of `network.yaml` -``` ---- -network: - .. - .. - organizations: - - organization: - name: manufacturer +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml:227:233" + .. .. - .. - services: - peers: - - peer: - name: peer0 - .. - chaincodes: - - name: "chaincode_name" #This has to be replaced with the name of the chaincode - version: "2" #This has to be replaced with the version of the chaincode - sequence: "2" - external_chaincode: true - upgrade_chaincode: true - tls: true - buildpack_path: /home/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder # The path where buildpacks are locally stored - image: ghcr.io/hyperledger/bevel-samples-example:1.0 - arguments: '\"InitLedger\",\"\"' # Init Arguments to be passed which will mark chaincode as init-required - crypto_mount_path: /crypto # OPTIONAL | tls: true | Path where crypto shall be mounted for the chaincode server +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml:282:282" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml:289:321" ``` diff --git a/docs/source/guides/fabric/upgrade-network-1.4.x-2.2.x.md b/docs/source/guides/fabric/upgrade-network-1.4.x-2.2.x.md index 676f186903f..f7acd80f7a5 100755 --- a/docs/source/guides/fabric/upgrade-network-1.4.x-2.2.x.md +++ b/docs/source/guides/fabric/upgrade-network-1.4.x-2.2.x.md @@ -45,9 +45,10 @@ Update the network network.yaml [here](https://github.com/hyperledger/bevel/tree a. Set the required version tag under `network.version` for upgrading the base images of CA, orderer and peer. b. Add the upgrade flag to true For example: - network: - version: 2.2.2 - upgrade: true + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:8:16" +``` Note: The network.yaml should reflect the entire network which requires to be upgraded diff --git a/docs/source/guides/fabric/upgrade-network.md b/docs/source/guides/fabric/upgrade-network.md index 0d28d8b476b..ebcfa71da2d 100644 --- a/docs/source/guides/fabric/upgrade-network.md +++ b/docs/source/guides/fabric/upgrade-network.md @@ -34,17 +34,17 @@ For example, for Fabric v1.4.8, these are the image tags of the supporting docke The network.yaml [here](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml) should be updated with the required version tag under `network.version` for upgrading the base images of CA, orderer and peer. For example: - - network: - version: 1.4.8 +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:8:16" +``` 2 files need to be edited in order to support version change for kafka, zookeeper and couchDB | File | Fabric entity | Key | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------------| -| [orderer vars](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/roles/create/orderers/vars/main.yaml) | kafka | kafka_image_version | -| [orderer vars](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/roles/create/orderers/vars/main.yaml) | zookeeper | zookeeper_image_version | -| [peer vars](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/roles/create/peers/vars/main.yaml) | couchDB | couchdb_image_version | +| [orderer vars](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/roles/helm_component/vars/main.yaml#L35) | kafka | kafka_image | +| [orderer vars](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/roles/helm_component/vars/main.yaml#L36) | zookeeper | zookeeper_image | +| [peer vars](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/roles/helm_component/vars/main.yaml#L53) | couchDB | couchdb_image | ## Executing Ansible playbook The playbook [site.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/shared/configuration/site.yaml) ([ReadMe](https://github.com/hyperledger/bevel/tree/main/platforms/shared/configuration/)) can be run after the configuration file (for example: [network.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml) for Fabric) has been updated. diff --git a/docs/source/guides/networkyaml-fabric.md b/docs/source/guides/networkyaml-fabric.md index 46f7a346360..4460825d728 100644 --- a/docs/source/guides/networkyaml-fabric.md +++ b/docs/source/guides/networkyaml-fabric.md @@ -4,64 +4,66 @@ [//]: # (##############################################################################################) # Configuration file specification: Hyperledger-Fabric -A network.yaml file is the base configuration file designed in Hyperledger Bevel for setting up a Fabric DLT network. This file contains all the information related to the infrastructure and network specifications. Below shows its structure. -![](./../_static/TopLevelClass-Fabric.png) +A network.yaml file is the base configuration file designed in Hyperledger Bevel for setting up a Fabric DLT network. This file contains all the information related to the infrastructure and network specifications. -Before setting up a Fabric DLT/Blockchain network, this file needs to be updated with the required specifications. -A sample configuration file is provided in the repo path: -`platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml` +??? note "Schema Definition" -A json-schema definition is provided in `platforms/network-schema.json` to assist with semantic validations and lints. You can use your favorite yaml lint plugin compatible with json-schema specification, like `redhat.vscode-yaml` for VSCode. You need to adjust the directive in template located in the first line based on your actual build directory: + A json-schema definition is provided in `platforms/network-schema.json` to assist with semantic validations and lints. You can use your favorite yaml lint plugin compatible with json-schema specification, like `redhat.vscode-yaml` for VSCode. You need to adjust the directive in template located in the first line based on your actual build directory: -`# yaml-language-server: $schema=../platforms/network-schema.json` + `# yaml-language-server: $schema=../platforms/network-schema.json` The configurations are grouped in the following sections for better understanding. -* type +* [type](#type) + +* [version](#version) -* version +* [frontend](#frontend) -* docker +* [env](#env) -* frontend +* [frontend](#frontend) -* env +* [docker](#docker) -* consensus +* [consensus](#consensus) -* orderers +* [orderers](#orderers) -* channels +* [channels](#channels) -* organizations +* [organizations](#organizations) -Here is the snapshot from the sample configuration file -![](./../_static/NetworkYamlFabric1.png) +Before setting up a Fabric DLT/Blockchain network, this file needs to be updated with the required specifications. -The sections in the sample configuration file are: +Use this [sample configuration file](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml) as a base. -`type` defines the platform choice like corda/fabric, here in the example its Fabric +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:7:14" +``` -`version` defines the version of platform being used. The current Fabric version support is 1.4.8, 2.2.2 & 2.5.4 + +type +: `type` defines the platform choice like corda/fabric/quorum, here in the example its **Fabric**. -`frontend` is a flag which defines if frontend is enabled for nodes or not. Its value can only be enabled/disabled. This is only applicable if the sample Supplychain App is being installed. + +version +: `version` defines the version of platform being used. The current Fabric version support is 1.4.8, 2.2.2 & 2.5.4 -`env` section contains the environment type. Value for proxy field under this section can be 'none' or 'haproxy' + +frontend +: `frontend` s a flag which defines if frontend is enabled for nodes or not. Its value can only be enabled/disabled. This is only applicable if the sample Supplychain App is being installed. + + +env +: `env` section contains the environment type. Value for proxy field under this section can be 'none' or 'haproxy' The snapshot of the `env` section with example value is below -```yaml - env: - type: "dev" # tag for the environment. Important to run multiple flux on single cluster - proxy: haproxy # values can be 'haproxy' or 'none' - retry_count: 100 # Retry count for the checks - external_dns: enabled # Should be enabled if using external-dns for automatic route configuration - annotations: # Additional annotations that can be used for some pods (ca, ca-tools, orderer and peer nodes) - service: - - example1: example2 - deployment: {} - pvc: {} + +```yaml +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:19:28" ``` The fields under `env` section are @@ -73,18 +75,17 @@ The fields under `env` section are |external_dns | If the cluster has the external DNS service, this has to be set `enabled` so that the hosted zone is automatically updated. | |annotations| Use this to pass additional annotations to the `service`, `deployment` and `pvc` elements of Kubernetes| -`docker` section contains the credentials of the repository where all the required images are built and stored. + + +docker +: `docker` section contains the credentials of the container registry where all the required images are stored. The snapshot of the `docker` section with example values is below + ```yaml - # Docker registry details where images are stored. This will be used to create k8s secrets - # Please ensure all required images are built and stored in this registry. - # Do not check-in docker_password. - docker: - url: "docker_url" - username: "docker_username" - password: "docker_password" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:34:40" ``` + The fields under `docker` section are | Field | Description | @@ -97,43 +98,30 @@ The fields under `docker` section are Please follow [these instructions](../getting-started/configure-prerequisites.md#docker) to build and store the docker images before running the Ansible playbooks. -`consensus` section contains the consensus service that uses the orderers provided in the following `orderers` section. + +consensus +: `consensus` section contains the consensus service that uses the orderers provided in the following `orderers` section. ```yaml - consensus: - name: raft +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:44:45" ``` + The fields under the each `consensus` are | Field | Description | |-------------|----------------------------------------------------------| -| name | Name of the Consensus service. Can be `raft` or `kafka`. | +| name | Name of the Consensus service. Can be `raft` or `kafka`. | -`orderers` section contains a list of orderers with variables which will expose it for the network. + +orderers +: `orderers` section contains a list of orderers with variables which will expose it for the network. The snapshot of the `orderers` section with example values is below + ```yaml - # Remote connection information for orderer (will be blank or removed for orderer hosting organization) - orderers: - - orderer: - type: orderer - name: orderer1 - org_name: supplychain #org_name should match one organization definition below in organizations: key - uri: orderer1.org1ambassador.blockchaincloudpoc.com:443 # Must include port, Can be external or internal URI for orderer which should be reachable by all peers - certificate: /home/bevel/build/orderer1.crt # Ensure that the directory exists - - orderer: - type: orderer - name: orderer2 - org_name: supplychain #org_name should match one organization definition below in organizations: key - uri: orderer2.org1ambassador.blockchaincloudpoc.com:443 # Must include port, Can be external or internal URI for orderer which should be reachable by all peers - certificate: /home/bevel/build/orderer2.crt # Ensure that the directory exists - - orderer: - type: orderer - name: orderer3 - org_name: supplychain #org_name should match one organization definition below in organizations: key - uri: orderer3.org1ambassador.blockchaincloudpoc.com:443 # Must include port, Can be external or internal URI for orderer which should be reachable by all peers - certificate: /home/bevel/build/orderer3.crt # Ensure that the directory exists +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:46:64" ``` + The fields under the each `orderer` are | Field | Description | @@ -144,96 +132,17 @@ The fields under the each `orderer` are | uri | Orderer URL which is accessible by all Peers. This must include the port even when running on 443 | | certificate | Path to orderer certificate. For inital network setup, ensure that the directory is present, the file need not be present. For adding a new organization, ensure that the file is the crt file of the orderer of the existing network. | -The `channels` sections contains the list of channels mentioning the participating peers of the organizations. + + +channels +: The `channels` sections contains the list of channels mentioning the participating peers of the organizations. The snapshot of channels section with its fields and sample values is below ```yaml - # The channels defined for a network with participating peers in each channel - channels: - - channel: - consortium: SupplyChainConsortium - channel_name: AllChannel - osn_creator_org: - name: supplychain - chaincodes: - - "chaincode_name" - orderers: - - supplychain - participants: - - organization: - name: carrier - type: creator # creator organization will create the channel and instantiate chaincode, in addition to joining the channel and install chaincode - org_status: new - peers: - - peer: - name: peer0 - gossipAddress: peer0.carrier-net.org3ambassador.blockchaincloudpoc.com:443 # Must include port, External or internal URI of the gossip peer - peerAddress: peer0.carrier-net.org3ambassador.blockchaincloudpoc.com:443 # Must include port, External URI of the peer - ordererAddress: orderer1.org1ambassador.blockchaincloudpoc.com:443 # Must include port, External or internal URI of the orderer - - organization: - name: store - type: joiner # joiner organization will only join the channel and install chaincode - org_status: new - peers: - - peer: - name: peer0 - gossipAddress: peer0.store-net.org4ambassador.blockchaincloudpoc.com:443 - peerAddress: peer0.store-net.org4ambassador.blockchaincloudpoc.com:443 # Must include port, External URI of the peer - ordererAddress: orderer1.org1ambassador.blockchaincloudpoc.com:443 - - organization: - name: warehouse - type: joiner - org_status: new - peers: - - peer: - name: peer0 - gossipAddress: peer0.warehouse-net.org5ambassador.blockchaincloudpoc.com:443 - peerAddress: peer0.warehouse-net.org5ambassador.blockchaincloudpoc.com:443 # Must include port, External URI of the peer - ordererAddress: orderer1.org1ambassador.blockchaincloudpoc.com:443 - - organization: - name: manufacturer - type: joiner - org_status: new - peers: - - peer: - name: peer0 - gossipAddress: peer0.manufacturer-net.org2ambassador.blockchaincloudpoc.com:443 - peerAddress: peer0.manufacturer-net.org2ambassador.blockchaincloudpoc.com:443 # Must include port, External URI of the peer - ordererAddress: orderer1.org1ambassador.blockchaincloudpoc.com:443 - endorsers: - # Only one peer per org required for endorsement - - organization: - name: carrier - peers: - - peer: - name: peer0 - corepeerAddress: peer0.carrier-net.org3ambassador.blockchaincloudpoc.com:443 - certificate: "/path/ca.crt" # certificate path for peer - - organization: - name: warehouse - peers: - - peer: - name: peer0 - corepeerAddress: peer0.warehouse-net.org5ambassador.blockchaincloudpoc.com:443 - certificate: "/path/ca.crt" # certificate path for peer - - organization: - name: manufacturer - peers: - - peer: - name: peer0 - corepeerAddress: peer0.manufacturer-net.org2ambassador.blockchaincloudpoc.com:443 - certificate: "/path/ca.crt" # certificate path for peer - - organization: - name: store - peers: - - peer: - name: peer0 - corepeerAddress: peer0.store-net.org4ambassador.blockchaincloudpoc.com:443 - certificate: "/path/ca.crt" # certificate path for peer - genesis: - name: OrdererGenesis +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:66:149" ``` + The fields under the `channel` are | Field | Description | @@ -269,28 +178,20 @@ Each `organization` field under `endorsers` field of the channel contains the fo | peer.corepeerAddress | Endorsers addresses, including port | | peer.certificate | Certificate path for peer | -The `organizations` section contains the specifications of each organization. + + + +organizations +: The `organizations` section contains the specifications of each organization. In the sample configuration example, we have five organization under the `organizations` section The snapshot of an organization field with sample values is below + ```yaml - organizations: - # Specification for the 1st organization. Each organization maps to a VPC and a separate k8s cluster - - organization: - name: supplychain - country: UK - state: London - location: London - subject: "O=Orderer,L=51.50/-0.13/London,C=GB" - type: orderer - external_url_suffix: org1ambassador.blockchaincloudpoc.com - org_status: new - ca_data: - url: ca.supplychain-net:7054 - certificate: file/server.crt # This has not been implemented - cloud_provider: aws # Options: aws, azure, gcp, digitalocean, minikube +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:154:171" ``` + Each `organization` under the `organizations` section has the following fields. | Field | Description | @@ -313,16 +214,9 @@ Each `organization` under the `organizations` section has the following fields. | services | Contains list of services which could ca/peer/orderers/concensus based on the type of organization | For the aws and k8s field the snapshot with sample values is below + ```yaml - aws: - access_key: "" # AWS Access key, only used when cloud_provider=aws - secret_key: "" # AWS Secret key, only used when cloud_provider=aws - - # Kubernetes cluster deployment variables. - k8s: - region: "" - context: "" - config_file: "" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:172:181" ``` The `aws` field under each organization contains: (This will be ignored if cloud_provider is not 'aws') @@ -341,19 +235,9 @@ The `k8s` field under each organization contains | config_file | Path to the kubernetes cluster configuration file | For gitops fields the snapshot from the sample configuration file with the example values is below + ```yaml - # Git Repo details which will be used by GitOps/Flux. - gitops: - git_protocol: "https" # Option for git over https or ssh - git_url: "https://github.com//bevel.git" # Gitops htpps or ssh url for flux value files - branch: "" # Git branch where release is being made - release_dir: "platforms/hyperledger-fabric/releases/dev" # Relative Path in the Git repo for flux sync per environment. - chart_source: "platforms/hyperledger-fabric/charts" # Relative Path where the Helm charts are stored in Git repo - git_repo: "github.com//bevel.git" # without https:// - username: "" # Git Service user who has rights to check-in in all branches - password: "" # Git Server user password/personal token (Optional for ssh; Required for https) - email: "" # Email to use in git config - private_key: "" # Path to private key (Optional for https; Required for ssh) +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:189:201" ``` The gitops field under each organization contains @@ -372,15 +256,11 @@ The gitops field under each organization contains | private_key | Path to the private key file which has write-access to the git repo (Optional for https; Required for ssh) | For Hyperledger Fabric, you can also generate different user certificates and pass the names and attributes in the specific section for `users`. This is only applicable if using Fabric CA. An example is below: + ```yaml - # Generating User Certificates with custom attributes using Fabric CA in BAF for Peer Organizations - users: - - user: - identity: user1 - attributes: - - key: "hf.Revoker" - value: "true" +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:288:294" ``` + The fields under `user` are | Field | Description | @@ -392,17 +272,11 @@ The fields under `user` are The services field for each organization under `organizations` section of Fabric contains list of `services` which could be ca/orderers/consensus/peers based on if the type of organization. Each organization will have a CA service under the service field. The snapshot of CA service with example values is below + ```yaml - # Services maps to the pods that will be deployed on the k8s cluster - # This sample is an orderer service and includes a zk-kafka consensus - services: - ca: - name: ca - subject: "/C=GB/ST=London/L=London/O=Orderer/CN=ca.supplychain-net" - type: ca - grpc: - port: 7054 +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:203:211" ``` + The fields under `ca` service are | Field | Description | @@ -414,44 +288,11 @@ The fields under `ca` service are Each organization with type as peer will have a peers service. The snapshot of peers service with example values is below + ```yaml - peers: - - peer: - name: peer0 - type: anchor # This can be anchor/nonanchor. Atleast one peer should be anchor peer. - gossippeeraddress: peer0.manufacturer-net:7051 # Internal Address of the other peer in same Org for gossip, same peer if there is only one peer - peerAddress: peer0.carrier-net.org3ambassador.blockchaincloudpoc.com:443 # Must include port, External URI of the peer - certificate: /path/manufacturer/peer0.crt # Path to peer Certificate - cli: disabled # Creates a peer cli pod depending upon the (enabled/disabled) - configpath: /path/to/peer0-core.yaml # path to custom core.yaml tag. - grpc: - port: 7051 - events: - port: 7053 - couchdb: - port: 5984 - restserver: # This is for the rest-api server - targetPort: 20001 - port: 20001 - expressapi: # This is for the express api server - targetPort: 3000 - port: 3000 - chaincodes: - - name: "chaincode_name" #This has to be replaced with the name of the chaincode - version: "chaincode_version" #This has to be replaced with the version of the chaincode - maindirectory: "chaincode_main" #The main directory where chaincode is needed to be placed - repository: - username: "git_username" # Git Service user who has rights to check-in in all branches - password: "git_access_token" - url: "github.com/hyperledger/bevel.git" - branch: develop - path: "chaincode_src" #The path to the chaincode - arguments: 'chaincode_args' #Arguments to be passed along with the chaincode parameters - endorsements: "" #Endorsements (if any) provided along with the chaincode - metrics: - enabled: true # Enable/disable metrics collector for prometheus - port: 9443 # metrics port - internal to the cluster +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:304:338" ``` + The fields under `peer` service are | Field | Description | @@ -495,14 +336,11 @@ The chaincodes section contains the list of chaincode for the peer, the fields u | crypto_mount_path | Required only when `tls: true`, the path where the crypto materials will be stored | The organization with orderer type will have concensus service. The snapshot of consensus service with example values is below + ```yaml - consensus: - name: raft - type: broker #This field is not consumed for raft consensus - replicas: 4 #This field is not consumed for raft consensus - grpc: - port: 9092 #This field is not consumed for raft consensus +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:213:214" ``` + The fields under `consensus` service are | Field | Description | @@ -513,35 +351,11 @@ The fields under `consensus` service are | grpc.port | Only for `kafka`. Grpc port of consensus service | The organization with orderer type will have orderers service. The snapshot of orderers service with example values is below + ```yaml - orderers: - # This sample has multiple orderers as an example. - # You can use a single orderer for most production implementations. - - orderer: - name: orderer1 - type: orderer - consensus: raft - grpc: - port: 7050 - ordererAddress: orderer1.org1ambassador.blockchaincloudpoc.com:443 - - orderer: - name: orderer2 - type: orderer - consensus: raft - grpc: - port: 7050 - ordererAddress: orderer2.org1ambassador.blockchaincloudpoc.com:443 - - orderer: - name: orderer3 - type: orderer - consensus: raft - grpc: - port: 7050 - ordererAddress: orderer3.org1ambassador.blockchaincloudpoc.com:443 - metrics: - enabled: true # Enable/disable metrics collector for prometheus - port: 9443 # metrics port - internal to the cluster +--8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml:215:239" ``` + The fields under `orderer` service are | Field | Description | diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml index 166347992ae..6a02eebf063 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-new-channel.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml index 5b606b1678a..99424a65ae5 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-ordererorg.yaml @@ -14,7 +14,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 #Addition of ordrer organization only works for 2.2.2 + version: 2.2.2 #Addition of ordrer organization works for 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml index 4c8853b5923..65ef1b55687 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-organization.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml index 0ce83ed16ea..24da0562f21 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabric-add-peer.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers #Environment section for Kubernetes setup diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml index df1dc6e7c70..f0ffe9b1dd0 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabric-remove-organization.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to remove an organization from existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml index e92ec77618c..b12d70a544b 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-external-chaincode.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers @@ -310,9 +310,11 @@ network: chaincodes: - name: "assettransfer" # This has to be replaced with the name of the chaincode version: "1" # This has to be replaced with the version of the chaincode + sequence: "1" # Sequence of the chaincode, update this only for chaincode upgrade external_chaincode: true init_required: false tls: true + upgrade_chaincode: false buildpack_path: /home/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder # The path where buildpacks are locally stored image: ghcr.io/hyperledger/bevel-samples-example:1.0 arguments: '\"InitLedger\",\"\"' # Init Arguments to be passed which will mark chaincode as init-required @@ -402,9 +404,11 @@ network: chaincodes: - name: "assettransfer" # This has to be replaced with the name of the chaincode version: "1" # This has to be replaced with the version of the chaincode + sequence: "1" # Sequence of the chaincode, update this only for chaincode upgrade external_chaincode: true init_required: false tls: true + upgrade_chaincode: false buildpack_path: /home/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder # The path where buildpacks are locally stored image: ghcr.io/hyperledger/bevel-samples-example:1.0 arguments: '\"InitLedger\",\"\"' # Init Arguments to be passed which will mark chaincode as init-required @@ -494,9 +498,11 @@ network: chaincodes: - name: "assettransfer" # This has to be replaced with the name of the chaincode version: "1" # This has to be replaced with the version of the chaincode + sequence: "1" # Sequence of the chaincode, update this only for chaincode upgrade external_chaincode: true init_required: false tls: true + upgrade_chaincode: false buildpack_path: /home/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder # The path where buildpacks are locally stored image: ghcr.io/hyperledger/bevel-samples-example:1.0 arguments: '\"InitLedger\",\"\"' # Init Arguments to be passed which will mark chaincode as init-required @@ -579,10 +585,11 @@ network: chaincodes: - name: "assettransfer" # This has to be replaced with the name of the chaincode version: "1" # This has to be replaced with the version of the chaincode + sequence: "1" # Sequence of the chaincode, update this only for chaincode upgrade external_chaincode: true init_required: false tls: true - upgrade_chaincode: true + upgrade_chaincode: false buildpack_path: /home/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder # The path where buildpacks are locally stored image: ghcr.io/hyperledger/bevel-samples-example:1.0 arguments: '\"InitLedger\",\"\"' # Init Arguments to be passed which will mark chaincode as init-required diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml index 1aaab440b31..773b86353d9 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml @@ -11,7 +11,7 @@ network: # Network level configuration specifies the attributes required for each organization # to join an existing network. type: fabric - version: 2.2.2 # currently tested 1.4.8 and 2.2.2 + version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 frontend: enabled #Flag for frontend to enabled for nodes/peers diff --git a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml index de34d8340e8..3c50f15c7dc 100644 --- a/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml +++ b/platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml @@ -12,7 +12,7 @@ network: # to join an existing network. type: fabric version: 2.2.2 # currently tested 1.4.8, 2.2.2 and 2.5.4 - + upgrade: false # true : To upgrading Hyperledger Fabric version from 1.4.x to 2.2.x frontend: enabled #Flag for frontend to enabled for nodes/peers #Environment section for Kubernetes setup diff --git a/platforms/shared/configuration/site.yaml b/platforms/shared/configuration/site.yaml index 732de7c6baf..c621744d79b 100755 --- a/platforms/shared/configuration/site.yaml +++ b/platforms/shared/configuration/site.yaml @@ -32,7 +32,7 @@ - network.type == 'fabric' - network.env.type != 'operator' - (reset is undefined or reset == 'false') - - (network.upgrade is not defined) + - (network.upgrade is not defined or network.upgrade == false) - import_playbook: "{{ playbook_dir }}/../../hyperledger-fabric/configuration/deploy-operator-network.yaml" vars: @@ -41,7 +41,7 @@ - network.type == 'fabric' - network.env.type == 'operator' - (reset is undefined or reset == 'false') - - (network.upgrade is not defined) + - (network.upgrade is not defined or network.upgrade == false) # Upgrade network - import_playbook: "{{ playbook_dir }}/../../hyperledger-fabric/configuration/upgrade-network.yaml" @@ -51,7 +51,7 @@ - network.type == 'fabric' - network.env.type != 'operator' - (reset is undefined or reset == 'false') - - (network.upgrade is defined) + - (network.upgrade is defined and network.upgrade == true) ############################################ # Playbook for R3 Corda Operations