@@ -115,3 +115,85 @@ brooklyn.catalog:
115115 checkRunning.command: |
116116 STATUS=$(sudo docker inspect -f {{.State.Running}} ${CONTAINER_NAME})
117117 sudo service docker status && [ "${STATUS}" = "true" ]
118+
119+ - id: hyperledger-fabric-composer-node
120+ description: |
121+ A Hyperledger Fabric Composer CLI installation
122+ itemType: entity
123+ item:
124+ type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
125+ name: "hyperledger-fabric-composer-node"
126+
127+ brooklyn.config:
128+ templates.install:
129+ "classpath://io.brooklyn.hyperledger:hyperledger/fabric-composer-templates/connection-template.json": "connection.json"
130+
131+ shell.env:
132+ INSTALL_DIR: $brooklyn:attributeWhenReady("install.dir")
133+
134+ install.command: |
135+ sudo yum -y update
136+ sudo yum -y install git npm gcc-c++ python
137+ npm install -g composer-cli
138+ npm install -g generator-hyperledger-composer
139+ npm install -g composer-rest-server
140+ npm install -g yo
141+ npm install -g composer-playground
142+
143+ launch.command: |
144+ echo "No-op launch.command"
145+
146+ checkRunning.command: |
147+ which composer
148+
149+ provisioning.properties:
150+ osFamily: centos
151+ minRam: 4gb
152+ installDevUrandom: true
153+ required.ports:
154+ - 22
155+ - 3000
156+
157+ brooklyn.initializers:
158+ - type: org.apache.brooklyn.core.effector.ssh.SshCommandEffector
159+ brooklyn.config:
160+ name: "Run Getting Started Application"
161+ description: "Creates and deploys the business network and runs the Getting Started application"
162+
163+ shell.env:
164+ INSTALL_DIR: $brooklyn:attributeWhenReady("install.dir")
165+
166+ command: |
167+ git clone https://github.com/hyperledger/composer-sample-applications.git
168+ cd composer-sample-applications/packages/getting-started
169+
170+ sed -i 's| "install": "scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork"||g' package.json
171+ sed -i 's|DJY27pEnl16d",|DJY27pEnl16d"|g' package.json
172+ npm install || true
173+
174+ mkdir -p ~/.composer-credentials
175+ mkdir -p ~/.composer-connection-profiles/defaultProfile
176+
177+ sed -i "s|brooklyn-managed-processes||g" ${INSTALL_DIR}/connection.json
178+ cp ${INSTALL_DIR}/connection.json ~/.composer-connection-profiles/defaultProfile
179+
180+ composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna
181+ composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
182+ composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
183+
184+ npm test
185+
186+ nohup composer-rest-server -p defaultProfile -n digitalproperty-network -i WebAppAdmin -s DJY27pEnl16d > compose-rest-server.out 2>&1&
187+
188+ brooklyn.enrichers:
189+ - type: org.apache.brooklyn.enricher.stock.Transformer
190+ brooklyn.config:
191+ uniqueTag: rest-server-address-generator
192+ enricher.sourceSensor: $brooklyn:sensor("host.address")
193+ enricher.targetSensor: $brooklyn:sensor("example.compose.rest.server.address")
194+ enricher.targetValue:
195+ $brooklyn:formatString:
196+ - "%s:%d%s"
197+ - $brooklyn:attributeWhenReady("host.address")
198+ - 3000
199+ - "/explorer"
0 commit comments