Package com.jelurida.ardor.contracts
Class HelloWorld
java.lang.Object
nxt.addons.AbstractContract
com.jelurida.ardor.contracts.HelloWorld
- All Implemented Interfaces:
Contract
Sample contract to demonstrate the basic operations.
To trigger the contract, send a message transaction or transaction with an attached message. Set the recipient to the
contract runner account, set the message text to {"contract":"HelloWorld"}, use prunable message.
In response the contract will send a message transaction back to the sender account.
Note the validation at the beginning, the code to create the new transaction, and the usage of Json objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessTransaction(TransactionContext context) processTransaction is invoked in the following cases: 1.Methods inherited from class nxt.addons.AbstractContract
isDuplicate, processBlock, processInvocation, processRequest, processVoucherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nxt.addons.Contract
init, minProductVersion, shutdown
-
Constructor Details
-
HelloWorld
public HelloWorld()
-
-
Method Details
-
processTransaction
processTransaction is invoked in the following cases: 1. Simple (non-phased) transaction is accepted in a block 2. Phased transaction with by-hash voting model is accepted in a block. In this case the transaction submitted by the contract will be phased as well. 3. Phased transaction with any other model when it is approved and applied by the blockchain.- Specified by:
processTransactionin interfaceContract- Overrides:
processTransactionin classAbstractContract- Parameters:
context- the transaction context
-