Gnosis - GNO

Gnolang Workshop: How to build a forum in Gno.land

YouTube video


Okay so welcome everyone to our no land uh Workshop how to build a forum in no land and this is one of our first workshops I think we’ve done milosh it’s maybe your first Workshop you’ve done with us yes yeah and so if you guys have feedback

For us on on how this goes um let us know and also uh we’ll post this online so um you’ll have access to it if there’s anything the hack MD I’m gonna post it one more time here the heck MD file is the um tutorial you guys

Can follow along it’s what milosh will be going through yeah good evening to those of you uh in different time zones um so you can follow along here and then it’ll be about an hour and if you have questions um I will leave it up to Milos how you

Want to handle it if you want raised hands in-call messages um and how you want to deal deal with it and um I’m happy to alert you milosh if there are questions that happen uh while you’re presenting and need to go through but yeah we want it to be interactive we

Want to be Hands-On so if you’re going through the tutorial you’re coding um and you want to know if there’s something wrong or whatnot you know just raise your hand so uh milosh can help so I’m going to um turn myself off now and hand it over to milosh to start the workshop

Okay oh sorry one more thing don’t forget we want to give a few minutes at the end to run through game of Realms and how people can yeah yeah everything has been accounted for okay yeah thank you okay cool okay um so I guess I should begin if you guys

Can see me and hear me um just like a brief introduction about myself uh my name is milosh I’m one of the core Engineers that works on Nolan um if you’ve uh previously before this I used to work on uh mostly open source projects um one of the most notable ones was uh

Was polygon Edge which is sort of like a blockchain client that lets you deploy your own kind of blockchain Networks um so now I’m working in no um and yeah I I feel like it’s it’s kind of interesting to give a workshop on this because it’s it’s sort of a transition

From ethereum and I’m not sure how many people are just coming either from either they’ve like used nilang in the past or they’re coming from like an ethereum ecosystem or they they have like no no uh no ties with blockchain and web free and they just you know

Heard that we’re using go in a weird way and they they want to jump in and see see what it’s all about um and yeah so this this Workshop is sort of for for kind of every Everybody um we’re I’m actually going to show you exactly what we’re going to be building

Um but before I do that I I really want to explain like why we’re why we’re building like what we’re building and what you know actually is and and how uh how you can use it and how it’s gonna it’s gonna make um your actual workflow and development better um

So yeah I figured one of the best ways for me to explain what uh no is is in sort of these uh sort of layers of abstractions um and one of one of one of the sort of um most most uh familiar things to to most developers who are either looking

To get into blockchain or already doing like web3 uh is um they want to develop like smart contracts right they want to do some kind of blockchain development either like on a low level or they want to do application Focus development that’s solely focused on like that’s right

Um and usually when people open up YouTube or Google and they they try to find these tutorials on how they can get started um usually they sort of gravitate towards one of the biggest markets that that’s like currently present in blockchain which is ethereum um in ethereum uh is you know and all

The changes around ethereum are based on this language that’s called solidity uh for writing smart contracts sorry this is sort of the entry point for for most people who are getting into blockchains um so I figured I would start pretty much there uh and sort of ease you into intoland

Um so if you’ve ever been in this situation where you sort of wanted to learn how to develop blockchain applications or develop protocols for blockchains um that are actually going to be executed by some kind of runtime um for ethereum obviously it’s like DVM for other chains it can be some other

Runtime right um but if if you’ve ever looked into this uh you’ve definitely sort of Dibble dabbled in solidity um and you know it’s it’s sort of one of those things that’s very easy to learn hard to master the language itself is not too difficult um the syntax is very clear but there

Are a few gotchas in the language and this is uh very much based on how uh on what limitations you’re sort of exposed to when you’re using DVM um and I I found it I found this like website um this website is actually very common for facilities that sort of want

To get into this um it sort of gives you an example of like how you can do solidity development how you can do map allocations how you can do Constructors so you can do mapping stuff like that so just like basic language syntax but also

Um it has this very it has a section on the website which I think is very um um it’s it’s very solidity based it has like a list of hacks that people have used uh have used either in like solidity compilers evm runtimes or like the language exports themselves right um

And you’ve either like used this resource or you’ve used like something like crypto zombies um and once you start using the language you sort of feel very much bound to um so some some of these design choices the way memory is sort of allocated with insulated the way storage is actually

Kept on the blockchain um and you really need to fit into this small hole and just like learn something new even if you’re coming from web2 so even if you know Java if you know go if you know any other language it doesn’t matter you really need to focus on

Learning something new in order to develop the apps it’s either like solidity or it’s or it’s like vibrant right um and usually the contracts that you write um they’re not as transparent as you would like them to be so usually in like open source you uh when you have a

Repository you can always like open up the code and see like the code and see exactly what the method that you’re doing is actually the method you’re using is actually doing um this is more true for like uh for like uh C plus plus code and stuff like

That there was like a pre-compile for you uh but most like open source projects now like have their code visible solidity even though you can open source your own contract there is no way for you to sort of inspect the code on the blockchain itself there’s no way when you’re actually saying okay

I wanna I wanna call uh or execute any kind of method on on the contract I’m not sure exactly what kind of code it’s executing um and I found etherscan has this like useful feature where you can actually inspect sort of the codes source code the smart contract source code

Let me admit somebody here um and this is not true for most contracts that are actually uploaded and deployed um it’s actually a process that you literally need to do manually so you need to go in here and you need to upload the the original source code for

You and they do some kind of verification um and they verified that you know whatever is on this address on ethereum the the contract by code actually matches whatever you whatever source code you deployed um but other than this there is no real way for you to sort of know exactly what

The code is doing for you um and it’s sort of um creates two problems primarily for for blockchain developers one problem is this complete lack of transparency even even like it sounds crazy because we’re talking about blockchain systems but um it creates the sense of uh lack of

Transparency where you we have no idea like what’s going to be executed as soon as you interact with some contract or interact with a piece of code on the blockchain and it creates the second problem the second problem is uh it creates this like initial barrier for new people who

Want to come in and they want to work on they have like an idea for for a blockchain app or they want to integrate or migrate some some existing logic that they have on the web too they want to migrate to web3 and they sort of have this huge learning curve where they

First need to learn like a new language but also they need to learn all of these like different different ways solidity has been misused in the past so they don’t fall victim to it right um and this is sort of uh going in the opposite direction of increasing blockchain adoptability and increasing

The user experience for new Developers um and sort of the no project is something that’s aimed to solve uh aim to solve a lot of things in my like modern blockchain systems but primarily it aims to solve this very problem of lack of transparency and accountability

For smart contracts and ease of use for new developers that want to come in and they want to want to basically contribute to your blockchain ecosystem right so what is no you know stands for two things primarily one thing is it stands for no Lane the language that we’re going to actually

Use for this Workshop but it also stands for um the platform that we’re building so no is a layer one blockchain that’s run by techno VM so the runtime is the novm and it executes smart contracts that are written in Nolan and no link is this

99.9 uh identical version to go that you can actually use to write smart contracts uh and sort of the powerful thing here is even if you’re coming from a web true background where you’ve never used go before you’ve for example used python or you use Java or you’re coming from C plus plus

Um you can very easily pick up go because go is very easy to pick up you don’t have to be you don’t have to be constrained by the actual runtime like you are with litty you don’t need to learn about like existing hacks for the language

Um and you sort of have this Clean Slate where you can uh really focus on what you’re developing and not have to worry about am I using the language right am I am I optimizing this you know this solidity code to be as optimal as I can like I’ve met people who’s literal

Full-time job is to go in for like these very big contracts that are used and optimize certain chunks of The Code by either like completely extracting chunks of code out and using like assembly uh just so they can like save on gaskets right um and the no project sort of aims to put

That aside and just give you the powerful tools of go and the powerful tools of blockchain to develop your own blockchain applications and to serve further blockchain development um there’s a lot more to it but this is uh primarily the thing you know uh the

Things you need to know uh in order to begin this Workshop um sort of prerequisites that you need for a workshop um because we’re going to be going into the code soon you need to go 119 that’s like the the minimum version that we require um I strongly advise that you do this

Workshop on Unix systems or on vsl too uh why because we use we use a lot of uh a lot of Unix tools like make file like make um for for like building out scripts and building on our binaries um and yeah uh you’re you’re probably

Gonna run into problems if you try to use this on Windows machines without like seriously prepping prepping ahead um and yeah um this is a this has been like a lot of talk uh and a lot of shade on solidity uh but I just yeah it was certain

Required for me to explain uh why why you know no exists and why we’re actually doing the workshop uh and now yeah I’m just sort of going to draw exactly what we’re going to be building so the the whole point of this Workshop is to build

A forum instance on the no uh blockchain so we’re gonna see how you can write uh no contracts how you can test no contracts how you can run minimum contracts we’re going to see how you can actually interact with them um Calder methods deploy them uh change some things

Um and we’re just gonna I’m gonna take you from like zero to to finish uh to finish on this so you can see like the whole workflow and how um how we already like use these tools that we have at our disposal to uh to like develop new blockchain applications right

Um yeah so the general idea behind the Forum that we want to build is um and I’m drawing here from looking down um we want to sort of have a system where if you imagine this like as any kind of browser window we want to have um

Uh we want to have a forum where basically the top level split is between categories so you can have like category one category two category three and when some user clicks on a specific category they’re shaking to a page where sick they are taken to a page

Where they have like specific posts and these specific posts have um either like a title a body and they have like specific comments right there’s a much nicer graphic on the hack and document that uh Michelle shared uh but this is sort of the gist of it so we

Want to have a post the users can create we want to have comments the users can add to posts uh we want to have this top level split between posts that are their groups or by categories and we want to have like a special uh user that’s called a moderator and the

Moderator can um and the moderator can um a point like different different users to moderate the post right so they can point somebody to delete a post if they uh if they deem it’s like infringing on any kind of policy of the actual form

Um and sort of the way we’re going to do this is we’re going to do it in uh in in in two parts one part is we’re actually going to be developing uh the library for this so uh something that’s called a package and in the second part

We’re going to be doing like the actual smart contract development which is called the realm um and I’m gonna going to enter details on what what exactly these are saying no you sort of have this um if I can scroll down you have this um uh what is the English word for Jesus

Um you have the split sorry between between logic uh that’s called a between a package and a realm and I hope you can understand my horrendous handwriting a package is usually something that does not hold State um a package you can think of a package

As just like a bundle of code that does not have any kind of uh stay keeping it it does not have any any kind of query methods you can ask it for it’s like specific State you can think of it as basically just like a library that you can import right so

Just like a bundle of code any kind of library on GitHub video import you can actually use it as a package right um so it has no no state right um Realms on the other hand are actual smart contracts that hold state for you so they have

Kind of variables they can hold State they have methods that you can interact with them um and they they are what actually Powers your your application right so this sort of uh this this sort of uh split between between like different code Logics uh is is very important because we’re first

Going to be developing this Library part and then we’re going to be developing the actual Realm um so I I hope like the the difference is clear so packages are just like libraries they don’t have state Realms or actual smart contracts that uh that hold safe for you

Um someone has their hand raised yes yes uh thank you for the explanation uh yeah so if uh if I understood factors if you’re saying that packages are kind of like library and then the actual magic happens at Realms where we write smart contracts and we use this packages all

Right yes yes yes yes you’ll see exactly what I mean yeah yeah you’ll see exactly what I mean as we sort of begin to get into the code yes yeah so just to clarify so so the packages are not kind of like mandatory then because if it is Library

We can write some minimal code uh like a like a basic smart contract without without a library also correct yes yes yes definitely you don’t you don’t need a package to use your own and also you don’t need a realm to to use a package or this Workshop is sort of focused on

Building both so you can understand the difference between both right thank you thank you no problem um yeah so I guess we can sort of get started with with the actual tutorial um yeah uh just just like to give you an overview of the setup the setup they have now um

I have an ID that’s open uh I have a fresh version of the no repo Clump so uh let me paste the repo in the chat so hey oh yeah any kind of command that I’m running or any kind of like bigger code snippet that I’m pasting in

Um you can find all the code Snippets and all the commands on the hack and D document that Michelle shared um but yeah if you have any questions just like uh uh just put them in chat or like raise your hand we’ll tackle them in in due time but yeah sort of the

Setup that I have right now is I’ve cloned a fresh Repository um inside a folder here so it’s the latest commit that we have on the current repo and as soon as you’ve sort of cloned this repository they’re uh there are two things that you need to really do one

Thing that you need to do is you need to run the make build command um and if you look into the project repository we have this very extensive make file um and basically what running the make build command does is it builds out all of these like different binaries that

We’re going to use uh but also like more importantly and make sure that you actually download the dependencies that we have in the background right so just make sure you have go 119 um and they’ve cloned this repo and then they have like the make tool installed

In your system and you can actually run the makebelt command and it’s going to build out all of these different tools that we use and I’m going to explain like the key tools that we actually have uh okay okay uh so now that we’ve actually built

Out these tools if we look into our so repository we have this folder is called build and inside the build folder we have these binaries that are called node Dev no fasting no key no land um these are different uh tools that we’re going to use for for development and we’re

Going to sort of explain the majority of them here um but one thing before we do that you also need to now that you’ve built out these tools so they’re in the actual and they’re in the actual build folder you need to install these tools globally so we can just use them

Um you can do that by using make install so make install does is it runs installed nodev and installed no key so it basically just makes the binaries available globally um from your root repository so all these commands are ran from the repository of of the repo okay

And now that you’ve installed them you can run you can check that they’re installed correctly by running no key help and it should give you sort of the help output for a command or you can run for example I think it was uh yeah it was no Dev said no Dev help

And we can see that this binary is available globally and we can actually run it right okay um yeah hopefully nobody had problems with that um okay and we can we can sort of jump into like the actual code of the workshop I’m sorry it took like so long

Um to get to this point if you look at the repo structure uh you’ll find some a folder that’s called examples and inside examples you’ll find a subfolder that’s called no link knowing has these two subfolders that are called P and R P stands for package packages R stands

For Realms and this is sort of where we’re actually going to be putting our our actual source code um the reason I’m sort of showing you how to how to uh the reason we’re putting the source code here is I sort of want to incentivize you to if you

Have an idea for a contract or a realm for a realm or a package that you would love to see um unlike the official repo or in the official testness you can actually make a contribution open up PR uh just just like put your source code here and we

Can we can review it and um it’s going to be available to everybody for everybody keys so if you actually open up these folders you’ll see that we already have some predefined packages for example if you open up examples no land he demo you’ll see that we already

Have like something so we have for example a package for blogs we have a package for the AVL tree we have a package for groups for formatting these are very specific libraries that we’re going to actually use within this tutorial um and if you open up the Realms you can

See that we have specific contract implementation so you can think of this as very specific uh contracts they hold States so for example we have an equivalent of erc20 we have like Foo 20 right so this is like a an erc20 equivalent on no link that’s called food

20. just like you can deploy any kind of ERC token that you want this food 20 is like an example of that of that token right um and and like further on or further on but for now we’re going to focus on building this package right uh so what

I’m going to do is I’m going to create a new folder here inside examples uh no land uh P demo so inside the demo subfolder I’m going to create a new folder that I’m going to call for okay and inside this form I want to create a new file

And I’m going to call it post dot no and take care that the extension is actually dot gno so not DOT go but Dot gno it can be using um you can be using a visual studio code we actually have uh I think it’s like an unofficial extension but one of the core

Team members uh for visual studio code for note that sort of sets up sets the editor up for you uh where you don’t have to tell it to recognize no code AS go code uh it just like makes your makes your life easier but I’m using I’m using Goliath here

Um and I sort of Set uh set this to recognize any kind of dot gno file as uh as a go file basically so I have like syntax highlighting okay so now that we’ve created a post doc note uh this is sort of going to be our

Library equivalent of a specific post so what we want to do is I want to say that this post is going to be in package Forum because we’ve sort of put it here um in inside a package form I want to define a new struct which is called post

And when you think about it the things that we want our posts to have is sort of we wanted to have an ID it can be a unit for example we wanted to have a title we wanted to have a body and we wanted to have a category right

Because if you if you remember um we sort of divide divide post into these buckets that are called categories so each post has belongs to like a specific category for for this like example right um but we also mentioned like one thing and that is uh we want uh we want to

Basically give users the ability to actually comment on posts so we can assume that uh this post is actually gonna have some kind of comments right one more thing that we need to add is we sort of want to keep track of who is the actual author of this post

And we’re going to do this uh by using author and specifying the type should be STD address and you can see that my my ID is sort of freaking out because um it has no idea how to actually import this um but I’m going to show you in a second

So what we’re going to do is we’re going to import STD on top of the file um and it’s still like showing a squiggly line because it doesn’t have like intellisense for for no files yet we’re still actually working on adding a goal and support

Um but yeah for now you can import this using std.address and std.address and I’m going to show you exactly what the STD package is STD package just like any kind of built-in go package they use for example like bytes or um I don’t know crypto Rand or stuff

Like that stuff that’s already built into the language STD is sort of a built-in import for note um So within any kind of no file we can use this import STD and it’s going to be injected as this file is being parsed right so you’re going to have access to

This address right here um and yeah for the post so it has an idea title a body a category uh it has like some comments and has an author and I’m going to show you exactly how we’re going to use STD address and what STD address actually is

Um it sort of it sort of ties into like the other the other story right um okay so we want to create a function that’s going to give us a post so what we’re going to do is uh create a function that says it’s called new posts and it takes in an ID

It takes in a title it takes in a body and it takes in the author right and it gives us back like an instance of a post so this is like just regular go code that I’m running right here okay um and I want to return

Just a new post where the ID is the ID there passed in the title is the title the body is the body the author is the author they’re investing in um and the comments are just like an empty array of of comments for now right right we want to use okay

And additionally we can also for this uh post struct we can also Define some getter and Setter methods and just for the sake of time I’m going to paste in these Getters so just like very basic go we’re just grabbing because these are probably Fields we’re just grabbing the ID

Grabbing the title grabbing the body grabbing the comments adding the comments uh stuff like that so just like very basic Getters and Setters right so if you look at this file it’s it’s a very basic go file you would if this this was like a go extension um

You would not really see the difference if if it could like somehow resolve this STD right um yeah um one thing that’s missing here is we need to Define because we used we said uh we said that posts have like this concept of comments right um so we can create a new file

And we’re going to call it comment.note within the same package form and we sort of want to Define it right so we’re going to go type comma instruct um the comment just has like a regular body so nothing special and has like some kind of author right that’s also

Going to be associated with an address here right and for this comment we’re going to define a instructor just takes in the body and returns common the body being the body and notice that we didn’t pass in the author there’s actually one way that you can actually get the author because if

You remember this is a library package but we also it uses uh this concept of injected packages that we have so STD we can use because we import STD we can use a built-in method of STD that’s called STD getforge caller and what this basically does is this is

A helper method that as the no VM is actually parsing this contract um whoever is the caller for the smart contract that’s actually using this Library here their address is going to be extracted right here so it’s it’s sort of very similar to um I think the solidity equivalent is

Message.tender so message.censor is something that’s like available throughout your your contract that you can use uh for for no you can use STD get origin caller it’s going to give you the address of like the actual person that’s initiating this transaction that’s that’s calling this new comment method right um

And also for the comment we’re going to Define uh together so one getter for the body and one getter for the author right um the author of course can return an SD address the body returns um just the regular string body um okay and we have like this uh very

Fairly simple logic so we have a post um that we can set and we can grab we have a common um that we can create um is there a way that we can actually figure out if this works without having to deploy uh deploy like the whole

Library and just like write contracts to test the library and stuff like that um before we dive into that I think somebody raised their hand or no yeah I’m imagining things okay so we’re going to find a couple of tests here one of the tests that we want to Define

Uh let’s define a test for the comment first right so the comment is a very simple it takes in a body it takes in an author um it has like together Getters we want to test out whether or not this new common method actually works and whether

Or not these like Getters work as well right uh so we’re gonna create a new file and we’re going to call it comment underscore chess doc no so exactly is the way you would sort of create any kind of uh test file so the only like

Difference is it’s Dot gno and not DOT go this is of course going to be in the package form and we want to write a new test so the test is going to be test common because we’re testing the comment um new it takes in a testing t

We can of course import this from the sander Library um and we want to define a couple things here so we want to Define some kind of body that we want to use this common body okay and we want to Define an author right um

We uh this is sort of a moment where when you’re creating a comment when you call this method we need a way to mock this call right here so we need to because this method of course does not take in who is the author um the VM actually discerns that as it’s

As it’s running so we need to have sort of a way for us to mock uh this STD address so that uh when it whatever is being returned here we can actually set it right so STD has this um actually a city but we have like a package within ignore input it’s called

Test utils um and it gives you the ability to define something that’s called a test address mm-hmm oh um give me one second I have no idea I have no idea why why what what is the difference between these uh but yeah we want to use this test utils uh but

Test utils if you actually look here um we don’t want to use a test utils that’s like from some GitHub repo right we want to use a test utils that’s also like no packaging in and of itself and if you look into this into the demo folder there is actually a a package

That’s called test utils and if you open test utils it has a method that’s called test address and this test address actually is is what we’re actually using in this test right here so it’s going to give us the address based on some kind of input string that we give it right

Um so how do we import this package right um to import any kind of node package what you would do is you would import it as any other go package so you would say but instead of doing uh the packaging so like github.com you know slash test

Utils we’re going to import it using its package file so we’re going to say no.land slash repeat slash demo slash test your tools okay and now we can actually use any kind of any kind of public method that the testing sales package exposes because we imported it here using the the no

Package syntax right um so what are we going to do we said that we wanted to mock sort of this call right here but to actually use the SCD address we also need to import STD um okay and let’s mock sort of the the author so

The way we sort of mock this call right here so get origin color we want to put in the address that we just created here we’re going to say STD dot uh test set Forge caller and we’re going to put put in the author right here

And we’re going to create a new post a new comment sorry you come in using the body that we that we created right here so what’s happening basically is we’re creating a new comment using this string right here we’re sending the output of this STD get orange color to some

Address that we know like in advance that we want to mock right um so the way we can actually test if this works is we can check if P dot get body um is actually the same as body and if it’s not we then we can fail right so we do T

Theta left um in a valid body right um and we also want to check if uh get author is sorry that string we want to compare the strings uh author string um see fatal invalid author right okay so basically what we’re doing is we know the body in advance we know the

Author in advance when we create a comment we just want to test okay has a comment been created by this author with this body this is just like the very simple a very simple uh test right okay and sort of analog to this we can create

A test for the Post right so we can go post test uh post test.gmo in the same oh wait I can speed this up a bit we can create a test for the post as well so when creating a new post what we do is we predefine like an ID we

Predefine a title we predefined a body the category the author the author in the same way that we’ve predefined over here um we create a new post we set the category and we basically run these Getters and make sure they return the data that uh that they’re supposed to

Return right so the data that we passed in we just make sure that they return it right uh so we come to sort of a problem here um and that’s okay we have uh these you know files and we have this these uh testimonial files how do we actually run

These tests like if you look into your ID or if you’re using like Visual Studio code there’s like no play symbol here for you to actually run it there’s no like fast forward button to actually run this entire test Suite um and this is sort of where the tools

That we installed at the beginning uh come in um if you remember we installed something that’s called uh no Dev and ignodev is essentially a development toolkit that makes your lives much easier when you’re developing no contracts it allows you to run the specific node files to pre-compile them

To test him to manage ignoma so which is sort of analog to go mod um it it gives you like all these different options and the option that we need right now is like any kind of way for us to run um these specific test files right

So the way we can run them is we can say okay I have no Dev test we run the test increment and we say uh we want verbose output for here and you can actually see the uh what kind of flies you can use if you run

Uh if you run anything with a dot dash help it’s going to give you the default values in the flags right so we want to use ignodev test uh verbose and we want to give it sort of the path to these uh no test files that we have right so we’re

Going to give it a path where from the root it’s going to be examples examples you know land P demo Forum right and if we run this um we should see our tests actually passing and this looks like regular go output so it’s running the new common

Test it’s passing it’s running then you post test it’s passing um and it’s returning a status that everything is good right um okay uh now now that we have sort of a post and now that we have comments we need sort of an entity instance of the form

To actually keep track of these posts keep track of these comments like uh keep track also of moderators um and just like additional metadata stuff right and remember because we’re building a package here it needs to be as general as possible so any kind of forum instance can actually use it

Um any sort of ties in with the story where the realm that we’re actually going to be a building so the smart contract that’s going to be actually using this forum package it doesn’t have to be a forum for one specific thing like somebody can have a forum for cars

Sometimes they can have a 404 uh Samsung TVs right um the the point is they can use this library that we built here to create their own formulas that can be completely unique for whatever they’re building uh so this is why we’re sort of writing this to be as general as

Possible it doesn’t have like any kind of um it doesn’t specialize any kind of data for you you it just gives you a package and you can use this package later when you’re writing your own in performances right just like I mentioned where somebody made 420 which is like an erc20 equivalent coin

Um that they deployed right or Foo 721 which is like an nft right um so what we’re going to do is we’re going to create uh within this forum folder we’re going to create a forum.gno it’s going to be package form and within package form we are going to define a forum struct

That’s going to have an eight so any form that people create it’s going to have a name right so it’s going to have a posts um I’m Gonna Leave Three Dots here because I I want to show you uh categories it’s gonna have if you if you

Remember the way our form works is we’re sort of group the posts by categories like induced category buckets is going to have an admin so it’s going to keep track it’s going to know who who actually create a form who can like make specific changes like um a point moderators uh change policy

Stuff like that right so we’re going to have an m and we need uh moderators right um and the reason I left sort of these three dots here is um there’s there are essentially uh two ways that we can uh Define this so we can for example if

We’re going naively about it we can sort of see okay well posts are going to be specifically like an array of posts and categories or it can be an array or it can be even like a map that has the maps to some string or whatever

Um but there is one other way that’s more optimized uh when you’re using no and this is called an AVL tree um and it the way you can think about an AVL tree is it’s basically a value map so well what we’re going to map here is

We’re going to map the post ID to the actual post right and for categories is also going to be a tree and we’re going to map the category name to just this like list of posts for that category uh for DM and this is the address and

For moderators it’s also going to be like the lookup map and it’s gonna it’s gonna map the category name to just like a list of user addresses that are moderated so whenever somebody wants to look up if for category X somebody is moderating they can just ask

The ask this map and just uh see if if the address is here also if you want to fetch post for a specific category you can look it up in the categories here so this is sort of the reasoning behind it right and you probably guessed it if you if you

How do we actually import the AVL tree and stuff like that my my ID is freaking out here because uh it’s trying to resolve this import but if you look into the packages AVL is also of no package so AVL has it’s already a predefined package that

We can use to create new trees to create new nodes to look it up so we’re not going to import using this like GitHub syntax we’re going to import it using you know dot Lan slash P slash demo slash AVL so this is the package that we’re actually importing right here

And because we use SD address we could also import STD right um okay um and just because I see it we’re running out of time I’m going to speed this up a bit um I basically what this method does is it creates a new pharmacist where you

You as like the actual form of administrator can define a name you can Define the categories that you want and you can Define who is actually going to be managing this form right so what this method does is it creates a new form instance so just initializes everything and it initializes

Um our map right here so basically the logic behind this this method here is whoever is the admin of the form is also sort of the moderator for every kind of category right so this is basically what Line 39 does um and yeah we so we instantiate the categories we instantiate the moderator

Set and we return like a creative form here um or the Forum we also Define a couple of getter methods so we need we need to wait for uh Realms that are actually using this form uh this forum package to be able to grab the name to be able to grab the

Categories to be able to grab the posts to be able to add moderators to remove moderators stuff like that so we can Define all together Getters um and sort of I’m copying this off screen but you can find this in the in the hack of the document shared by Michelle

So there’s a method for fetching the name there is a method for fetching the categories and I’ll get back to this in a second because it’s very important there is a method for fetching the comments um and there is a method refreshing the posts um and just getting like a specific post

By ID so if you remember the way we sort of use this AVL tree is we use it for a mapping right so we map some value which is a string to any kind of arbitrary value right here for the Post we’re mapping the post ID to the post like a

Specific post object or the categories we’re mapping the name to like the list of posts right um the way for for you for example if you wanted to fetch what are the categories uh for a forum uh this is just illustrative because I want to show you how you can Traverse

This map it’s very similar to how you would use a sync maps in go so if you remember sync wraps they have this um and this funky method that’s called range and range what range does is you give it a callback method um that it basically calls for each each

Item in the map uh it does like this map traversal under a hood like by itself but the point is it calls this callback uh for each element and if you need to make sure this callback actually returns a Boolean and this Boolean actually just indicates whether or not you should stop iterate

Iteration at this point right uh so um AVL tree dot iterate is sort of very similar um it takes in a function that you can specify for that’s going to be called for each each element right now because we’re actually just want to get a list of the category names we’re just going

To iterate over all the category names and just grab them up into this array um and just continue iteration until we uh iterate over like this entire map um this is just this is for it for illustration purposes um I don’t think anybody would have right uh or would write like a category

Grab like this but just to show you that this actually works you know a single microphone makes some strange noises yeah I will never figure this out okay um so this is sort of how you would iterate for each element right so how you would do a range on this AVL tree

The way you would actually fetch an element from the Avail tree is there it has this method that’s called get um and it returns um of course it returns like an interface so any uh and you need to cast it back to whatever whatever you actually store it right so for posts

When you want to grab comments for a specific post what we do is we go to this lookup map and we say Okay post grab um the post that has this ID and if you found it just like cast it back and give me the comments back right and this get

Comments is of course from post um from post get comments right um yeah and sort of all of these Getters are sort of based on this uh same idea so you you iterate you get you store um stuff like that um there is also uh one more thing um

If you notice here we have ufmt.sprintf this is also a package that we use that’s called ufmt and because it’s a signal package we actually we actually need to import it here so if we go uh no uh dot Lan slash P slash demo slash ufmt right I’m gonna sort it

Okay and now that we have like these Grabber methods we can also Define specific Logic for um adding a moderator adding a post adding a comment um and keep in mind let me just go back okay and keep in mind these methods need to be like a

General as possible so the actual realm that we’re going to be writing so the actual Forum instance is going to have a reference to a forum object that’s going to be using these like helper methods to actually keep track of state right um so if if the form instances wants to

Sort of have moderation it can expose this method it’s called add moderator that the admin can call and internally it’s going to call this this method right here that we defined so add moderator simply just checks if whoever is the caller is the admin if they actually have permissions to add the moderator

Um and they just set the moderator right um similar for posts it’s a similar story for comments also for remove posts it’s um it’s a check where you need to check if you’re the moderator and if you’re in a moderator you can remove the post right

It’s sort of a chunkier piece of code and you can find find like this entire piece on the on the on the actual like tutorial but just for the sake of time I’m sort of speeding through this so I can actually show you the fruit of what we’ve been making

Um and this sort of uh brings us finally to um a point where we can actually also write a test for this so we can say Okay forum test doc you know um and again saving time so we Define it a test where we create a new form and we make sure

That the name is correct that the admin is correct we have a test where we add a post so we add like um a specific we create a forum using these parameters we had a post with these parameters to make sure the post actually exists we have a test for

Removing the post where we add a couple of posts and then we remove one um we have points somebody as a moderator they can remove it um stuff like that we had uh a test for adding a comment so when uh you create a forum you add a post you can add a

Comment we just validate that this that these methods that we just written down wrote down work right um so basically the same way as we would test this before we run you know that test verbose now you don’t need the verbose like this is just for for us to see um

You put down the path to your package whoa something popped up let me see I probably Miss type something one second here I probably missed like something when I was when I was doing here um like I copied the code from from the from the guide so

Um we run the test the same ways which has to form the same way as we say I suppose so we can see that these tests are actually passing uh and this basically concludes our package and now uh for the actual forum the like the whole point of this is um

We have a library that we can use now that anybody can use to create their own formations right um and what we want to do is we want to create an instance of this form that’s for example called uh I don’t know like no overflow right so so a specific form

Where you can ask questions about no um what we do is we create uh so now that we’re finished with the package we’re going to create the actual realm that users can interact with right um so what we’re going to do is we’re going to create a new folder within uh

Examples known in our demo it’s going to be called let’s call it form as well um and within this form we’re going to create whoop we’re going to create a new uh file that’s going to be called forum.no okay and within form I’m not gonna know we’re

Gonna it’s also gonna be a package form um and I’m going to show you something that you can never do with packages but because we’re writing a realm this is going to work so I’m actually going to Define variables for this contract um and this is the state that I was

Talking about where packages don’t actually hold state but Realms hold State and they hold State during execution so across transactions this state is going to change it’s going to be saved right um so what do we want to save in the state we want to save obviously like the name

We can call it for example you know overflow um we want to save like who is like the actual admin um and it’s going to be undefined for now um we want to save the categories that we have right so um let’s have like a general category we can have um

Devs and we can have announcements okay so three categories um we need to have a reference to the actual form and notice that it’s giving me sort of this intellisense is sort of lying to me but yeah I can actually import the form the form that we’re actually going to be

Importing is the package that we just created right so it’s going to be an instance of a form um and we’re just going to keep track of a post index um just like a global Post index for this right um and because we imported this we need to sort of

Um fix this inputs so we imported address we need STD we need we imported um also the form so how do we import the package that we just created well we go know the land slash P slash demo slash Forum okay um and yeah um and I’m also going to write a

Constructor method for this realm so whenever you want to deploy this this method is actually going to run and the way you run basically reconstructor methods is you would do uh funk in it and I know any methods give people and go give people like the heebie-jeebies

Um but this is how you will write a Constructor and no so whenever you want to deploy this actual realm this very specific realm that’s called you know overflow Destiny is a form this method is going to run once uh and it’s going to initialize like this this initial

Stadium you have right so the only thing that’s sort of Left for us to initialize is this form object so we want to create we want to go Forum f is forum.new forum that takes in a name the categories that we put down and it takes in the admin

Address that we specify right here um okay um now uh because we sort of did most of the heavy lifting in the package if you remember our package has Logic on how to add a post how to add a moderator how to remove posts how to um

How to add comments stuff like that um we for the realm that we’re specifically trying to deploy we don’t need to rewrite those methods again we can just use them because they’re part of this library that we just wrote um so the way we Define it we Define these

Methods is we Define a method for adding a value a monitor sorry um we check if somebody is already a moderator and if they’re sorry we we tried it we call the the package method for adding a moderator if it succeeds we return like um moderated with the successfully at it

If it doesn’t succeed if we return like some kind of error message for the Post it’s very similar so for the Post we what we want to do is we want to get the actual title the body and the category for the user um and based on this information we

Construct a new post object we set the category and we add it to the form and we just increase like the global Post index so we know um so we know sort of what is the next post ID right um for the comments same story the user

Gives us the ID the user gives us the body uh the post ID of course they didn’t want to comment on the body of their comment we try to add it um and for removing a post it’s sort of similar um and this sort of brings us to

Let me just make sure that we have the Imports the correct Imports here okay and this brings us to sort of this other important part which is called uh rendering and if you’ve sort of looked into uh you know you can see we have we have a public testing that’s running

I think it’s a the third one and it’s very because I want to sort of demonstrate what this render is if you um it’s sort of the render between packages and Realms so if you actually open up a package packages do not have render methods the

Whole point of a render method in you know is to sort of allow users to have a visual insight into the actual uh state of your of your realm it can be anything you want so your render method for Realms can display any kind of message that you want it can display the

Internal State as we’re just going to display or it can it can basically not be defined you you don’t have to define a render method for uh for your for your realm but just to give you sort of an example the way you would for example View

Um a render method for food 20. so the render method for 420 if you open it up the render method displays basically um which accounts actually minted this uh this token what is like the total Supply how many decimals it has right so this is example of random another

Example of render method would be users so if you open up users it gives you a list of users and you can click here on a user and they can actually see like some kind of information on that right but these are specific render methods that are created for these specific

Contracts and it can be completely different from of one one another right for demo it doesn’t make sense and you cannot Define a random method for a package because it doesn’t have any internal state that it needs to render for packages you can actually see the source code

Um you can actually see exactly what you’re importing exactly what you’re running so the code you see here is the code that’s actually being imported when you actually import um when you actually import it into your realm right um so this render business um is um what we’re going to be focusing on

Next is sort of bringing this this Workshop to a close um and you can find detail the details on this render method um in the actual Forum post um but basically the gist of it is this we want to have um the any kind of Realm that needs that

Wants to show off this logic it needs to define a method that’s called render that takes in a path which is a string and returns a string and the the very important part here is this return string can be uh in markdown um meaning you can actually format it

You can make it look nice you can add line breaks you can add titles um and this is actually what we’re going to do for our render method um so we want to say okay if somebody opens up the base oops sorry so the base um the base URL of our Realm

We want to render some kind of homepage right so if you’re if you if I think I deleted my ugly drawing but the home page for our forum is going to have like categories where users can click and they can be taken to a list of posts right

Um and if they’re on a posts page we want to render if if they’re on like a specific category page we want to render to post right um and if they open up a specific post then we want to render to post with the comments right

And I’m just gonna it can be very confusing if you’re looking at this and you’re saying okay length of Parts is two and parts of zero is suppose what this basically means is if somebody opens up for the path to be the home page it needs to be our demo form right

Because we’re going to deploy our realm here right this is just like the bass but if somebody opens up our demo forum and they say okay uh post slash zero they want to view the post ID 0 the post with ID 0 . this is basically what it means

Um this post here means that we’re matching we’re doing this like string matching where we say Okay um somebody wants to view a post uh with the id0 right and we grab this from the second part right here um the analog is sort of for the

Category so if somebody wants to view a specific category um um they can do it like this so we match the category for part zero for parts one is going to be the actual category that they want to view right um and to sort of make this uh I’ll I’ll

Sort of paste these methods for rendering uh in a second to show you exactly how they work um but before I do that I need to fix one thing and this is I need to add this forum prefix because we use it it’s sort of oops one second

We use this forum prefix later for uh for rendering and I’m going to show you how we use it in a second and just to make sure our inputs are okay I’m just going to copy this okay so if you go to interrender and you see

Okay we want to render the home page so for a home page really what we need is we want to display the name of our form we want to display the categories but we want to display the categories is links so when somebody clicks on a category

Name they’re going to be taking to a specific page where they can actually view uh the posts right so what we’re going to do is when somebody when we want to render a homepage we want to gather um basically we’re constructing this markdown as we go so we’re going to

Construct like a header that says Welcome to our forum and for each category we’re going to create a link that links back to that category in the way we sort of construct this link is we use this forum prefix to um basically let the router note uh when somebody

Clicks here they want to view that slash R Forum uh polling category slash and the category name right and this is the same um it’s the same idea for the posts and it’s the same idea for rendering comments so when you want to render a comment it just constructs markdown for

Rendering a comment right here okay um and yeah I can actually show you how this works and how how we can use it so the bulk of our logic was in the package the only thing our Forum actually contains is this Constructor where we create a form and these methods that we

Expose that people can actually call people can’t call directly the package methods right because this is just library but they can call realm realm methods and this is sort of how to do it you if you expose them and people could call them using their own using the parameters right um okay yeah

So we come to this point where um we’ve written down the realm and we’ve written down the package um but we sort of want to deploy them and we want to interact with them and when I see how they actually work um and to sort of interact with any kind

Of blockchain like even even for deploying solidity code you need to generate something that’s called a private key um and a private key is something that’s associated with the address that you’re using on the actual blockchain hopefully um luckily uh we have a tool that we uh we created earlier that’s called winoki

And one of the cool things about gnocchi is that it has this sub command that’s called generate um and it also has supplements for like exporting importing private keys and stuff like that but if you if you do not have any private key that they can use

And they’re interesting that you can use we can run gnocchi generate and what gnocchi generator is going to do is it’s going to generate a bip39 mnemonic then we can actually use to derive the private key so what we’re going to do is we’re going to go say okay no key um add

Dash dash recover and we need to sort of give a name to this key um I’m going to name it admin key so what we’re doing is we’re going to say okay no key I want to add a new key that’s going to be called admin key um the recover flag basically instructs

You know key to ask us for a mnemonic that he can use to recover the actual uh the actual address in private key right so what we’re going to do is we’re going to copy this mnemonic that we generated we’re going to run a no key ad it’s going to ask us

For a passphrase to encrypt the key and disk just give it like a simple press phrase and it’s going to ask us for the 39 mnemonic um I’m going to copy this that we generated earlier and it’s going to generate a key for us that’s called M and key in the address

Is G18 and NVC blah blah blah the way you can see all the keys that you have is you can run no key list and it’s going to give you a list of keys right um okay now that we have a key to actually deploy the contract uh we need some kind

Of native currency funds right and there’s two ways that you can sort of generate funds one way is to pre-mind them so if you look into I’m not exactly sure where the file is yes so if you look into you know land the the root Republic no land Genesis

There’s a file that’s called Genesis balances and Genesis balance is essentially the initial balance sheet that’s going to be applied when somebody actually starts the the blockchain network right um so we want our our address here that we just generated to have some funds when we actually run the network there

This is one way of getting funds the other way is for is uh create by creating a faucet if you actually look on the official Nolan website what we have is um I’m not sure where is the faucet here yeah we have like a faucet that you can

Add your address and you can get some uh test funds right um and you can just sort of do the same on your local network where you can spin up a faucet locally and just have it instead of like pre-mining uh for one address you can spin up a faucet and

Just have the faucet basically dish out funds for you so what we’re going to do uh but just for the sake of time we’re going to duplicate this last line in Genesis balances oops um and we’re going to put down the address that we just turned so we want our address to have

Um this many this many uh tokens this many uh listen this amount of Nate currency sorry as the as the blockchain starts okay and now the blockchain is not yet started the way we can start the blockchain is by run the start blocking start like the actual note right

Um it’s very running uh the no land command from the build folder right so this is all you need to do you run it what it’s going to do in the background is it’s going to go through the list of all of these balances in the list of these Genesis transactions and

It’s actually going to spin up when I work for you right so right now it’s a running Network locally and we’re just going to leave it in the background um and one way we can sort of figure out whether or not our um our balance worked is if we uh whether

Or not we have like funds for our address is we can run this command it’s called gnocchi query um what the gnocchi query command does is it sort of you specify a remote node location our node is remote but it’s on our local machine so it’s going to be localhost

Gc657 you want to give it the query address that you want and just be sure to replace the last part of this query with your actual address right here and when we query this we can see okay our address g1a MVC has um has this amount of NATO currents so we can

Actually start deploying and start using the realm right okay so um I’m gonna open a new tab here and I’m gonna spin up spin updating online website so this website is for our test net I don’t want that I want to use a local website so I can actually inspect the realm and

Package so I have I just ran build website is going to spin up a website it’s very locally so this is like a local instance of the website that’s connected to the node that’s running locally on the machine okay so how do we actually deploy the the package that we that we have

Um so we can make it available to everybody else and how can we actually deploy the realm um the way we can deploy a package is we can run a command that’s called you know key make transaction and we call the the commands the subcommand package I’m just going to

Walk you through these flags right here you can find all these commands on the tutorial um so we’re specifying the package path so where we want to actually deploy this package we’re specifying where the source code actually is we’re specifying the initial deposit where I specifying

Some kind of gas fee that we want to pay and sort of the gas limit that we’re willing to pay um we want to broadcast the transaction the chain ID that we’re going to be hitting is going to be Dev because it’s a local node that’s running right here and the

Remote address the RPC address of this node is going to be a localhost 26657 and of course the final argument is going to be the key that we’re actually going to be using to uh to do this deployment and if you remember this is the key that actually has the funds that

We’ve pre-mined already so if you run this it’s going to ask us for the key password to decrypt it from disk we enter the password and we can see that um it was successful so now if we actually open up open this up and we go uh sorry and we go to

Um so our like initial address we go P demo forum we can actually see the source code for the contracts that we just that we that we were doing in this Workshop we can see the test we can see everything else um and okay so how do we deploy the actual

How do we deploy the actual realm and if you remember in the realm code I sort of put down these like little three dots here for the address because I wasn’t sure what the address was going to be um I want to put down when I’m deploying

This realm because I want sort of this address to be the managing address for this specific smart contract I can put down this address here and and be sure that when this uh realm is deployed this address or rather like whoever owns this private key can actually interact with this realm

Um so the way we would uh now that we’ve sort of updated everything the way we would actually deploy this realm the smart contract is uh it’s actually the exact same way that we would deploy a package um the commands are basically the commands are identical the only

Difference is now we’re not deploying a package we’re actually deploying a realm that we have locally um and of course we’re going to use the admin key that has funds um we enter the password and we’ve deployed the realm and we can actually see how the realm looks like

Um and this is sort of uh where that um confusing render business took place if we open up this um this address we’re gonna see uh the method that we Define here that’s called render homepage right it’s a random homepage what it’s going to do is going to say okay welcome to

This forum here are the categories and if we click on a category it’s going to say well I don’t have any posts yet right um because we don’t have any posts yet but this is sort of the the whole point behind the render method is you can actually in markdown display for the

Users visually the state of of your actual of your actual realm or smart contract um and just so this this isn’t like too dull um we can add a post um that way we can add a post is uh if you remember right here um this forum realm exposes a method

It’s called Outpost and it takes in three parameters one parameter is the title the second one is the body the third one is the category um how would we actually call this method so we can use no key make transaction call we specify the the exact the exact

Path where we deployed like what what realm do we actually want to interact with we specify the function name that we want so we want to call add post and we specify the arguments in order as they’re listed so we want to say Okay I want to create post that has my awesome

Post title the body is going to be this one it’s going to be for the general category this is the feed I’m paying this is the gas limit I want to broadcast this on the developer chain on this like local writing note using my ad making this is what I want to execute

This transaction with I run this enter the the password um and is we get a successful it says post successfully added with id0 um in if we sort of go around here we can say okay well I added this under General and if I open the general I can

Actually see a list of posts that are added so for announcements we don’t have any posts but for General we have like one post that we just added and if we open it um we can see the post that we just added right so uh my awesome title that has like this

Laura some and it doesn’t have any comments yet um and the way we can add a comment is we can run pretty low sorry the way we can add a comment is we can run uh also make transaction call this time we’re calling the method add common we

Want to add a comment to the post with ID 0 and this is the comment that we want to add rerun this we said we get comments as we added and if we refresh this page you can see that this comment sort of shows up so this is

Um just like a minor example of how how the render works is um this was I think the bulk of this of this realm is just like figuring out how we want to render this to users and users can actually now for these like specific buckets they can go in and they

Can see the post and they can see the comments and they can have like additional functionality that um you’re actually you’re actually just Bound by whatever you sort of specify right here okay um oops okay I think I think that was it for the for the tutorial part

Um does anybody have any questions I’m sorry this took so long did you see some of the questions in the chat from um Shankar and code law maybe you already addressed them I wasn’t sure so uh Shankar says the render method will only be present for a smart

Contract that is Realms yes so uh like the as I mentioned like the only reason why you would actually have a render method is because you want to display some kind of internal state for your contracts you don’t have internal safer packages so you only have like you your

Realms are the ones that actually have these these variables here right um one second code law says deploy realm within error version how to redeploy I’m not sure can you post the arrow version okay Samuel says uh is there a tool to compile go to no

We don’t actually have a uh tool to compile uh dot go files to dot no files but we do have a tool to pre-compile.gno files to go files I’m not sure if that’s been done automatically here one second okay so if you if you look into gnodev

One of the sub commands that it has is called pre-compiled and what you can do is you can sync no Dev pre-compiled and you can sort of give it a path to whatever.gno file that you want so for example this is going to be this realm that we whoops one second

Let’s put it yeah forum Forum yeah so we want to pre-compile this Forum right here what it’s going to do is it’s going to take your digino files and it’s going to pre-compile them into into.go files I’m sorry you’ll make me make noise again oops is it better now

Yeah thanks yeah yeah so what this pre-compiling does is it pre-compiles your dot Geno files into go files but it also recursively pre-compiles any kind of like for example we import a ufmt package it locally pre-compiles it into go right so you can actually you can actually run this test and stuff

Like that um is there any module available uh individual yes yes so we have um we have in uh unofficial module for visual studio code it’s actually made by one of the core contributors um here I am so shout out ethereum um let me see Originals um um yeah

I’m not sure it should be on the on the awesome no right yeah um which remaining and yeah guys in general if you find good content feel free to open peers on awesome even if that’s not your content even if they’re just a tweets uh for us it’s a yeah it’s

A kind of very easy distributed way to contribute to Global documentation yeah yeah we do I think I have like um I don’t think I have visual studio uh locally but we if you if you search for no land in in the marketplace you’ll find it it’s like the only extension

That we that’s that’s called no land in the in the marketplace it’s uh it has like these um it allows you to do this pre-compiling like behind the scenes it gives you uh it doesn’t give you intelli sense yet but it sort of gives you a cool highlighting and stuff like that so

It you wouldn’t have like these problems that I have with uh the ID where I sort of have these like squiggly lines um you won’t have this problem with uh with uh with Visual Studio code uh is there a possibility that a contract can be updated once deployed on the blockchain yes

Um update it in terms of you want to update the local state like for example you want to change the name you want to change who is the admin you want to change something like that yes you can update it it’s like any kind of any kind

Of uh you just Define like a specific method that you want for example you define a method it’s called change name and somebody calls change name with like the new name and you know after the function executes it’s going to have the unit right so you you can’t update local state

And the third question well the first question was is it possible to render HTML labels with style on the render method um I think so I think we actually have one of the contracts that actually does this um let me find it see if I can find it um

No it’s not the faucet it’s the no um I I I can’t remember but we actually had like a a really beautiful render method by some contributor or for a package they wrote um for around there sorry where they use like this this this kind of HTML standing um

Uh so yeah I think it should be possible to render HTML labels um in the render method but when uh your your safest bet is is markdown markdown is like full markdown supported is here does anybody have any other questions let me check the Q a q a no questions okay yeah

So I will um thank you Milos thanks for everyone attending and this will go on the Nolan YouTube channel so I’ll send it to uh the list of uh registrants from the workshop once it’s up and then um if you guys are interested in having a further one just

Let us know also I posted the link uh for the game of Realms GitHub so you might want to check it out and I think that’s a wrap yeah this is actually one of the most important parts though yeah for game of realms so just just like give people an overview

Um game of Realms is this essentially two-phase competition that we’re doing for for no so if you’re a go developer or if you’re a blockchain developer or you’re just like somebody who’s enthusiastic about contributing um we have this a sort of challenge system where if you find like if you

Want to contribute in any way sir you can write guides you can write blog posts you can open PRS you can fix issues you can um even if you’re not like uh if you if you’re not like a programmer per se um we also have like great discussions

Like we have regular discussions on governance proposals we have discussions on sort of how this how those in the future are going to be organized um you can check everything out on this like GitHub issue that’s I think it’s actually pinned if you open issues

Um and these are these are a link back to all of our biggest challenges uh one of the biggest challenges is writing the evaluation dial the the next big one is discoverance module but we also uh we also value any kind of contributions where you write a small guide or open a

PR or fix an issue or or even like let us know about an issue right um yeah and it’s it’s been sort of it’s still ongoing we’re still in phase one uh and phase one is sort of about building the infrastructure that we need for phase two

Um and phase two is going to be about various complex um and yeah if if this seems like something that’s interesting to you if you would like to contribute anyway either in code or with your discussions uh where where you know we’re very active on on GitHub everything we do is

Public uh we’re also very active on Discord so you can join our Discord server we have actually a link here on on the official readme uh and yeah we host like bi-weekly uh calls with the community amas plug for the um we have office hours I think the next one is

Not next week but the next week um and next week we host the um the developer call which is an opportunity to listen to our core contributors and our core team um and hear what they’re up to and what they’re doing so yeah thank you everyone

For your time and I will send a little bit more details in an email follow-up thanks milosh thanks everyone see you on the next one thank you guys thanks

Hey Gnomes!

Welcome to the Gnolang workshop “How to build a forum in Gno.land” with Miloš Živković, a core tech leads at Gno.land.

Documentation

The “How to build a forum in Gno.land” tutorial: (https://hackmd.io/iB9CgSeZRwac9fbJTR7r2Q?view)

Description:

Gnolang is a Go variation and low level research Go project. For Go developers, Gnolang is a fast and simple way to build and launch smart contracts. The Gnolang interpreter is a virtual machine that interprets Gno and eliminates the need for any servers or ORNs. The VM allows for the memory state of your Gno.land application to persist automatically after every transactional function call, which is a completely new way to handle transaction volume and memory recall.

In this tutorial, we cover the tools available for developing performant Smart Contracts in Gnolang, we discuss Realms and Packages and how they differ. To illustrate these points, we create a simple forum where users can:

– Define top-level categories for the forum
– Create posts
– Comment on posts
– Appoint moderators for managing posts (deleting them)

Here is the full tutorial and documentation you can review before hand. (https://hackmd.io/iB9CgSeZRwac9fbJTR7r2Q?view)

source

Related Articles

Back to top button