Append to a file
Constructor
Description
new FileAppendTransaction()Methods
Method
Type
Description
Requirement
FileAppendTransaction transaction = new FileAppendTransaction()
.setFileId(newFileId)
.setContents("The appended contents")
.setMaxTransactionFee(new Hbar(2));
//Prepare transaction for signing, sign with the key on the file, sign with the client operator key and submit to a Hedera network
TransactionId txId = transaction.build(client).sign(key).execute(client);
//Request the receipt
TransactionReceipt receipt1 = txId.getReceipt(client);
//Get the transaction consensus status
Status transactionStatus = receipt.status;
System.out.println("The transaction consensus status is " +transactionStatus)const transaction = new FileAppendTransaction()
.setFileId(newFileId)
.setContents("The appended contents")
.setMaxTransactionFee(new Hbar(2));
//Prepare transaction for signing, sign with the key on the file, sign with the client operator key and submit to a Hedera network
const txId = await transaction.build(client).sign(key).execute(client);
//Request the receipt
const receipt = await txId.getReceipt(client);
//Get the transaction consensus status
Status transactionStatus = receipt.status;
console.log("The transaction consensus status is " +transactionStatus)Get transaction values
Method
Type
Description
Requirement
Last updated