Here's an example that works with basic-sample-network network:
asset SampleAsset identified by assetId {
o String assetId
--> SampleParticipant owner
o String value
o DateTime timestamp
}
function onSampleTransaction(sampleTransaction) {
sampleTransaction.asset.value = sampleTransaction.newValue;
sampleTransaction.asset.timestamp = sampleTransaction.timestamp;
return getAssetRegistry('org.acme.sample.SampleAsset')
.then(function (assetRegistry) {
return assetRegistry.update(sampleTransaction.asset);
});
}