Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/settlemint/chaincode-typescript-empty-pdc
https://github.com/settlemint/chaincode-typescript-empty-pdc
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/settlemint/chaincode-typescript-empty-pdc
- Owner: settlemint
- License: mit
- Created: 2024-05-02T13:10:18.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T17:52:53.000Z (6 days ago)
- Last Synced: 2024-11-11T18:38:15.236Z (5 days ago)
- Language: TypeScript
- Size: 306 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hyperledger Fabric Empty Smart PDC Contract Set
An empty Hyperledger Fabric smart contract set using Typescript.
## Get started
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.
## Prerequisites
1. Update `collection_config.json` with the right MSPId's of your network.
2. Update `.env` `CC_SIGNATURE_POLICY` to match the MSPId's of your network.## Usage
Creating an asset:
There are two ways to create an asset:
```bash
export ASSET_PROPERTIES=$(echo -n "{\"objectType\":\"ValuableAsset\",\"assetID\":\"asset1\",\"color\":\"green\",\"size\":20,\"appraisedValue\":100}" | base64 | tr -d \\n)
./lib/btp-chaincode-lifecycle/chaincode.sh invoke 'CreateAsset' --transient "{ \"asset_properties\": \"${ASSET_PROPERTIES}\"}"
```Or let the api do the base64 encoding for you:
```bash
./lib/btp-chaincode-lifecycle/chaincode.sh invoke 'CreateAsset' --transient '{ "asset_properties": { "objectType": "ValuableAsset", "assetID": "asset1", "color": "green", "size": "20", "appraisedValue": "100" }}'
```Query the newly created asset:
```bash
./lib/btp-chaincode-lifecycle/chaincode.sh query 'ReadAsset' --arguments 'asset1'
```TODO: Update documentation