diff --git a/docs/source/tutorials/building.rst b/docs/source/tutorials/building.rst index c3a5715a..04c1e796 100644 --- a/docs/source/tutorials/building.rst +++ b/docs/source/tutorials/building.rst @@ -173,7 +173,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 01-create-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml" + ansible-playbook 01-create-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml" --extra-vars "@common-vars.yml" | This playbook creates the components for the ordering organization `Ordering Org`. It makes use of the Ansible role `ordering_organization <../roles/ordering_organization.html>`_ to set up the certificate authority, organization (MSP) and ordering service for this organization, along with the administrator identities for this organization. @@ -184,7 +184,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 02-create-endorsing-organization-components.yml --extra-vars "@org1-vars.yml" + ansible-playbook 02-create-endorsing-organization-components.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook creates the components for the endorsing organization `Org1`. It makes use of the Ansible role `endorsing_organization <../roles/endorsing_organization.html>`_ to set up the certificate authority, organization (MSP) and peer for this organization, along with the administrator identities for this organization. @@ -195,7 +195,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 03-export-organization.yml --extra-vars "@org1-vars.yml" + ansible-playbook 03-export-organization.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `organization_info <../modules/organization_info.html>`_ to export the organization `Org1` to a file. This is so that `Org1` can pass this file to the ordering organization `Ordering Org`. `Ordering Org` can then import this file into their IBM Blockchain Platform console, so they can add `Org1` into the consortium for the ordering service. @@ -208,7 +208,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 04-import-organization.yml --extra-vars "@ordering-org-vars.yml" + ansible-playbook 04-import-organization.yml --extra-vars "@ordering-org-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `external_organization <../modules/external_organization.html>`_ to import the organization `Org1` from a file. This file was passed to `Ordering Org` by `Org1`, so that `Ordering Org` could add `Org1` into the consortium for the ordering service. @@ -221,7 +221,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 05-add-organization-to-consortium.yml --extra-vars "@ordering-org-vars.yml" + ansible-playbook 05-add-organization-to-consortium.yml --extra-vars "@ordering-org-vars.yml" --extra-vars "@common-vars.yml" | This playbook adds the organization `Org1` into the consortium for the ordering service. It uses the Ansible modules `channel_config <../modules/channel_config.html>`_ and `consortium_member <../modules/consortium_member.html>`_ to update the system channel configuration, which contains the list of consortium members. @@ -232,7 +232,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 06-export-ordering-service.yml --extra-vars "@ordering-org-vars.yml" + ansible-playbook 06-export-ordering-service.yml --extra-vars "@ordering-org-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `ordering_service_info <../modules/ordering_service_info.html>`_ to export the ordering service to a file. This is so that `Ordering Org` can pass this file to the organization `Org1`. `Org1` can then import this file into their IBM Blockchain Platform console, so they can start to create channels on the ordering service. @@ -245,7 +245,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 07-import-ordering-service.yml --extra-vars "@org1-vars.yml" + ansible-playbook 07-import-ordering-service.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `external_ordering_service <../modules/external_ordering_service.html>`_ to import the ordering service from a file. This file was passed to `Org1` by `Ordering Org`, so that `Org1` could start to create channels on the ordering service. @@ -258,7 +258,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 08-create-channel.yml --extra-vars "@org1-vars.yml" + ansible-playbook 08-create-channel.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook creates a channel called `mychannel` on the ordering service. The channel contains a single organization, `Org1`. The policies for this channel are supplied in policy files: @@ -276,7 +276,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 09-join-peer-to-channel.yml --extra-vars "@org1-vars.yml" + ansible-playbook 09-join-peer-to-channel.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `channel_block <../modules/channel_block.html>`_ to fetch the genesis block for the channel, before using the Ansible module `peer_channel <../modules/peer_channel.html>`_ to join the peer `Org1 Peer` to the channel. @@ -287,7 +287,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 10-add-anchor-peer-to-channel.yml --extra-vars "@org1-vars.yml" + ansible-playbook 10-add-anchor-peer-to-channel.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook updates the organization (MSP) definition for `Org1` in the channel `mychannel` to specify that the peer `Org1 Peer` is an anchor peer for the channel. It uses the Ansible modules `channel_config <../modules/channel_config.html>`_ and `channel_member <../modules/channel_member.html>`_ to update the channel configuration. @@ -300,7 +300,7 @@ Finally, there are also two Ansible playbooks that can be used to destroy the ne :: - ansible-playbook 97-delete-endorsing-organization-components.yml --extra-vars "@org1-vars.yml" + ansible-playbook 97-delete-endorsing-organization-components.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook deletes the components for the endorsing organization `Org1`. It makes use of the Ansible role `endorsing_organization <../roles/endorsing_organization.html>`_ to remove the certificate authority, organization (MSP) and peer for this organization, along with the administrator identities for this organization. @@ -313,7 +313,7 @@ Finally, there are also two Ansible playbooks that can be used to destroy the ne :: - ansible-playbook 99-delete-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml" + ansible-playbook 99-delete-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml" --extra-vars "@common-vars.yml" | This playbook deletes the components for the ordering organization `Ordering Org`. It makes use of the Ansible role `ordering_organization <../roles/ordering_organization.html>`_ to remove up the certificate authority, organization (MSP) and ordering service for this organization, along with the administrator identities for this organization. diff --git a/docs/source/tutorials/deploying.rst b/docs/source/tutorials/deploying.rst index 87e911e3..60f76ba9 100644 --- a/docs/source/tutorials/deploying.rst +++ b/docs/source/tutorials/deploying.rst @@ -43,10 +43,26 @@ If you have installed the collection by building a Docker image, then run the sc docker run --rm -v "$PWD:/tutorials" mydockerorg/ansible /tutorials/deploy_smart_contract.sh +Exploring the network +--------------------- + +The Ansible playbooks that you just ran installed the FabCar smart contract onto the peers `Org1 Peer` and `Org2 Peer`. The Ansible playbooks also instantiated the FabCar smart contract on the channel `mychannel`. + +At this point, the FabCar smart contract is deployed and ready for applications to connect to the network and submit transactions. An application that wishes to connect to the network requires two things: an identity and a connection profile. The connection profile is a JSON document that provides the application with a list of endpoints or URLs that the application can use to connect to the network. + +The Ansible playbooks registered an application identity for each organization. The organization `Org1` has an application identity named `org1app`, with an enrollment secret of `org1apppw`. The organization `Org2` has an application identity named `org2app`, with an enrollment secret of `org2apppw`. You can use this information to enroll the identity against the respective organizations certificate authority, `Org1 CA` or `Org2 CA`. + +The Ansible playbooks created a connection profile for each organization. These connection profiles are created on disk, as JSON files in the same directory as the playbooks. The connection profiles are: + +- `Org1 Gateway.json` +- `Org2 Gateway.json` + +An application that uses one of the available Fabric SDKs (Go, Java, or Node.js) can use the identity and connection profile for an organization to connect to the network and submit a transaction. You could also try using the `IBM Blockchain Platform extension for Visual Studio Code `_ to connect to the network and submit a transaction. + Exploring the playbooks ----------------------- -When you ran the script `join_network.sh`, you ran multiple Ansible playbooks. Each Ansible playbook performed a different part of joining the network. This section will explain which organization ran each Ansible playbook, and what each of the playbooks did. +When you ran the script `deploy_smart_contract.sh`, you ran multiple Ansible playbooks. Each Ansible playbook performed a different part of deploying the smart contract. This section will explain which organization ran each Ansible playbook, and what each of the playbooks did. Here are the Ansible playbooks that were executed by the script above: @@ -57,7 +73,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 18-install-chaincode.yml --extra-vars "@org1-vars.yml" + ansible-playbook 18-install-chaincode.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `installed_chaincode <../modules/installed_chaincode.html>`_ to install the FabCar smart contract onto the peer `Org1 Peer`. @@ -68,7 +84,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 19-install-chaincode.yml --extra-vars "@org2-vars.yml" + ansible-playbook 19-install-chaincode.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `installed_chaincode <../modules/installed_chaincode.html>`_ to install the FabCar smart contract onto the peer `Org2 Peer`. @@ -79,6 +95,28 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 20-instantiate-chaincode.yml --extra-vars "@org1-vars.yml" + ansible-playbook 20-instantiate-chaincode.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" + + | This playbook uses the Ansible module `instantiated_chaincode <../modules/instantiated_chaincode.html>`_ to instantiate the FabCar smart contract on the channel `mychannel`. + +* `21-register-application.yml `_ + + | Organization: Org1 + | Command: + + :: + + ansible-playbook 21-register-application.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" + + | This playbook uses the Ansible module `registered_identity <../modules/registered_identity.html>`_ to register a new identity in the certificate authority `Org1 CA`. This playbook also uses the Ansible module `connection_profile <../modules/connection_profile.html>`_ to create a connection profile for the organization `Org1`. The identity and the connection profile can be used by the organizations FabCar applications to interact with the network and smart contract. + +* `22-register-application.yml `_ + + | Organization: Org2 + | Command: + + :: + + ansible-playbook 22-register-application.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" - | This playbook uses the Ansible module `instantiated_chaincode <../modules/instantiated_chaincode.html>`_ to instantiate the FabCar smart contract on the channel `mychannel`. \ No newline at end of file + | This playbook uses the Ansible module `registered_identity <../modules/registered_identity.html>`_ to register a new identity in the certificate authority `Org2 CA`. This playbook also uses the Ansible module `connection_profile <../modules/connection_profile.html>`_ to create a connection profile for the organization `Org2`. The identity and the connection profile can be used by the organizations FabCar applications to interact with the network and smart contract. \ No newline at end of file diff --git a/docs/source/tutorials/joining.rst b/docs/source/tutorials/joining.rst index b48fc5b4..4e6297c0 100644 --- a/docs/source/tutorials/joining.rst +++ b/docs/source/tutorials/joining.rst @@ -140,7 +140,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 11-create-endorsing-organization-components.yml --extra-vars "@org2-vars.yml" + ansible-playbook 11-create-endorsing-organization-components.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook creates the components for the endorsing organization `Org2`. It makes use of the Ansible role `endorsing_organization <../roles/endorsing_organization.html>`_ to set up the certificate authority, organization (MSP) and peer for this organization, along with the administrator identities for this organization. @@ -151,7 +151,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 12-export-organization.yml --extra-vars "@org2-vars.yml" + ansible-playbook 12-export-organization.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `organization_info <../modules/organization_info.html>`_ to export the organization `Org2` to a file. This is so that `Org2` can pass this file to the endorsing organization `Org1`. `Org1` can then import this file into their IBM Blockchain Platform console, so they can add `Org2` into the existing channel `mychannel`. @@ -164,7 +164,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 13-import-organization.yml --extra-vars "@org1-vars.yml" + ansible-playbook 13-import-organization.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `external_organization <../modules/external_organization.html>`_ to import the organization `Org2` from a file. This file was passed to `Org1` by `Org2`, so that `Org1` could add `Org2` into the existing channel `mychannel`. @@ -177,7 +177,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 14-add-organization-to-channel.yml --extra-vars "@org1-vars.yml" + ansible-playbook 14-add-organization-to-channel.yml --extra-vars "@org1-vars.yml" --extra-vars "@common-vars.yml" | This playbook adds the organization `Org2` into the existing channel `Org1`. The channel now contains two organizations, `Org1` and `Org2`. The policies for this channel are updated, using new policies that are supplied in policy files: @@ -195,7 +195,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 15-import-ordering-service.yml --extra-vars "@org2-vars.yml" + ansible-playbook 15-import-ordering-service.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `external_ordering_service <../modules/external_ordering_service.html>`_ to import the ordering service from a file. This file was passed to `Org2` by `Org1`, so that `Org2` could start to join channels on the ordering service. @@ -208,7 +208,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 16-join-peer-to-channel.yml --extra-vars "@org2-vars.yml" + ansible-playbook 16-join-peer-to-channel.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook uses the Ansible module `channel_block <../modules/channel_block.html>`_ to fetch the genesis block for the channel, before using the Ansible module `peer_channel <../modules/peer_channel.html>`_ to join the peer `Org2 Peer` to the channel. @@ -219,7 +219,7 @@ Here are the Ansible playbooks that were executed by the script above: :: - ansible-playbook 17-add-anchor-peer-to-channel.yml --extra-vars "@org2-vars.yml" + ansible-playbook 17-add-anchor-peer-to-channel.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook updates the organization (MSP) definition for `Org2` in the channel `mychannel` to specify that the peer `Org2 Peer` is an anchor peer for the channel. It uses the Ansible modules `channel_config <../modules/channel_config.html>`_ and `channel_member <../modules/channel_member.html>`_ to update the channel configuration. @@ -232,7 +232,7 @@ Finally, there is one Ansible playbook that can be used to destroy the network c :: - ansible-playbook 98-delete-endorsing-organization-components.yml --extra-vars "@org2-vars.yml" + ansible-playbook 98-delete-endorsing-organization-components.yml --extra-vars "@org2-vars.yml" --extra-vars "@common-vars.yml" | This playbook deletes the components for the endorsing organization `Org2`. It makes use of the Ansible role `endorsing_organization <../roles/endorsing_organization.html>`_ to remove the certificate authority, organization (MSP) and peer for this organization, along with the administrator identities for this organization. diff --git a/galaxy.yml b/galaxy.yml index 296fbd5c..da4f013d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -4,7 +4,7 @@ --- namespace: ibm name: blockchain_platform -version: 0.0.21 +version: 0.0.22 readme: README.md authors: - Simon Stone diff --git a/tutorial/README.md b/tutorial/README.md index 7185d078..470451d8 100644 --- a/tutorial/README.md +++ b/tutorial/README.md @@ -1,280 +1,3 @@ # Tutorial -This tutorial will demonstrate how to use the IBM Blockchain Platform collection for Ansible to automate the building of a two organization Hyperledger Fabric network. You can use this tutorial to build a two organization Hyperledger Fabric network using the IBM Blockchain Platform on IBM Cloud or the IBM Blockchain Platform software running in a Red Hat OpenShift or Kubernetes cluster. - -## Overview - -During this tutorial, you will execute several Ansible Playbooks. The Ansible Playbooks are named `-.yml` and will be executed in order. Depending on your IBM Blockchain Platform configuration, you may not need to execute all of the Ansible Playbooks to complete this tutorial. - -The Ansible Playbooks require variables that specify the IBM Blockchain Platform connection details, as well as the name, enrollment IDs and secrets for that organiation. These variables are stored in files named `.yml` and must be passed on the command line when executing an Ansible Playbook. - -## Before you start - -Edit the variable files [ordering-org-vars.yml](ordering-org-vars.yml) (Ordering Org), [org1-vars.yml](org1-vars.yml) (Org1), and [org2-vars.yml](org2-vars.yml) (Org2) with the IBM Blockchain Platform connection details for each organization as follows: - -- IBM Blockchain Platform on IBM Cloud - - 1. Create an IBM Blockchain Platform service instance. - - 2. Create service credentials for the IBM Blockchain Platform service instance. - - 3. Edit the variable file: - - 1. Set `api_endpoint` to the value of `api_endpoint` contained in the service credentials. - - 2. Set `api_authtype` to `ibmcloud`. - - 3. Set `api_key` to the value of `api_key` contained in the service credentials. - - 4. You do not need to specify a value for `api_secret`. - -- IBM Blockchain Platform software running in a Red Hat OpenShift or Kubernetes cluster - - 1. Install the IBM Blockchain Platform software. - - 2. Determine the URL of your IBM Blockchain Platform console. - - 3. Determine the API key and secret you use to access your IBM Blockchain Platform console. You can also use a username and password instead of an API key and secret. - - 4. Edit the variable file: - - 1. Set `api_endpoint` to the URL of your IBM Blockchain Platform console. - - 2. Set `api_authtype` to `basic`. - - 3. Set `api_key` to your API key or username. - - 4. Set `api_secret` to your API secret or password. - -Note that if all of the organizations use the same IBM Blockchain Platform console, you will need to skip certain steps. This is because all of the information is already present in the IBM Blockchain Platform console, and does not need to be imported. - -Finally, all of these files contain a `wait_timeout` variable, with the default set to `600` (seconds). This is the amount of time in seconds to wait for certificate authorities, peers, and ordering services to start. Depending on your environment, you may need to increase this timeout, for example if it takes a long time to provision the persistent volumes for each component. - -## Steps - -1. Create the components for the ordering organization Ordering Org - - - Organization: Ordering Org - - Playbook: [01-create-ordering-organization-components.yml](01-create-ordering-organization-components.yml) - - Command: `ansible-playbook 01-create-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.ordering_organization` to set up the certificate authority, organization (MSP), and ordering service components for the ordering organization Ordering Org. - -2. Create the components for the endorsing organization Org1 - - - Organization: Org1 - - Playbook: [02-create-endorsing-organization-components.yml](02-create-endorsing-organization-components.yml) - - Command: `ansible-playbook 02-create-endorsing-organization-components.yml --extra-vars "@org1-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.endorsing_organization` to set up the certificate authority, organization (MSP), and peer components for the endorsing organization Org1. - -3. Export the organization for Org1 - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org1 - - Playbook: [03-export-organization.yml](03-export-organization.yml) - - Command: `ansible-playbook 03-export-organization.yml --extra-vars "@org1-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.organization_info` module to export the organization Org1 to a file. - - In a real deployment, this file must then be passed to the organization Ordering Org out of band, so they could import the organization Org1 into their IBM Blockchain Plaform console. - -4. Import the organization for Org1 - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org1 - - Playbook: [04-import-organization.yml](04-import-organization.yml) - - Command: `ansible-playbook 04-import-organization.yml --extra-vars "@ordering-org-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.external_organization` module to import the organization Org1 from a file. - -5. Add Org1 to the consortium - - - Organization: Ordering Org - - Playbook: [05-add-organization-to-consortium.yml](05-add-organization-to-consortium.yml) - - Command: `ansible-playbook 05-add-organization-to-consortium.yml --extra-vars "@ordering-org-vars.yml"` - - This playbook updates the ordering service system channel configuration to add Org1 as a member of the consortium. - -6. Export the ordering service - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Ordering Org - - Playbook: [06-export-ordering-service.yml](06-export-ordering-service.yml) - - Command: `ansible-playbook 06-export-ordering-service.yml --extra-vars "@ordering-org-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.ordering_service_info` module to export the ordering service to a file. - - In a real deployment, this file must then be passed to the organization Org1 out of band, so they could import the ordering service into their IBM Blockchain Plaform console. - -7. Import the ordering service - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org1 - - Playbook: [07-import-ordering-service.yml](07-import-ordering-service.yml) - - Command: `ansible-playbook 07-import-ordering-service.yml --extra-vars "@org1-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.external_ordering_service` module to import the ordering service from a file. - -8. Create the channel mychannel - - - Organization: Org1 - - Playbook: [08-create-channel.yml](08-create-channel.yml) - - Command: `ansible-playbook 08-create-channel.yml --extra-vars "@org1-vars.yml"` - - This playbook creates a new channel named mychannel, with Org1 as the only member. - -9. Join the peer to the channel - - - Organization: Org1 - - Playbook: [09-join-peer-to-channel.yml](09-join-peer-to-channel.yml) - - Command: `ansible-playbook 09-join-peer-to-channel.yml --extra-vars "@org1-vars.yml"` - - This playbook joins Org1's peer to the channel mychannel. - -10. Add anchor peer to the channel - - - Organization: Org1 - - Playbook: [10-add-anchor-peer-to-channel.yml](10-add-anchor-peer-to-channel.yml) - - Command: `ansible-playbook 10-add-anchor-peer-to-channel.yml --extra-vars "@org1-vars.yml"` - - This playbook adds Org1's peer as an anchor peer for the channel mychannel. - -11. Create the components for the endorsing organization Org2 - - - Organization: Org2 - - Playbook: [11-create-endorsing-organization-components.yml](02-create-endorsing-organization-components.yml) - - Command: `ansible-playbook 11-create-endorsing-organization-components.yml --extra-vars "@org2-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.endorsing_organization` to set up the certificate authority, organization (MSP), and peer components for the endorsing organization Org2. - -12. Export the organization for Org2 - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org2 - - Playbook: [12-export-organization.yml](12-export-organization.yml) - - Command: `ansible-playbook 12-export-organization.yml --extra-vars "@org2-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.organization_info` module to export the organization Org2 to a file. - - In a real deployment, this file must then be passed to the organization Org1 out of band, so they could import the organization Org2 into their IBM Blockchain Plaform console. - -13. Import the organization for Org2 - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org1 - - Playbook: [13-import-organization.yml](13-import-organization.yml) - - Command: `ansible-playbook 13-import-organization.yml --extra-vars "@org1-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.external_organization` module to import the organization Org2 from a file. - -14. Add Org2 to the channel mychannel - - - Organization: Org1 - - Playbook: [14-add-organization-to-channel.yml](14-add-organization-to-channel.yml) - - Command: `ansible-playbook 14-add-organization-to-channel.yml --extra-vars "@org1-vars.yml"` - - This playbook adds Org2 to the channel mychannel, and updates the channel policies such that Org2 can read from and write to the channel, and both Org1 and Org2 must sign any future configuration updates. - -15. Import the ordering service - - Note: skip this step if all organizations are using the same IBM Blockchain Platform console. - - - Organization: Org2 - - Playbook: [15-import-ordering-service.yml](15-import-ordering-service.yml) - - Command: `ansible-playbook 15-import-ordering-service.yml --extra-vars "@org2-vars.yml"` - - This playbook uses the Ansible Module `ibm.blockchain_platform.external_ordering_service` module to import the ordering service from a file. - -16. Join the peer to the channel - - - Organization: Org2 - - Playbook: [16-join-peer-to-channel.yml](16-join-peer-to-channel.yml) - - Command: `ansible-playbook 16-join-peer-to-channel.yml --extra-vars "@org2-vars.yml"` - - This playbook joins Org2's peer to the channel mychannel. - -17. Add anchor peer to the channel - - - Organization: Org2 - - Playbook: [17-add-anchor-peer-to-channel.yml](17-add-anchor-peer-to-channel.yml) - - Command: `ansible-playbook 17-add-anchor-peer-to-channel.yml --extra-vars "@org2-vars.yml"` - - This playbook adds Org2's peer as an anchor peer for the channel mychannel. - -18. Install the FabCar chaincode on the peer - - - Organization: Org1 - - Playbook: [18-install-chaincode.yml](18-install-chaincode.yml) - - Command: `ansible-playbook 18-install-chaincode.yml --extra-vars "@org1-vars.yml"` - - This playbook installs the FabCar chaincode onto Org1's peer. - -19. Install the FabCar chaincode on the peer - - - Organization: Org2 - - Playbook: [19-install-chaincode.yml](19-install-chaincode.yml) - - Command: `ansible-playbook 19-install-chaincode.yml --extra-vars "@org2-vars.yml"` - - This playbook installs the FabCar chaincode onto Org2's peer. - -20. Instantiate the FabCar chaincode on the channel - - - Organization: Org1 - - Playbook: [20-instantiate-chaincode.yml](20-instantiate-chaincode.yml) - - Command: `ansible-playbook 20-instantiate-chaincode.yml --extra-vars "@org1-vars.yml"` - - This playbook installs the FabCar chaincode onto Org2's peer. - -21. Register application identity and create connection profile - - - Organiation: Org1 - - Playbook: [21-register-application.yml](21-register-application.yml) - - Command: `ansible-playbook 21-register-application.yml --extra-vars "@org1-vars.yml"` - - This playbook registers a new identity and creates a new connection profile, that the FabCar application can use to connect to the network. - - The enrollment ID (`org1app`), enrollment secret (`org1apppw` by default), and connection profile (`Org1 Gateway.json`) should be passed to the application developer. - -22. Register application identity and create connection profile - - - Organiation: Org2 - - Playbook: [22-register-application.yml](22-register-application.yml) - - Command: `ansible-playbook 22-register-application.yml --extra-vars "@org2-vars.yml"` - - This playbook registers a new identity and creates a new connection profile, that the FabCar application can use to connect to the network. - - The enrollment ID (`org2app`), enrollment secret (`org2apppw` by default), and connection profile (`Org2 Gateway.json`) should be passed to the application developer. - -## Cleaning up - -1. Delete the components for the endorsing organization Org1 - - - Organization: Org1 - - Playbook: [97-delete-endorsing-organization-components.yml](97-delete-endorsing-organization-components.yml) - - Command: `ansible-playbook 97-delete-endorsing-organization-components.yml --extra-vars "@org1-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.endorsing_organization` to delete the certificate authority, organization (MSP), and peer components for the endorsing organization Org1. - -2. Delete the components for the endorsing organization Org2 - - - Organization: Org2 - - Playbook: [98-delete-endorsing-organization-components.yml](98-delete-endorsing-organization-components.yml) - - Command: `ansible-playbook 98-delete-endorsing-organization-components.yml --extra-vars "@org2-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.endorsing_organization` to delete the certificate authority, organization (MSP), and peer components for the endorsing organization Org2. - -3. Delete the components for the ordering organization Ordering Org - - - Organization: Ordering Org - - Playbook: [99-delete-ordering-organization-components.yml](99-delete-ordering-organization-components.yml) - - Command: `ansible-playbook 99-delete-ordering-organization-components.yml --extra-vars "@ordering-org-vars.yml"` - - This playbook uses the Ansible Role `ibm.blockchain_platform.ordering_organization` to delete the certificate authority, organization (MSP), and ordering service components for the ordering organization Ordering Org. - +This tutorial has been moved to here: https://ibm-blockchain.github.io/ansible-collection/tutorials/building.html \ No newline at end of file