From f1285452f6be0b0a288f148e757b134b697d21e8 Mon Sep 17 00:00:00 2001 From: SimiHunjan Date: Fri, 19 Jul 2024 13:47:27 -0700 Subject: [PATCH] Update script-hcs-topic.js --- hcs-topic/script-hcs-topic.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hcs-topic/script-hcs-topic.js b/hcs-topic/script-hcs-topic.js index 823a93b..b804273 100755 --- a/hcs-topic/script-hcs-topic.js +++ b/hcs-topic/script-hcs-topic.js @@ -34,11 +34,13 @@ async function scriptHcsTopic() { const operatorKey = PrivateKey.fromStringECDSA(operatorKeyStr); client = Client.forTestnet().setOperator(operatorId, operatorKey); - // NOTE: Create a HCS topic + // NOTE: Create a Hedera Consensus Service topic // Step (1) in the accompanying tutorial blueLog('Creating new HCS topic'); const topicCreateTx = await new TopicCreateTransaction() + //Set the transaction memo with the hellow future world ID .setTransactionMemo(hfwId) + //Set the topic memo .setTopicMemo(`HFW-HCS topic by ${yourName}`) // Freeze the transaction to prepare for signing .freezeWith(client); @@ -65,8 +67,11 @@ async function scriptHcsTopic() { // NOTE: Publish a message to the HCS topic // Step (2) in the accompanying tutorial const topicMsgSubmitTx = await new TopicMessageSubmitTransaction() + //Set the transaction memo with the hello future world ID .setTransactionMemo(hfwId) + //The ID of the topic that was created in the previous step .setTopicId(topicId) + //Set the topic message contents .setMessage(`Hello HCS! - ${yourName}`) // Freeze the transaction to prepare for signing .freezeWith(client);