mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-24 02:25:09 +00:00
* Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * missed a .git ignored directory on add Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Updates to run the workshop on the Apple M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Build an arch-specific CC images on M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * empty commit - force a build Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * revert an accidental commit that was building the top-level asset-transfer as arm64 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
20 lines
760 B
TypeScript
20 lines
760 B
TypeScript
/*
|
|
* Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { Gateway } from '@hyperledger/fabric-gateway';
|
|
import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
|
|
import { AssetTransfer } from '../contract';
|
|
|
|
export default async function main(gateway: Gateway): Promise<void> {
|
|
const network = gateway.getNetwork(CHANNEL_NAME);
|
|
const contract = network.getContract(CHAINCODE_NAME);
|
|
|
|
const smartContract = new AssetTransfer(contract);
|
|
const assets = await smartContract.getAllAssets();
|
|
|
|
const assetsJson = JSON.stringify(assets, undefined, 2);
|
|
assetsJson.split('\n').forEach(line => console.log(line)); // Write line-by-line to avoid truncation
|
|
}
|