Skip to content

Commit

Permalink
[CE-476]Added yaml connection profile
Browse files Browse the repository at this point in the history
Change-Id: Id56f46b62ada49e343351f854ba60d57d7ea6345
Signed-off-by: Tong Li <litong01@us.ibm.com>
  • Loading branch information
Tong Li committed Sep 11, 2018
1 parent d956c29 commit 7e4aa01
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.json"
with_items: "{{ allorgs }}"

- name: Create yaml connection profiles
template:
src: "{{ playbook_dir }}/../deploy_compose/certsetup/templates/connyaml.j2"
dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.yml"
with_items: "{{ allorgs }}"

- name: Create endorsement policy file
template:
src: "{{ playbook_dir }}/../deploy_compose/certsetup/templates/policy.j2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: "{{ item }}-network"
x-type: "hlfv1"
version: "1.0.0"
client:
organization: "{{ item }}"
connection:
timeout:
peer:
endorser: 300
eventHub: 300
eventReg: 300
orderer: 300
channels:
firstchannel:
orderers:
{% for orderer in allorderers %}
- {{ orderer.name }}
{% endfor %}
peers:
{% for peer in allpeers %}
{{ peer.name }}:
endorsingPeer: true
chaincodeQuery: true
eventSource: true
{% endfor %}
organizations:
{% for org in allorgs %}
{{ org }}:
mspid: "{{ org }}"
peers:
{% for peer in allpeers|selectattr('org', 'equalto', org)|list %}
- {{ peer.name }}
{% endfor %}
certificateAuthorities:
{% for ca in allcas|selectattr('org', 'equalto', org)|list %}
- {{ ca.name }}
{% endfor %}
{% endfor %}
orderers:
{% for orderer in allorderers %}
{{ orderer.name }}:
url: "{{ tls|ternary('grpcs','grpc') }}://{{ orderer.name }}:7050"
grpcOptions:
ssl-target-name-override: "{{ orderer.name }}"
tlsCACerts:
path: "{{ '/fabric/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/ca.crt' }}"
{% endfor %}
peers:
{% for peer in allpeers|selectattr('org', 'equalto', item)|list %}
{{ peer.name }}:
url: "{{ tls|ternary('grpcs','grpc') }}://{{ peer.name }}:7051"
eventUrl: "{{ tls|ternary('grpcs','grpc') }}://{{ peer.name }}:7053"
grpcOptions:
ssl-target-name-override: "{{ peer.name }}"
tlsCACerts:
path: "{{ '/fabric/keyfiles/'+peer.org+'/tlsca/tlsca.'+peer.org+'-cert.pem' }}"
{% endfor %}
certificateAuthorities:
{% for ca in allcas|selectattr('org', 'equalto', item)|list %}
{{ ca.name }}:
url: "{{ tls|ternary('https','http') }}://{{ca.name}}:7054"
caName: "{{ ca.name }}"
httpOptions:
verify: false
{% endfor %}

0 comments on commit 7e4aa01

Please sign in to comment.