3. Managing the Network¶
3.1. Environment Secrets for git actions (Not applicable for Jenkins)¶
The pipeline requires the below defined environment secrets setup. Environment name follows the standard name format as <org_name>_<env_type>. Example for aais development environment it will be aais_dev.
3.2. Create network configuration files¶
As a pre-requisite, prepare the organization configuration files using the templates under openidl-aais-gitops/ansible-automation/config-examples directory based on the node type (aais, analytics and carrier) for github actions based pipelines.
Create <org name>-config-<env>.yml under openidl-aais-gitops/ansible-automation/ directory for each of the nodes. For example, if organization belongs to aais node, use the template openidl-aais-gitops/ansible-automation/config-examples/aais-config-dev-template.yml to create openidl-aais-gitops/ansible-automation/aais-config-dev.yml and push it to aais openidl-aais-gitops repository.
Note: Make sure to at least have a defaultchannel listed under channels in organization configuration file. New channel information must be added when required to the configuration file and maintained in the repository.
Organization configuration file should be present at the above-mentioned location in the repository branch before triggering any of the github action pipelines to deploy vault, mongodb and hyperledger fabric network.
Following tables detail the values to be replaced for creating these configuration files.
AAIS |
||
|---|---|---|
Variable |
Description |
Example Value |
GITOPS_REPO_URL |
github repo url of openidl-aais-gitops repo |
|
This is the forked repo. |
||
GITOPS_REPO_BRANCH |
github branch in openidl-aais-gitops repo |
develop |
The branch where saving the file <node_type>_<env> |
||
ORDERERORG_DOMAIN_NAME |
Domain name of the ordering service running in AAIS account |
aais.aaisdirect.com |
<domain_name> |
||
This is common across all and should be the same for every carrier |
||
DOMAIN_NAME |
Domain name to be used for fabric endpoints |
aais.aaisdirect.com |
<subdomain>.<domain_name> |
||
INTERNAL_DOMAIN_NAME |
Internal domain name from the Route53 private hosted zone |
aais.internal.aaisdirect.org |
<subdomain>.internal.<domain_name> |
||
ENV |
Environment |
dev |
AAIS_ORGNAME |
AAIS organization name |
aais |
ANALYTICS_ORGNAME |
Analytics organization name |
analytics |
ANALYTICS_DOMAIN_NAME |
Analytics domain name to be used for its endpoints |
analytics.openidldirect.org |
CARRIER_ORGNAME |
Carrier organization name |
ins (should be four or less characters) |
CARRIER_DOMAIN_NAME |
Carrier domain name to be used for its endpoints |
ins.openidldirect.org |
ANAYTICS_AAIS_CHANNEL_NAME |
Channel name between Analytics and AAIS nodes |
anal-aais |
ANAYTICS_CARRIER_CHANNEL_NAME |
Channel name between Analytics and Carrier nodes |
anal-ins |
CHAINCODE_REPO_BRANCH |
Branch to be used for installing chaincode from github.com/openidl-org/openidl-main repository |
develop |
Analytics |
||
|---|---|---|
Variable |
Description |
Example Value |
GITOPS_REPO_URL |
github repo url of openidl-aais-gitops repo |
|
GITOPS_REPO_BRANCH |
github branch in openidl-aais-gitops repo |
develop |
ORDERERORG_DOMAIN_NAME |
Domain name of the ordering service running in AAIS account |
aais.openidldirect.org |
DOMAIN_NAME |
Domain name to be used for fabric endpoints |
analytics.openidldirect.org |
INTERNAL_DOMAIN_NAME |
Internal domain name from the Route53 private hosted zone |
analytics.internal.openidldirect.org |
ENV |
Environment |
dev |
AAIS_ORGNAME |
AAIS organization name |
aais |
ANALYTICS_ORGNAME |
Analytics organization name |
analytics |
ANALYTICS_DOMAIN_NAME |
Analytics domain name to be used for its endpoints |
analytics.openidldirect.org |
CARRIER_ORGNAME |
Carrier organization name |
trv |
CARRIER_DOMAIN_NAME |
Carrier domain name to be used for its endpoints |
trv.openidldirect.org |
ANAYTICS_AAIS_CHANNEL_NAME |
Channel name between Analytics and AAIS nodes |
analytics-aais |
ANAYTICS_CARRIER_CHANNEL_NAME |
Channel name between Analytics and Carrier nodes |
analytics-trv |
CHAINCODE_REPO_BRANCH |
Branch to be used for installing chaincode from github.com/openidl-org/openidl-main repository |
develop |
Carrier |
||
|---|---|---|
Variable |
Description |
Example Value |
BAF_IMAGE_REPO |
the org and repo name of the baf_image |
use this value unless otherwise stated openidl-org/openidl-aais-gitops |
GITOPS_REPO_URL |
github repo url of openidl-aais-gitops repo |
|
GITOPS_REPO_BRANCH |
github branch in openidl-aais-gitops repo |
baf-automation |
ORDERERORG_DOMAIN_NAME |
Domain name of the ordering service running in AAIS account. |
aais.openidldirect.org |
This was defined on the aais node and should be repeated here. |
||
DOMAIN_NAME |
Domain name to be used for fabric endpoints |
trv.openidldirect.org |
INTERNAL_DOMAIN_NAME |
Internal domain name from the Route53 private hosted zone |
trv.internal.openidldirect.org |
ENV |
Environment |
dev |
AAIS_ORGNAME |
AAIS organization name |
aais |
ANALYTICS_ORGNAME |
Analytics organization name |
analytics |
ANALYTICS_DOMAIN_NAME |
Analytics domain name to be used for its endpoints |
analytics.openidldirect.org |
CARRIER_ORGNAME |
Carrier organization name |
trv |
CARRIER_DOMAIN_NAME |
Carrier domain name to be used for its endpoints |
trv.openidldirect.org |
ANAYTICS_AAIS_CHANNEL_NAME |
Channel name between Analytics and AAIS nodes |
analytics-aais |
ANAYTICS_CARRIER_CHANNEL_NAME |
Channel name between Analytics and Carrier nodes |
analytics-trv |
CHAINCODE_REPO_BRANCH |
Branch to be used for installing chaincode from github.com/openidl-org/openidl-main repository |
develop |
For Jenkins based pipelines, the templates are located under awx-automation/config-references/templates the example configs are located under awx-automation/config-references/examples
Using the reference and examples which helps to prepare the actual config files and placed them under awx-automation/config/
The name of the files suppose to be orgname-config-env.yml. Note that the orgname suppose to be either aais|anal|first 4 chars of a carrier org name used while setting up. Example trv|cnd|hig1 etc., dev|test|prod for environment.
3.3. Setup AAIS¶
The below are the steps required to complete using relevant jenkins jobs to setup base AAIS (multi tenant node). In case a carrier/analytics node is prepared this section is not applicable. It is only applicable for AAIS(multi tenant node) only.
AAIS Node Steps |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
# |
Node |
Action |
ORG |
ENV |
Channel Name |
Extra |
New Org Name |
Chaincode Version |
Comments |
1 |
AAIS |
baf_image |
aais |
dev |
Not applicable as images are already provisioned |
||||
2 |
AAIS |
vault |
aais |
dev |
defaultchannel |
||||
3 |
AAIS |
deploy_network |
aais |
dev |
defaultchannel |
||||
4 |
AAIS |
chaincode |
aais |
dev |
defaultchannel |
Format:MMDDTTTT |
|||
5 |
AAIS |
register_users |
aais |
dev |
defaultchannel |
||||
3.3.1. Setup Analytics node(AAIS – Analytics Workflow)¶
3.3.2. Analytics-AAIS network setup¶
The below steps applicable when deploying analytics node in the network. This includes working with both analytics node as well as aais node for appropriate network setup between them.
Get Orderer TLS cert from aais vault and convert to base64 encoded string. Refer to Connecting to Vault Cluster
Share the TLS Cert with analytics
analytics uploads the TLS Cert to its AWS Secret Manager. Refer to Connecting to AWS Secret Manager
Node=analytics, action=new_org, org=analytics, env=<env>, channel=defaultchannel
Get Org MSP from analytics vault. Refer to section 5.12 Connecting to Vault Cluster in Managing the network
Share the Org MSP with aais
aais uploads the analytics Org MSP to its AWS Secret Manager. Refer section 5.13 to Connecting to AWS Secret Manager in Managing the network
Make sure the aais-config-<env>.yml in the aais-<env> branch has the analytics org and domain
Node=aais, action=add_new_org, org=aais, env=<env>, channel=defaultchannel, other org=analytics
Node=analytics, action=join_peer, org=analytics, env=<env>, channel=defaultchannel
Chaincode version should be same as the one used on aais for defaultchannel. (See step #3)
Node=analytics, action=chaincode, org=analytics, env=<env>, channel=defaultchannel extra args=-e add_new_org=true, version=Format: d (one digit)
Update organization configuration file with new channel analytics-aais and chaincode information (channels section). Push the config file to repository in the aais-<env> branch
Node=aais, action=add_new_channel, org=aais, env=<env>, channel=analytics-aais
aais node should be able to pull the analytics MSP from AWS secret manager which was added as part of add_new_org action on defaultchannel (See step #6)
Node=aais, action=add_new_org, org=aais, env=<env>, channel=analytics-aais, other org=analytics
Node=aais, action=chaincode, org=aais, env=<env>, channel=analytics-aais, version=Format: d (one digit)
Update analytics organization configuration file with new channel analytics-aais and chaincode information (channels section). Push the config file to repository
Node=analytics, action=join_peer, org=analytics, env=<env>, channel=analytics-aais
Chaincode version should be same as the one used on aais for analytics-aais channel (See step #11)
Node=analytics, action=chaincode, org=analytics, env=<env>, channel=analytics-aais, extra args=-e add_new_org=true
Node=analytics, action=register_users, org=analytics, env=<env>, channel=defaultchannel
3.4. Set up a Carrier Node¶
3.4.1. Carrier Workflow¶
3.4.2. Carrier Steps¶
The below steps applicable when deploying a carrier node in the network. This includes working with aais, analytics nodes as well as with the carrier node to join the network. Follow the below steps against all these nodes to complete the setup.
AAIS must share the certificate with the carrier. AAIS will follow these directions:
Get Orderer TLS cert from AAIS vault and convert to base64 encoded string. Refer to section 5.12 Connecting to Vault Cluster (Org MSP and Orderer TLS Certificate) in Managing the network
Share the TLS Cert with Carrier
Carrier now puts the cert from aais into the aws secrets manager
Carrier uploads the TLS Cert to its AWS Secret Manager . Refer to section 5.13 Create Secret using AWS Secret Manager in Managing the network
Node=carrier, action=new_org, org=<org_name>, env=<env>, channel=defaultchannel
Get Org MSP from Carrier vault. Refer to Connecting to Vault Cluster (Org MSP and Orderer TLS Certificate)
Share the Org MSP with AAIS
AAIS uploads the Carrier Org MSP to its AWS Secret Manager. Refer to Create Secret using AWS Secret Manager
refer to Creating CA TLS CERT for connection profile
in the deployment guide
Update the config file for aais to include this new carrier org
get 4 or less name of node
setup org in aais-config-<env>.yml to add organization
Node=aais, action=add_new_org, org=aais, env=<env>, channel=defaultchannel, other org=<org_name of carrier>
Node=carrier, action=join_peer, org=<org_name>, env=<env>, channel=defaultchannel
Chaincode version should be same as the one used on AAIS for defaultchannel
Node=carrier, action=chaincode, org=<org_name>, env=<env>, channel=defaultchannel, extra args=-e add_new_org=true, version=Format: d (one digit) Don’t include the quotes
for aais - Update organization configuration file with new channel analytics-carrier and chaincode information (channels section). Push the config file to repository
Node=aais, action=add_new_channel, org=aais, env=<env>, channel=anal-<org_name first 4>, extra args=–skip-tags=join,anchorpeer
AAIS node should be able to pull the analytics msp from aws secret manager which was added as part of add_new_org action on defaultchannel
Node=aais, action=add_new_org, org=aais, env=<env>, channel=anal-<org_name first 4>, other org=analytics
AAIS node should be able to pull the carrier msp from aws secret manager which was added as part of add_new_org action on defaultchannel (See step #2)
Node=aais, action=add_new_org, org=aais, env=<env>, channel=anal-<org_name first 4>, other org=<org_name>
on the analytics node - Update organization configuration file with new channel analytics-carrier and chaincode information (channels section). Push the config file to repository
Node=analytics, action=join_peer, org=analytics, env=<env>, channel=anal-<org_name first 4>
On the carrier node - Update organization configuration file with new channel anal-<org_name first 4> and chaincode information (channels section). Push the config file to repository
Node=carrier, action=join_peer, org=<org_name>, env=<env>, channel=anal-<org_name first 4>
Node=analytics, action=chaincode, org=analytics, env=<env>, channel=anal-<org_name first 4>, version=FORMAT: d (one digit)
Chaincode version should be same as the one used on Analytics for anal-<org_name first 4> channel
Node=carrier, action=chaincode, org=<org_name>, env=<env>, channel=anal-<org_name first 4>, extra args=-e add_new_org=true, version=FORMAT: d (one digit)
(anal channel prob better to use 1 character version)
Node=carrier, action=register_users, org=<org_name>, env=<env>, channel=defaultchannel
Update the configuration files for the analytics node to include the new channel anal-<org_name first 4>. This will be these files:
- channel-config.json
- data-call-mood-listener-channel-config.json
- transactional-data-event-listener-channel-config.json
- transactional-data-event-listener-target-channel-config.json
Update the channel config on the aais node, rerun the secrets and app jobs
Restart the Analytics and AAIS nodes that participate with this carrier. This allows the pods to be refreshed and pickup any changes necessary to see the new carrier node.