Hello World
The default template of SoproX
Recall that a program on Solana blockchain can be viewed as a script; and will be executed by a virtual machine when users trigger. Moreover, a script can have state or storage by itself, it need to cooperate with accounts, which you can think it's a kind of registers, or databases, to serve a fully function of computation.
Through the example, we will be familiar with two most basic types namely u32 and bool.
pub struct Dummy {
pub amount: u32,
pub toggle: bool,
We plan to create an account name Dummy that stores amount and toggle which are u32, and bool respectively.
To understand function component in this template, and how data flow inside, authors highly recommend you to read Solona Rust-based program.
In client side, we write two functions. One is to call sayHello to change value of Dummy account. The other is to call reportHello to parse and show the current information stored in Dummy account.
Copy link