Skip to content

Commit ce904f6

Browse files
committed
update readme with examples on how to use this
1 parent e207330 commit ce904f6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,32 @@ An empty Hyperledger Fabric smart contract set using Typescript.
66

77
Launch this smart contract set in the SettleMint Blockchain Transformation platform under the `Smart Contract Sets` section. This will automatically link it to your own blockchain node and make use of the private keys living in the platform.
88

9+
## Prerequisites
10+
11+
1. Update `collection_config.json` with the right MSPId's of your network.
12+
2. Update `.env` `CC_SIGNATURE_POLICY` to match the MSPId's of your network.
13+
14+
## Usage
15+
16+
Creating an asset:
17+
18+
There are two ways to create an asset:
19+
20+
```bash
21+
export ASSET_PROPERTIES=$(echo -n "{\"objectType\":\"ValuableAsset\",\"assetID\":\"asset1\",\"color\":\"green\",\"size\":20,\"appraisedValue\":100}" | base64 | tr -d \\n)
22+
./lib/btp-chaincode-lifecycle/chaincode.sh invoke 'CreateAsset' --transient "{ \"asset_properties\": \"${ASSET_PROPERTIES}\"}"
23+
```
24+
25+
Or let the api do the base64 encoding for you:
26+
27+
```bash
28+
./lib/btp-chaincode-lifecycle/chaincode.sh invoke 'CreateAsset' --transient '{ "asset_properties": { "objectType": "ValuableAsset", "assetID": "asset1", "color": "green", "size": "20", "appraisedValue": "100" }}'
29+
```
30+
31+
Query the newly created asset:
32+
33+
```bash
34+
./lib/btp-chaincode-lifecycle/chaincode.sh query 'ReadAsset' --arguments 'asset1'
35+
```
36+
937
TODO: Update documentation

0 commit comments

Comments
 (0)