@@ -22,20 +22,21 @@ curl -sSL https://github.com/hyperledger-labs/microfab/raw/main/integration/data
2222
2323-  Start Microfab with it's default configuration; (in a separate terminal run ` docker logs -f microfab `  so you can see what it's doing)
2424``` 
25- docker run -d --rm -p 8080:8080 --name microfab ghcr.io/hyperledger-labs/microfab:latest 
25+ curl -sSL https://github.com/hyperledger-labs/microfab/releases/download/v0.0.18/microfab-linux-amd64 -o microfab 
26+ 
27+ microfab start 
2628``` 
2729
2830-  We need to get the configuration of microfab and the address identities that it created; using the Hyperledger Labs * weft*  tool is the quickest
31+ 
2932``` 
30- curl -s http://console.127-0-0-1.nip.io:8080/ak/api/v1/components | npx @hyperledger-labs/weft  microfab -w _wallets -p _gateways -m _msp -f 
33+ microfab connect   
3134``` 
3235
33- -  This will show us some environment variables we can use  to work  with Fabric.   
36+ -  This writes out a certificates and keys in a structure  to use  with the PeerCLI. Set the current shell enviroment variables for org1 
3437
3538``` 
36- export CORE_PEER_LOCALMSPID=Org1MSP 
37- export CORE_PEER_MSPCONFIGPATH=$(pwd)/_msp/Org1/org1admin/msp 
38- export CORE_PEER_ADDRESS=org1peer-api.127-0-0-1.nip.io:8080 
39+ source _mfcfg/org1.env 
3940``` 
4041
4142-  We can then Install, Approve and Commit the chaincode definition
@@ -78,4 +79,71 @@ peer chaincode invoke -C channel1 -n assettx  \
7879                     -c '{"Args":["org.hyperledger.fabric:GetMetadata"]}' \ 
7980                       --orderer orderer-api.127-0-0-1.nip.io:8080  2>&1 \ 
8081                       git stat|  sed -e 's/^.*payload://' | sed -e 's/..$//'  -e 's/^.//' -e 's/\\"/"/g' | jq 
82+ ``` 
83+ 
84+ ## Microfab CLI  
85+ 
86+ The CLI is a small binary wrapper that will create the docker image (pulling the image if needed), and write out the identitiy information. 
87+ 
88+ The (original) way was to run the docker commands manually, see below for the equivalents
89+ 
90+ ``` 
91+ Microfab Launch Control 
92+ 
93+ Usage: 
94+   microfab [command] 
95+ 
96+ microfab 
97+   connect     Writes out connection details for use by the Peer CLI and SDKs 
98+   ping        Pings the microfab image to see if it's running 
99+   start       Starts the microfab image running 
100+   stop        Stops the microfab image running 
101+ 
102+ Additional Commands: 
103+   completion  Generate the autocompletion script for the specified shell 
104+   help        Help about any command 
105+ 
106+ Flags: 
107+   -h, --help      help for microfab 
108+   -v, --version   version for microfab 
109+ 
110+ ``` 
111+ 
112+ ### Start  
113+ ``` 
114+ Starts the microfab image running 
115+ 
116+ Usage: 
117+   microfab start [flags] 
118+ 
119+ Flags: 
120+       --config string       Microfab config (default "{\"endorsing_organizations\":[{\"name\":\"org1\"}],\"channels\":[{\"name\":\"mychannel\",\"endorsing_organizations\":[\"org1\"]},{\"name\":\"appchannel\",\"endorsing_organizations\":[\"org1\"]}],\"capability_level\":\"V2_5\"}") 
121+       --configFile string   Microfab config file 
122+   -f, --force               Force restart if microfab already running 
123+   -h, --help                help for start 
124+   -l, --logs                Display the logs (docker logs -f microfab) 
125+ ``` 
126+ 
127+ ### Connect  
128+ 
129+ ``` 
130+ Writes out connection details for use by the Peer CLI and SDKs 
131+ 
132+ Usage: 
133+   microfab connect [flags] 
134+ 
135+ Flags: 
136+   -f, --force        Force overwriting details directory 
137+   -h, --help         help for connect 
138+       --msp string   msp output directory (default "_mfcfg") 
139+ ``` 
140+ 
141+ ## Docker Command Equivalents  
142+ 
143+ ``` 
144+ docker run -d --rm -p 8080:8080 --name microfab ghcr.io/hyperledger-labs/microfab:latest 
145+ ``` 
146+ 
147+ ``` 
148+ curl -s http://console.127-0-0-1.nip.io:8080/ak/api/v1/components | npx @hyperledger-labs/weft microfab -w _wallets -p _gateways -m _msp -f 
81149``` 
0 commit comments