Skip to content

Commit a7736c7

Browse files
authored
Update ansible inventory to work with hyperledger.fabricx:0.3.11, add diagram (hyperledger#24)
#### Type of change - Improvement (improvement to code, performance, etc) - Documentation update #### Description Sample application: - Updates to the inventory to work with the latest ansible scripts. - Add some clarifications and a diagram to the readme. #### Additional details To update: ``` cd path/to/fabric-x-ansible-collection git pull make install ``` Before starting the application, do `make teardown; make clean; make setup`. Signed-off-by: Arne Rutjes <arne123@gmail.com>
1 parent a8afd2a commit a7736c7

4 files changed

Lines changed: 84 additions & 21 deletions

File tree

samples/tokens/README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ This sample helps you get familiar with Token SDK features and serves as a start
3636
- Configuration for a **Fabric-X** test network.
3737
- Configuration for a **Fabric v3** test network.
3838

39+
Below is a high level overview of the components and how data flows in a token transfer transaction.
40+
The sequence diagram later in this readme provides more details about the token transaction.
41+
For a specification of the Fabric-X components and their interactions, refer to the main [README.md](../../README.md).
42+
43+
![transfer: high level](./diagrams/components.png)
44+
3945
## Architecture Overview
4046

4147
From now on, we’ll refer to the issuer, endorser, and owner services collectively as nodes (not to be confused with Fabric peer nodes).
@@ -105,18 +111,18 @@ export PATH=$(pwd)/fabric-samples/bin:$PATH
105111
106112
> [!TIP]
107113
> The scripts assume you have run the script from the directory of this README. If you have them somewhere else,
108-
> just make sure to `export FABRIC_SAMPLES=/path/to/fabric-samples"` so the scripts can start the test network.
114+
> just make sure to `export FABRIC_SAMPLES="/path/to/fabric-samples"` so the scripts can start the test network.
109115
110116
## Getting Started
111117

112-
The sample uses Fabric-X as the default network.
113-
If you want to run the application on Fabric v3, just set the PLATFORM to fabric3.
114-
115-
```bash
116-
export PLATFORM=fabric3
117-
```
118-
119118
> [!NOTE]
119+
> The sample uses Fabric-X as the default network.
120+
> If you want to run the application on Fabric v3, just set the PLATFORM to fabric3.
121+
>
122+
> ```bash
123+
> export PLATFORM=fabric3
124+
> ```
125+
>
120126
> When switching between platforms, always make sure to *first* (before changing the platform) clean up all artifacts:
121127
> ```shell
122128
> make teardown
@@ -131,6 +137,22 @@ Create the configurations and crypto material for the network:
131137
make setup
132138
```
133139
140+
This creates:
141+
142+
- Fabric
143+
- config files and identities for the orderers and committers
144+
- a genesis block
145+
- users that can submit or query transactions
146+
- endorser identity
147+
- Fabric Smart Client
148+
- identities for the nodes (issuer, owner1, owner2, endorser)
149+
- Fabric Token SDK
150+
- an idemix issuer for the token accounts
151+
- idemix credentials signed by this issuer
152+
- cryptographic parameters and configuration for the token network (see: `go tool tokengen pp print -i conf/namespace/zkatdlognoghv1_pp.json`).
153+
154+
The relevant crypto material is copied to the folders in the conf/* directories.
155+
134156
### Start the Network and Application
135157

136158
Start the Fabric network, create the namespace, and start the application services.
@@ -156,7 +178,7 @@ They also communicate over P2P websockets as shown below:
156178
| -------- | ---- | --------------------------- |
157179
| 8080 | | API documentation (web) |
158180
| 9100 | 9101 | Issuer |
159-
| 9300 | 9301 | Endorer 1 |
181+
| 9300 | 9301 | Endorser 1 |
160182
| 9400 | 9401 | Endorser 2 (Fabric v3 only) |
161183
| 9500 | 9501 | Owner 1 (alice and bob) |
162184
| 9600 | 9601 | Owner 2 (carlos and dan) |

samples/tokens/ansible/inventory/fabric-x.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ all:
2222
node_exporter_port: 9111
2323
container_client: docker
2424
children:
25-
fabric-x:
25+
fabric_x:
2626
children:
27-
fabric-x-orderers:
27+
fabric_x_orderers:
2828
vars:
29-
container_network:
30-
name: fabric_test
29+
container_network: fabric_test
3130
organization:
3231
name: "OrdererOrg{{ orderer_group }}"
3332
domain: "ordererorg{{ orderer_group }}.example.com"
3433
role: orderer
3534
children:
36-
fabric-x-orderer-1:
35+
fabric_x_orderer_1:
3736
vars:
3837
orderer_group: 1
3938
hosts:
@@ -50,7 +49,7 @@ all:
5049
orderer-assembler-1:
5150
orderer_component_type: assembler
5251
orderer_rpc_port: 7053
53-
fabric-x-orderer-2:
52+
fabric_x_orderer_2:
5453
vars:
5554
orderer_group: 2
5655
hosts:
@@ -67,7 +66,7 @@ all:
6766
orderer-assembler-2:
6867
orderer_component_type: assembler
6968
orderer_rpc_port: 7153
70-
fabric-x-orderer-3:
69+
fabric_x_orderer_3:
7170
vars:
7271
orderer_group: 3
7372
hosts:
@@ -84,7 +83,7 @@ all:
8483
orderer-assembler-3:
8584
orderer_component_type: assembler
8685
orderer_rpc_port: 7253
87-
fabric-x-orderer-4:
86+
fabric_x_orderer_4:
8887
vars:
8988
orderer_group: 4
9089
hosts:
@@ -102,11 +101,10 @@ all:
102101
orderer_component_type: assembler
103102
orderer_rpc_port: 7353
104103

105-
fabric-x-committer:
104+
fabric_x_committer:
106105
vars:
107106
# committer_log_level: DEBUG
108-
container_network:
109-
name: fabric_test
107+
container_network: fabric_test
110108
committer_use_postgres: true
111109
hosts:
112110
committer-db:
@@ -115,7 +113,6 @@ all:
115113
postgres_password: sc_secret_pwd
116114
postgres_db: sc_db
117115
postgres_port: 5435
118-
postgres_exporter_port: 2110
119116
committer-validator:
120117
committer_component_type: validator
121118
committer_rpc_port: 5100
35.6 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
' Copyright IBM Corp. All Rights Reserved.
2+
'
3+
' SPDX-License-Identifier: Apache-2.0
4+
'
5+
6+
@startuml
7+
title Token transfer data flow (alice -> dan)
8+
9+
skinparam componentStyle rectangle
10+
skinparam rectangle {
11+
BorderColor Black
12+
FontStyle bold
13+
FontSize 12
14+
RoundCorner 10
15+
}
16+
skinparam package {
17+
BackgroundColor #F9F9F9
18+
BorderColor #999999
19+
FontColor #333333
20+
}
21+
22+
package "Token nodes" as Applications {
23+
component "Issuer\n* token issuer" as issuer #LightBlue
24+
component "Owner 1\n* alice\n* bob" as owner1 #LightBlue
25+
component "Owner 2\n* carlos\n* dan" as owner2 #LightBlue
26+
}
27+
28+
[Endorser] #LightBlue
29+
package "Fabric (x)" {
30+
component Committer
31+
component Orderers
32+
}
33+
34+
component "CA\n*Idemix credential issuer"
35+
36+
issuer --> owner1
37+
owner1 --> owner2 : 1. request identity\nshare pending tx
38+
owner1 -r-> Endorser : 2. token tx for endorsement
39+
owner1 -r-> Orderers : 3. endorsed tx
40+
Orderers --> Committer : 4. ordered blocks
41+
Committer -> owner1 : 5. committed tx
42+
Committer -> owner2 : 5. committed tx
43+
44+
@enduml

0 commit comments

Comments
 (0)