Example guides
Here are all Rooch examples introduction and source code indices.
About the sample project naming explanation
Rooch provides the command rooch move new
to automatically create and initialize projects. When we want to write a new contract project, we can use this command to simplify our initialization work.
We can use any legal character as the project name, including -
, but when we use a project name with -
, the rooch move new
command will automatically use the project name as the address of this project.
For example:
move rooch new hello-world
However, -
is not a legal character for naming addresses (variables), so after we create the project using rooch move new
, be sure to check the project address alias in the Move.toml
file for illegal characters.
Use rooch move new
to create a project (name) with -
. We recommend manually modifying the Move.toml
file and replacing -
with _
.
Another way is to directly use _
as the hyphen for the project name word when creating the project.
For example:
move rooch new hello_world
In Rooch's examples
, the names of the projects we create use _
connection. As for the actual development, which style to use, please decide according to your preferences.
Basic object
This example introduces how to use the Rooch object.
Source code
basic_object
(opens in a new tab)
Blog
This example introduces how to use a low-code tool to develop a blog sample application.
Source code
Borrow reference
Source code
borrow_reference
(opens in a new tab)
Coins
Source code
Complex struct
Source code
complex_struct
(opens in a new tab)
Counter
Source code
Entry function arguments old
Source code
entry_function_arguments_old
(opens in a new tab)
Entry function arguments
Source code
entry_function_arguments
(opens in a new tab)
Event
Source code
KV store
Source code
Module init
Source code
module_init
(opens in a new tab)
Noop auth validator
Source code
noop_auth_validator
(opens in a new tab)
Private generics
Source code
private_generics
(opens in a new tab)
References
Read private generic functions in one article (opens in a new tab)
Publish modules
Source code
publish_modules
(opens in a new tab)
Simple blog
Source code
simple_blog
(opens in a new tab)