fabric-samples/full-stack-asset-transfer-guide/infrastructure/fabric_network_playbooks/05-enable-capabilities.yml
jkneubuh a299e18e26
Moves the Full Stack Asset Transfer Development Guide to fabric-samples (#852)
* Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Update the workshop with a new WORKSHOP_PATH under fabric-samples

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Update the workshop with a new WORKSHOP_PATH under fabric-samples

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* missed a .git ignored directory on add

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Updates to run the workshop on the Apple M1

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Build an arch-specific CC images on M1

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* empty commit - force a build

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* revert an accidental commit that was building the top-level asset-transfer as arm64

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-10 10:40:27 -05:00

84 lines
3.1 KiB
YAML

#
# SPDX-License-Identifier: Apache-2.0
#
---
- name: Enable Fabric v2.x capabilities
hosts: localhost
vars:
wallet: "/_cfg"
vars_files:
- /_cfg/fabric-common-vars.yml
- /_cfg/fabric-ordering-org-vars.yml
tasks:
- name: Get the ordering service information
ibm.blockchain_platform.ordering_service_info:
api_endpoint: "{{ api_endpoint }}"
api_authtype: "{{ api_authtype }}"
api_key: "{{ api_key }}"
api_secret: "{{ api_secret | default(omit) }}"
api_token_endpoint: "{{ api_token_endpoint | default(omit) }}"
name: "{{ ordering_service_name }}"
register: ordering_service
- name: Fail if the ordering service does not exist
fail:
msg: "{{ ordering_service_name }} does not exist"
when: not ordering_service.exists
- name: Fetch the system channel configuration
ibm.blockchain_platform.channel_config:
api_endpoint: "{{ api_endpoint }}"
api_authtype: "{{ api_authtype }}"
api_key: "{{ api_key }}"
api_secret: "{{ api_secret | default(omit) }}"
api_token_endpoint: "{{ api_token_endpoint | default(omit) }}"
ordering_service: "{{ ordering_service_name }}"
identity: "{{ wallet }}/{{ ordering_org_name }} Admin.json"
msp_id: "{{ ordering_service_msp }}"
operation: fetch
name: "{{ ordering_service.ordering_service[0].system_channel_id }}"
path: original_config.bin
- name: Create a copy of the system channel configuration
copy:
src: original_config.bin
dest: updated_config.bin
- name: Enable Fabric v2.x capabilities
ibm.blockchain_platform.channel_capabilities:
path: updated_config.bin
channel: V2_0
orderer: V2_0
- name: Compute the system channel configuration update
ibm.blockchain_platform.channel_config:
operation: compute_update
name: "{{ ordering_service.ordering_service[0].system_channel_id }}"
original: original_config.bin
updated: updated_config.bin
path: config_update.bin
register: compute_update
- name: Sign the system channel configuration update
ibm.blockchain_platform.channel_config:
operation: sign_update
identity: "{{ wallet }}/{{ ordering_org_name }} Admin.json"
msp_id: "{{ ordering_service_msp }}"
name: "{{ ordering_service.ordering_service[0].system_channel_id }}"
path: config_update.bin
when: compute_update.path
- name: Apply the system channel configuration update
ibm.blockchain_platform.channel_config:
api_endpoint: "{{ api_endpoint }}"
api_authtype: "{{ api_authtype }}"
api_key: "{{ api_key }}"
api_secret: "{{ api_secret | default(omit) }}"
api_token_endpoint: "{{ api_token_endpoint | default(omit) }}"
operation: apply_update
ordering_service: "{{ ordering_service_name }}"
identity: "{{ wallet }}/{{ ordering_org_name }} Admin.json"
msp_id: "{{ ordering_service_msp }}"
name: "{{ ordering_service.ordering_service[0].system_channel_id }}"
path: config_update.bin
when: compute_update.path