You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix sample application startup with test-committer and classic fabric (#111)
#### Type of change
Bug fix
#### Description
The test committer version of the sample application was not working, as
the channel in the configuration "arma" did not match the channel used
in the test committer "mychannel". This is fixed, and the README.md
order has been made more readable.
Also, updating the Fabric version to 3.1.4; the sample application
installs chaincode to create the namespace and this was failing on newer
versions of docker (see:
hyperledger/fabric#5350).
#### Related issues
N/A
Signed-off-by: Arne Rutjes <arne123@gmail.com>
-[Deep Dive: What Happens During a Transfer?](#deep-dive-what-happens-during-a-transfer)
24
+
-[Running the sample](#running-the-sample)
25
+
-[Prerequisites](#prerequisites)
26
+
-[Default option: Fabric-X with Ansible](#default-option-fabric-x-with-ansible)
27
+
-[Requirements](#requirements)
28
+
-[Installation](#installation)
29
+
-[Setup Fabric-X](#setup-fabric-x)
30
+
-[Option 2: Fabric-X test container](#option-2-fabric-x-test-container)
31
+
-[Option 3: Fabric v3](#option-3-fabric-v3)
32
+
-[Interacting with the Application](#interacting-with-the-application)
33
+
-[Example: Issue tokens](#example-issue-tokens)
34
+
-[Example: Transfer tokens](#example-transfer-tokens)
35
+
-[Teardown and cleanup](#teardown-and-cleanup)
36
+
-[Development](#development)
37
+
-[Debug mode](#debug-mode)
38
+
-[VSCode](#vscode)
39
+
-[Running the binaries](#running-the-binaries)
40
+
-[Troubleshooting](#troubleshooting)
42
41
43
42
## About the Sample
44
43
@@ -161,32 +160,14 @@ make install-prerequisites
161
160
162
161
### Setup Fabric-X
163
162
164
-
Make sure that the crypto is cleared and let the scripts know you want to use ansible:
163
+
Let the scripts know you want to use ansible (not strictly necessary as this is the default).
164
+
Then generate the crypto material.
165
165
166
166
```shell
167
-
make teardown
168
-
make clean
169
167
export PLATFORM=fabricx
170
168
make setup
171
169
```
172
170
173
-
Then, like with the test container:
174
-
175
-
```shell
176
-
make start
177
-
curl -X POST http://localhost:9300/endorser/init
178
-
```
179
-
180
-
## Option 2: Fabric-X test container
181
-
182
-
The quickest way to get going: a test version of Fabric-X in a single docker container! Even if you want to use different backends, we suggest to start here.
183
-
184
-
First generate the necessary crypto material:
185
-
186
-
```shell
187
-
make setup
188
-
```
189
-
190
171
This creates:
191
172
192
173
- Fabric
@@ -203,22 +184,42 @@ This creates:
203
184
204
185
The relevant crypto material is copied to the folders in the conf/\* directories.
205
186
206
-
The following first command starts the Fabric-X test container, creates a namespace, and runs the application in docker containers. The second command ensures that the parameters for the network (cryptographic material, the idemix issuer identity for the accounts, the token issuer certificate) are registered on the ledger.
187
+
Then start the application and initialize it. The "init" endpoint records the cryptographic
188
+
parameters and configuration which we generated in the "setup" step on the blockchain. This will be the anchor for the token transactions.
207
189
208
190
```shell
209
191
make start
210
192
curl -X POST http://localhost:9300/endorser/init
211
193
```
212
194
213
-
Now open <http://localhost:8080> in your browser to see the other API endpoints, or scroll down to follow some `curl` commands.
195
+
## Option 2: Fabric-X test container
214
196
215
-
## Option 3: Fabric v3
197
+
The quickest way for development: a test version of Fabric-X in a single docker container!
198
+
First make sure that the crypto from the ansible network is cleared.
216
199
217
-
Run the same application against a classic Fabric v3 network.
200
+
```shell
201
+
make teardown
202
+
make clean
203
+
```
218
204
219
-
### Setup Fabric v3
205
+
Let the scripts know you want to use the test container ('xdev') and generate the necessary crypto material:
220
206
221
-
First, clean up any previous state and set Fabric v3:
207
+
```shell
208
+
export PLATFORM=xdev
209
+
make setup
210
+
```
211
+
212
+
Start the application and initialize it.
213
+
214
+
```shell
215
+
make start
216
+
curl -X POST http://localhost:9300/endorser/init
217
+
```
218
+
219
+
## Option 3: Fabric v3
220
+
221
+
It's also possible to the same application against a classic Fabric network. Clean up any previous
222
+
state and setup the classic Fabric material:
222
223
223
224
```shell
224
225
make teardown
@@ -227,8 +228,6 @@ export PLATFORM=fabric3
227
228
make setup
228
229
```
229
230
230
-
### Start the Network and Application
231
-
232
231
Start the Fabric network, create the namespace (chaincode), and start the application services. For Fabric 3, you don't have to call the Init endpoint; this is taken care of when installing the chaincode.
@until go tool fxconfig namespace list --endpoint=localhost:7001 2>/dev/null | grep -q token_namespace;do sleep 1;echo"waiting for namespace to be created...";done
0 commit comments