Smart Contract #1 - Hello World Part 1

In this example, publish a simple smart contract with a value stored in its contract memory.

The smart contract is triggered with the publish function.

This smart contract stores the value Hello in its contract memory.

Read the memory of the smart contract using the function getGreeting.


The video below describes how you can run smart contract #1.



In a terminal session, publish the smart contract, specifying the smart contract template: 

tymlez-sc publish --templateName=SC_HelloWorld_Part1 Hello

If the contract is successfully executed, the system will return a valid contract ID:

[INFO] commands.publish - publishing contract SC_HelloWorld_Part1....
[INFO] commands.publish - Signed tx...
[INFO] commands.publish - Post signed tx ....
[INFO] commands.publish - Smart Contract published successfully
[INFO] commands.publish - Contract id: a39f4f54a392cffd9324d3a789ccd6eacb178

Read the memory of the smart contract with the getGreeting function:

tymlez-sc call --functionName=getGreeting

You should see following the output:

[INFO] - { result: 'Hello' }

Return to the smart contracts main page