Create a topic
Private topic
Topic Properties
Field
Description
Constructor
Description
new ConsensusTopicCreateTransaction()Method
Type
Requirements
//Create the transaction
ConsensusTopicCreateTransaction transaction = new ConsensusTopicCreateTransaction();
//Submit the transaction to a Hedera network, store the transaction ID
TransactionId txId = transaction.execute(client);
//Request the receipt of the transaction
TransactionReceipt receipt = txId.getReceipt(client);
//Get the topic ID
ConsensusTopicId newTopicId = receipt.getConsensusTopicId();
System.out.println("New topic created: " + newTopicId);Get transaction values
Method
Type
Requirements
Last updated