// test.js'use strict';// SDK Library to asset with writing the logicimport{Context,Contract,Transaction}from'fabric-contract-api';// Business logic (well just util but still it's general purpose logic)import{Iterators}from'fabric-shim';/** * Support the Updating of values within the SmartContract */exportclassChaincodeBextendsContract{@Transaction()publicasyncinit(ctx: Context){console.info('============= Initialize ChaincodeB ===========');}@Transaction()publicasyncweatherData(ctx: Context){constweatherDataInJSON=awaitfetchWeatherData();returnBuffer.from(JSON.stringify(weatherDataInJSON));}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.