This is a demo of Gno smart contract programming. This document was constructed by Gno onto a smart contract hosted on the data Realm name "gno.land/r/boards" (github).
gnokey
, create your account, and interact with Gno.NOTE: Where you see --remote gno.land:36657
here, that flag can be replaced
with --remote localhost:26657
for local testnets.
gnokey
.git clone git@github.com:gnolang/gno.git cd ./gno make
./build/gnokey generate
NOTE: You can generate 24 words with any good bip39 generator.
./build/gnokey add KEYNAME --recover
NOTE: KEYNAME
is your key identifier, and should be changed.
./build/gnokey list
./build/gnokey query auth/accounts/ACCOUNT_ADDR --remote gno.land:36657
NOTE: you can retrieve your ACCOUNT_ADDR
with ./build/gnokey list
.
Go to https://gno.land/faucet
NOTE: BOARDNAME
will be the slug of the board, and should be changed.
./build/gnokey maketx call -pkgpath "gno.land/r/boards" -func "CreateBoard" -args "BOARDNAME" -gas-fee "1000000ugnot" -gas-wanted "2000000" -broadcast -chainid testchain -remote gno.land:36657 KEYNAME
Interactive documentation: https://gno.land/r/boards?help&__func=CreateBoard
Next, query for the permanent board ID by querying (you need this to create a new post):
./build/gnokey query "vm/qeval" -data "gno.land/r/boards GetBoardIDFromName(\"BOARDNAME\")" -remote gno.land:36657
NOTE: If a board was created successfully, your SEQUENCE_NUMBER would have increased.
./build/gnokey maketx call -pkgpath "gno.land/r/boards" -func "CreateThread" -args BOARD_ID -args "Hello gno.land" -args\#file "./examples/gno.land/r/boards/example_post.md" -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid testchain -remote gno.land:36657 KEYNAME
Interactive documentation: https://gno.land/r/boards?help&__func=CreateThread
./build/gnokey maketx call -pkgpath "gno.land/r/boards" -func "CreateReply" -args "BOARD_ID" -args "1" -args "1" -args "Nice to meet you too." -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid testchain -remote gno.land:36657 KEYNAME
Interactive documentation: https://gno.land/r/boards?help&__func=CreateReply
./build/gnokey query "vm/qrender" -data "gno.land/r/boards BOARDNAME/1" -remote gno.land:36657
The contents of https://gno.land/r/boards:
and https://gno.land/r/boards:gnolang
are rendered by calling
the Render(path string)
function like so:
./build/gnokey query "vm/qrender" -data "gno.land/r/boards gnolang"
gnoland
node:./build/gnokey add -recover test1
Use this mneonic:
source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
gnoland
node../build/gnoland
NOTE: This can be reset with make reset
./build/gnokey maketx addpkg -pkgpath "gno.land/p/demo/avl" -pkgdir "examples/gno.land/p/demo/avl" -deposit 100000000ugnot -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid dev -remote localhost:26657 test1
./build/gnokey maketx addpkg -pkgpath "gno.land/r/boards" -pkgdir "examples/gno.land/r/boards" -deposit 100000000ugnot -gas-fee 1000000ugnot -gas-wanted 300000000 -broadcast -chainid dev -remote localhost:26657 test1
GetBoardIDFromName
CreateBoard
CreateThread
CreateReply
CreateRepost
DeletePost
EditPost
Gnoland Space is a community initiative.
Disclaimer