/r/demo/boards:testboard/1 [source] [help]
# Hello World

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/demo/boards"](https://gno.land/r/demo/boards/)
([github](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo/boards)).

## Starting the `gnoland` node node/validator.

NOTE: Where you see `--remote localhost:26657` here, that flag can be replaced
with `--remote localhost:26657` for local testnets.

### build gnoland.

```bash
git clone git@github.com:gnolang/gno.git
cd ./gno
make 
```

### add test account.

```bash
./build/gnokey add test1 --recover
```

Use this mnemonic:
> source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast

### start gnoland validator node.

```bash
./build/gnoland
```

(This can be reset with `make reset`).

### start gnoland web server (optional).

```bash
go run ./gnoland/website
```

## Signing and broadcasting transactions.

### publish the "gno.land/p/demo/avl" package.

```bash
./build/gnokey maketx addpkg test1 --pkgpath "gno.land/p/demo/avl" --pkgdir "examples/gno.land/p/demo/avl" --deposit 100ugnot --gas-fee 1ugnot --gas-wanted 2000000 > addpkg.avl.unsigned.txt
./build/gnokey query "auth/accounts/g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5"
./build/gnokey sign test1 --txpath addpkg.avl.unsigned.txt --chainid "portal-loop" --number 0 --sequence 0 > addpkg.avl.signed.txt
./build/gnokey broadcast addpkg.avl.signed.txt --remote localhost:26657
```

### publish the "gno.land/r/demo/boards" realm package.

```bash
./build/gnokey maketx addpkg test1 --pkgpath "gno.land/r/demo/boards" --pkgdir "examples/gno.land/r/demo/boards" --deposit 100ugnot --gas-fee 1ugnot --gas-wanted 300000000 > addpkg.boards.unsigned.txt
./build/gnokey sign test1 --txpath addpkg.boards.unsigned.txt --chainid "portal-loop" --number 0 --sequence 1 > addpkg.boards.signed.txt
./build/gnokey broadcast addpkg.boards.signed.txt --remote localhost:26657
```

### create a board with a smart contract call.

```bash
./build/gnokey maketx call test1 --pkgpath "gno.land/r/demo/boards" --func CreateBoard --args "testboard" --gas-fee 1ugnot --gas-wanted 2000000 > createboard.unsigned.txt
./build/gnokey sign test1 --txpath createboard.unsigned.txt --chainid "portal-loop" --number 0 --sequence 2 > createboard.signed.txt
./build/gnokey broadcast createboard.signed.txt --remote localhost:26657
```
Next, query for the permanent board ID by querying (you need this to create a new post):

```bash
./build/gnokey query "vm/qeval" --data "gno.land/r/demo/boards
GetBoardIDFromName(\"testboard\")"
```

### create a post of a board with a smart contract call.

```bash
./build/gnokey maketx call test1 --pkgpath "gno.land/r/demo/boards" --func CreatePost --args 1 --args "Hello World" --args#file "./examples/gno.land/r/demo/boards/README.md" --gas-fee 1ugnot --gas-wanted 2000000 > createpost.unsigned.txt
./build/gnokey sign test1 --txpath createpost.unsigned.txt --chainid "portal-loop" --number 0 --sequence 3 > createpost.signed.txt
./build/gnokey broadcast createpost.signed.txt --remote localhost:26657
```

### create a comment to a post.

```bash
./build/gnokey maketx call test1 --pkgpath "gno.land/r/demo/boards" --func CreateReply --args 1 --args 1 --args "A comment" --gas-fee 1ugnot --gas-wanted 2000000 > createcomment.unsigned.txt
./build/gnokey sign test1 --txpath createcomment.unsigned.txt --chainid "portal-loop" --number 0 --sequence 4 > createcomment.signed.txt
./build/gnokey broadcast createcomment.signed.txt --remote localhost:26657
```

```bash
./build/gnokey query "vm/qrender" --data "gno.land/r/demo/boards
testboard/1"
```

### render page with optional path expression.

The contents of `https://gno.land/r/demo/boards:` and `https://gno.land/r/demo/boards:testboard` are rendered by calling
the `Render(path string)` function like so:

```bash
./build/gnokey query "vm/qrender" --data "gno.land/r/demo/boards
testboard"
```

\- [@administrator](/r/demo/users:administrator), [2024-05-17 11:22am (UTC)](/r/demo/boards:testboard/1) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=1&postid=1&body.type=textarea)] \[[repost](/r/demo/boards?help&__func=CreateRepost&bid=1&postid=1&title.type=textarea&body.type=textarea&dstBoardID.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=1&postid=1)]

> Hello !
> \- [@manfred](/r/demo/users:manfred), [2024-05-17 11:22am (UTC)](/r/demo/boards:testboard/1/6) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=1&postid=6&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=1&postid=6)]
> 
> > Hello.
> > \- [@manfred](/r/demo/users:manfred), [2024-05-17 11:22am (UTC)](/r/demo/boards:testboard/1/7) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=1&postid=7&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=1&postid=7)]