Elemental Chess Technical Deep Dive 1 -Modularity-Profile-Invitation-(Holochain-in-Action 17)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so hello everybody it is a new session of college and in action it is which one weekly meeting from religion community gathering and sharing our knowledge about the about the design architect and philosophy somehow the holochain and somehow also peer programming and if you would like to participate the whole meeting is not recorded just the part which is a good content that it is good to be public in youtube we are just reporting that part if you would like to participate please go to the description you can find a link and you need to apply because it is a closed group and with the membrane so this session it is all about a technical deep dive to elemental chest so and we are going to open it we are going to see what kind of modules are inside how it's implemented how it is published how you can use it as a use case an example and how to follow the patterns so i hope we can cover all the topic otherwise we are going to have it as a part one and then continue it as a second part another video before starting this week we have a special guest eric harris brown one of the co-founders of holochain really pleasure to have eric and before everything i would like to ask eric if there is something you would like to share and you may are really happy to have you and please just oh i i don't have mostly here just to to participate and listen and support i guess the one thing that i would share is that it's to me this is a really exciting time because we're in that phase where everything is exploding and expanding really rapidly because all of the details are coming together and so the different parts are really working now and it's taken a long time it's a complicated system but i'm in this place of really just being thrilled to see the work that everybody's doing in the community and super grateful for it and grateful for your work podiate and gm your work as well so mostly gratitude and excitement thank you thank you eric and also hello to everybody else welcome so [Music] deep dive to elemental chess implemented by gear let's go to gm game can start explaining a little bit about the team about how what's happening there and i'm gonna drive it and we go to the court and we start sharing here please cool okay first of all i want to like give credit where it's to and i i did architect elemental chess but most of the implementation was not done by me it was done by manuel puentes who is a developer in ice so yeah um i i wanted to to to look if he could join us today but he couldn't so um yeah right to him and created all the uh team in ice so um yeah elemental chess is like the first um application that we have built in ice that's ready uh to go public or uh we are doing a close community test of elemental chess in a holo hosted test network which is really exciting um it's the first one after elemental chat and everything is working and we can play chess online so this is like totally amazing and awesome um yeah and this is it um i can do hey do you want me to start uh by sharing a little demo of the project or who do you wanna yes for the first step let's have a demo and then i will go for sharing and see what's happening and we will continue and please go for a demo that's fantastic okay can you see my screen yes i have it cool so um i don't want to get into the code because you're going to do it um i just want to like bring it up and uh right now i just want to give the demo you see that i'm bootstrapping two terminals and running two commands in them but i want to get into how the development environment is set up a bit after uh the demo right oh and i have the issue like i assume you are listening to me a bit chopped because i have the issue if you can see here my cpu usage is starting to to build up let's see if we can do the demo without any problems okay so we have already here ui is popping up so localhost 8000 is alice locate localhost 8001 is bob right so i'm going to just log in and we can talk later why test just works but it does uh test2 just works right so here this is elemental chess what you have seen before is the holo signing process right so this is the signing process for for follow i have to sign in again so now this is already elemental chess and the first thing that you have to do when uh um entering elemental chess is actually create your profile so you put the nickname you create the profile and you are here right let me just give you a run through of what you can do so here is the list of players you can create an invitation searching for an agent you have the pending invitations game history and current games that you're playing right so i'm going to sign up now as bob and i should be able to do alice right so bob searches for alice and now send the invitation okay let me see if i can do the signals i can show the signals correct uh correctly working right so send invitation the invitation is automatically accepted here via signal right so it's it's reactive uh alice accepts it and now both go to the to the chest and now we start playing and as you can see like everything is reactive quite fast admittedly this is only on one machine so it should be fast um but i've played this on hollow and if the connection is not horrible like i've had sometimes some trouble because of the connection uh wi-fi connection and so on that may affect it but otherwise it's pretty fast like it's it's immediate and you can play without having any kind of uh problems in the connections and so on so in this example are you so locally are you going through a proxy or are you using mdns i'm not uh going through a proxy i'm just communicating uh i'm i am going to the bootstrap server but local ip addresses to communicate it could be done with mdms it's the equivalent of mdns it's just local ip addresses on your localhost machine okay yeah exactly so let me just finish the demo here which is trying to do checkmate uh like over the oops what's what's happening here i cannot do ah yeah okay um okay and this should be checkmate yay checkmate okay so you see here checkmate you win right and now if i go back here go back here you have one loss and you you have one win okay so that's basic demo um there is not much else to show like it's an elemental chess right so um over back to you hello yeah thank you that is fantastic so we we know what's happening if it is in the destiny that peer-to-peer but let me add another layer and then we continue for those of you that so far with us or you you did follow the video or not let me explain what's happening so far we implemented quality so and then you run it locally and in the future you will you will see how you can run application so connect to other peers directly also there is another topic named holoport and holoport network so as a distributed peer-to-peer cloud computing so what does it mean it means from the elemental chess we are going to learn and to see how to implement application and host it on holo port networks so it means there are two topics implementing application use it as a peer-to-peer distributor or host it on a hollow port network so far we just did implement and run it in a local host and try to try to find a solution to just run it locally and connect to another another peer via some some pattern like a proxy pattern so i'm gonna share the link if you would like to implement the proxy pattern where to find the link so on so forth but in elemental chance chess we are going to see what is the story on a part so that's it when the topic is about the holocaust please go to elemental chess and see the pattern about the follow-up so if there is no question i would like to go and open the visual studio to see what we have so yes it is um my visual studio first of all before anything else let me share something that where to find the elemental chests on github like always after a while for sure this repository is going to be changed and improved to be sure that the content that you see in the video is going to be fixed and you always can follow again created a hologen in action branch so it's it is just only for this video it means anything you see in the video it's going to be valid for always this video is going to be connected to this branch any new changes will be applied to other branches so if you are watching this video and you would like to follow the the code please go to this one and also to this branch i'm going to share the link in description number one so and then let's go to the code so i open the code it is the elemental chest and let me also manage my here yes i'm going to start from the zone like always we see generally i open it you see we have a dna all the dna set up interesting part we are going to talk about that chaperone you see it is about the hollow port and the ui is going to be here in a dna we have a different zone if you remember we always open the cargo to analyze with we have a profile we have a chest invitation and joining code so that is great so before going here i would like to go to dna and if you already watched the video you know the video of the hello world or other videos you know when we are going to create a package or app you can we are just building all of them in this folder so i would like to go to dna and read that so it means the package of this application involved profile invitation chest so my first question again why we have this tree and the zone is one more it was my question when i was reviewing because why it is not right of dna and what is that there is something you would like to share yeah yeah totally um so we if you would like to move to show something right right yeah yeah yeah okay thanks so okay um we have set up a hollow uh development environment here in the repository which has been uh challenging in in some points because the like the documentation still getting there and and the libraries like it and there are not a lot of examples out there right so in that process one of the challenges is that if we want elemental chess to have a membrane a membrane proof um you have to set up a way for the development whole environment to be able to accept that membrane proof right and what we did is okay we set a development time we don't include the joining code zone and then we can test with whatever uh we want right it's basically because we are a bit lazy and we want to be able to develop and and see if that features are working or not without the friction of having a membrane proof right or in the future i want to improve this a bit and let it let it be so that the joining code is improved there and there is a joining code included when the uh hc sandbox is generated and installs the uh the application um i will note that one thing that's true i think inside the the membrane proof zone is that there's a property that you can set for skip proof in elemental chat um during dev time you just set that property to truth okay that's awesome yeah uh i i remember seeing that that property but i hadn't uh thought like yes that makes a lot of things of sense thanks eric wow thank you having eric it is beautiful because we are learning something thank you great so let's continue uh so it seems we have this this one let's review what we have in this zone i i i suppose i i see that most probably all the chess functionalities are located here the invitation is going to be here joining code and profile so let's go to the structure for example profile we already typed that first we go to the cargo cargo is is telling us that the profile if you remember reviewed the profile and as you can see here there is no specific code exactly it is the modularity it means we implemented holochain open there you can find a profile and consume it how to do it you are going to review right now it is a profile we already review it but we are going to take a look a little bit again let's go to the joining code joining code again leave okay it means the code is here okay and if there is anything in cargo yes joining code one part is coming from the elemental chat and another one from holochain okay we are going to see so source cargo for invitation again modularity there is no right code here you you need to go and open the invitation so that's it and for chess for sure chess is the local code so [Music] yes we have a xc10 base so okay this one so before going to the detail let's have a overview of the structure how the modularity is working and how the things i can see again before starting going to each module i i made this one so it means it is chess profile invitation journey code so so it means then i saw in a demo that you see you and there is a user registration it is profile yes it means at the beginning we see all the calling zombies profile am i right yep you're absolutely right both in ui and in zone that is great so then at the next step you use try to search me and find another at least find bob again it is part of profile yes um yes with a nuance okay um which is if you remember the searching of an agent is done inside the create invitation block right so if you want to create an invitation you have to search for an agent that's it so search for a profile send invitation is the combination of these two exactly yeah the um create invitation block uses the search agent element from profiles let me go to the invitation it means i just want to first of all to analyze where to use what yep yep you have to use which module and then we can see how how to implement so in the elemental chest here we are right now let me see also so if you if okay if you want we could we could do like a dependency tree of everything that's in chess in that in in that like if you go back to the draw diagram my diagram yeah yeah your diagram i think is is quite good so perfect so we have something like yeah you have control please do whatever perfect so we already know okay oh it's not reacting oh okay wait wait wait i just stopped and i just stopped you go ahead okay yes so chess is the top top-level uh application right the consuming application right so you have something like the profile zone coming in from holochain open dev right we have in eyes we have coded the invitation zone and ui that depends on profile right and then chess directly depends on profile as well i see and it also depends on invitation okay right yes and like for now this is all good and then chess also depends on the joining code uh create that uh holochain and the holo team has have done in elemental uh chat because the pattern as of now it has to be the same to join the the membrane proof and then there is also another one which actually it's quite big or let me see copy paste [Music] yes add new one here click on okay thank you thank you okay so and this is hc turned based game yeah um actually this is like uh i i think this is one of the most interesting things in in the whole application uh because it's providing the engine by which you can run any kind of turn-based games in holochain right oops and this is out okay so this is the dependency diagram let me clarify this because it could be better yes this is the dependency diagram okay i got it at the beginning i wanted to log in i need to use a profile modularity then i need to search and to search other users and at the left side there was a list of user it was a query from a profile exactly i wanted to search and send invitation it is the combination of these two examples other party would receive invitation which is part of this invitation and query invitation when a user accept invitation all the rest is going to be inside chess it means player a and player b are going to start chess is going to play joining code it is all about the part that maybe today we are not going to charge because it is based on the when you are going to give a ticket that the people can join so uh maybe we are not gonna cover today or this session let's see but it is clear and also uh hc10 based game chess is going to use to see who is 10 actually exactly that's that's it all the user invitations all the history of chess and or who who is 10 is here for me it's clear if there is no question let's continue okay um i have one comment which is i'm really happy in the way that we did this because it's the first application that in which we really took advantage of the pattern of uh modular zones that we have been developing and the way in which this is set up like next up in in the pipeline we have other games actually like in in eyes we want to go we want to do connect four and things like that and profile invitations and turn based game are already there for for us are already coded we have we like zero lines of code need to be added to that to be actually 100 compatible so i'm really happy and you know when you are um like happy that your yourself from the bus did the right things and so on and you love yourself a lot and and all the others that did the right thing so it's like oh my god yes yes thanks that is amazing so [Music] another part which is beautiful how to host it or a ui i i'm going to post on it at the end it means let's review the module let's review how the thing is working and then jump into the launching or actually hosting on a hollow port are you okay yes okay that's great let's continue to review the code so from here i go back to the code so i can say uh profile so again we already covered this topic how the things are working so it means you can find a profile in this url i already cloned it and yes it is profile so uh we already one time reviewed the the profile but there was some changes so is there anything you would like to mention so gm is there anything new because we already reviewed the kazoo did the tax be reviewed profile is there anything new you would like to mention [Music] no and that's the exciting part like there's actually nothing else like it can be reused as is that is great quick review for anybody that would like to see it is a profile so as a modularity you can use like always we are going to go to the tunnel to see dependency so it has just one zone so and leave entry definition it is we have some pad anchor pattern maybe also inside because it is the path entry definition we already explained this pattern a few times so we have a profile so the main functionality in zom in a quick review it is they are the main functionality that this zone provide create profile search profile get agent profile get my profile and get ultra card that's it yeah did we did we talk about the way in which share profiles works previously no i don't remember okay that's i think that's a neat pattern actually um so um and and this is proving useful now that we can search like if you remember when you do create invitation and you can search uh some agent right and if you i i'm sure you didn't get to see it clearly but that search box requires three letters to be able to start search so you can search actually for a you have to search for a l i right for alice why is that because the somewhat naive but working first pattern that we have implemented is to index the profiles right in a path okay let me go here and go okay so when you create a profile what you do is from the nickname right so the profile uh what what the profile is really is a neat nickname and fields right and here any application could have different fields and actually what i want to do is make this uncompatible with personas and profiles in following versions so that you can include this home and have direct compatibility with personas and profiles but what we need to assume actually is the nickname um and why is that because we want to provide the search profiles functionality and the way it works is that um at every point in which we create a profile there is a an anchor a path generated and if you uh go and see the path okay let's go here so this is getting the nickname and getting only the three first letters and having creating an anchor from all profiles and those three first letters right so you have things you have anchors like or profile or profiles ali which has a link to alice and to ali alicia and to i don't know more names that come begin with alice and you have also uh another path which is or profiles.bob which is al which has a link to bob uh um i don't know bob i don't know whatever names start with the same three letters are the ones that we will be indexing uh with the same path right what this allows to do is that then searching uh profile is really easy like you only if you uh ask the uh the user for the three first letters of the nickname they are looking for then you only have to do a get links on this path and it will return the profiles that you are looking for and now that i'm thinking about it i think instead of three it's better to put two letters because not that many names are are uh are the same and you will be asking for less content to the user to actually do the search but this could be configurable also i hope that makes sense totally thank you it is a nice pattern thank you got it yeah i think i think this is the only interesting thing about this home actually all the other stuff is like normal we already also discussed about the uniqueness is there any new topic about the uniqueness that we want to add or all the topics we discuss are valid so if anybody would like to know uniqueness it was the old topic yeah yeah nothing to add here from this zone this zone doesn't assume that there are unique nicknames in the dna exactly but potentially uh we could develop a new zone who tries which tries to enforce that or at least uh um notifies conflict uh conflicts arising but at least we need to have uh an export exported zone an exported version that doesn't assume that thank you i think right now i would like to mention maybe also eric would like to add something about the uniqueness it is it can be a little bit more technical can be philosophy that what does it mean uniqueness if it is above what does it mean it is about so it means if you would like to use the profile so you need to think about the identity management and what does it mean identity so gm is this gear maybe there are a thousand again but we confirmed this again so we confirm it is eric and lucas and others so and that's why a uniqueness it is it is the things you are supposed to think about that and to implement something more if you would like so that's it about the profile so it is the everything you you can see generally as you know in in a leap we are putting all the main functions so you can receive the the sense that what you can have and right now chess is especially using when you send the invitation you send it is a search profile and it was the philosophy them explain and all the rest code you can find here i think there is nothing more to share in the in the actually profile again is there any specific topic in ui a profile that you would like to share or let's close the profile and continue um if you want we can just show the search agent element to for people to understand how like because we have just talked about the search uh profile functionality in the back end so if we see it in the front and it would be like okay and this is how uh the backing on the front end assume that they can talk to each other right yes perfect so you already talked about lead element in the in the past right so lead element is a library to export custom elements so native web components really what what they are able to do is do the normal things that we can do with uh framework javascript frameworks which is rendering complex rendering and so on but they can be used across frameworks and even with vanilla vanilla js right so in this way um the module right so this is a profile module intended to be used across a wide range of different applications the module doesn't need to determine the ui framework that you want to use you can use whatever ui framework you want i'm still including these elements and using them right that's the ideal list so for example search agent right so what we are using is something called the context pattern right oh okay interesting this is a bit duplicated but that's okay so if you have used a context pattern before i think i don't think you have talked about this right yet before um right so a context is something that uh many javascript frameworks have in mind which is a way to have the parent of an element set some state and then all the children can get that state right so if i set the uh connection to holochain as a context on the parent then i don't need every element to go and get it because it already can receive it right it's like setting a global variable but it's not global really it's just for the children of the of the uh um in which we are setting the content um and this is how we can request that context right so here we are saying hey this is a dependent dependency injection in a custom element and we expect some parent to be setting the context for us i think right did that make sense is there any yeah is there any place that we used it in the because we are right now in the profile project is there any example of this one in the elementary chest that we can show yes there is okay okay um do you want that show let me bring you are looking for elemental chess it is sorry it is please it is elemental chess perfect you want to show how to set the context or how okay perfect there are two terms how to use it how do you implement the profile ui because when we call it the ui also is going to be inside our project it is element imagine i'm going to send the project name x i'm going to use profile modules so all the people are going to be there i would like to see a consumption part not that yeah yeah how i can a ui of profile exactly perfect so now we are in the elemental chess repository and this repository is actually quite wide lightweight because it's including importing everything from the different sites right so we already trill the dependency tree so we have a big chess app um element and this is lead element as well but we could be using react here or whatever since this is the consuming application and here we are importing from profiles all the things that we want from profiles i see okay right so npm install uh from github and you get all the things that you could get from from the profiles module right and then what we are doing let me scroll a bit okay we are saying here we are setting the context we are saying the chess app is going to be the root element in all our application so we can set the context of everything that we want like the dependencies we initialize the dependencies here and we say okay the context that profile store needs is this one so all the children elements are going to get this i see i see it is a story's estate management exactly yeah it's exciting so the previous video for the visitor the previous video it is not this one but generally i implemented and demo is to state management so if you would like to see what does it mean estate management please go to the previous video previous session of bulletin in action so i think we need to make the diagram here yeah am i right so it means how the components are going to be hierarchy if we put inject a store from the root all the child elements are going to receive it yeah sure um we could we could also like if we scroll down let's see if this is enough if you if you don't think it's enough that's that's all right okay so here is the render function right of the element and we are just including list profiles for example it's not exactly the same element but it's another element so this is just a way of saying hey profiles module get me the profile store and all the elements i want and now if i set the profile store context i can include and declare in my html all your elements that assuming that they will work right so this is already a directly usage of this element that comes from the profiles module in this case list profile is going to receive something yes it's going to to receive it's going to to ask for the context right and the context is set in the chessup element by this parent that's clear so the chess app element is the parent and then inside the chess app element you declare the list profiles and the list profiles request the parent and the parent says yes here you have the context yeah i see i see that's great and everything is happening automatically we don't need to do anything that is beautiful so that's it and list profile this component is here or it is in the it is in the this this is a component yeah this is a component from the profiles module profile that's that's the thing yeah that that's that's what i was trying to that is amazing to indicate wow it is a great example how to implement this thank you so if you want to see um actually we can go see okay so this is how you initialize it right oh okay wait i wanted to do like this yes and we can go see here list profiles right on the left here is how you initialize it on the right this is how you consume it i see so here it is the property let me here you are injecting the store from the parent yes exactly yeah why oh it isn't yes and the key here is that this profile profile store context is the same here and here right yes this is the same barrier yes yes yes that is great that's the main idea like that's that's the only piece of uh pattern that you have to learn in order for you to start using this in whatever way that you want and ideally i like this because this becomes really flexible in the sense that imagine if i want to be showing a list of profiles here of this application and a list of profiles here of another application or or another dna another membrane like i want to be comparing groups of people right so i can reuse the same element it's just that i'll be setting different contexts right the place in which the the the the structure of the html document determines uh and encapsulates the uh like all these components go to uh this dna all these components go to this other dna right and that's what a bit what we what we want it means from the root element i can i can specify which dna that you are belonging on or even zone yeah exactly yeah exactly so in that case we can also easily split up if i have a one entry with a similar name so in a two different dna or zone from the root we can make it different exactly so one of the things that happens is okay that's cool and all but what happens if i have two lmi two zones with the same name and actually i want to include them like collisions so um what you would do is say profile store um profiles delta [Music] right and this is the new zone name and now the all all the ui elements actually know what to call i think i see i totally get it but let's do not go get it more okay okay let's let's let's but if anybody would like to go for the complex scenario there is a possibility please come and ask there is a possibility to support the complex scenario but we are not going to talk about it anymore so if there is no question we can continue so that is amazing i'm going to cover the uh the profile is here i already i opened the invitation that's also because we already thought that for the invitation sending invitation do you have a demo running on your client so um i could i could set one up really quickly because because that's it if you remember for the invitation we search for profile and sending invitation that's it i want to remind it again so i can't i'm in an invitation so so i have an invitation and profile as gm mentioned already invitation is using their profile again it is the modularity let's go to invitation the invitation providing just entry definition it is just imputation [Music] so reading the code [Music] initialization [Music] remove signal it is a signaling for another party if he he or she or they are online can receive something yes yeah this is to receive that another person has accepted your invitation okay so we already got talked about the signaling and um a few times but i'm going to open it again because the signaling is interesting part in hologram application sending invitation get my pending invitation accepting mutation rigid invitation and clear invitation so what's happening in the initialization part generally in in greece uh it's creating the capabilities grant for you to be able to for other agents to be able to call receive remote signal on your node like really really um at this point if you want to do remote signal you are going to be able to need to call receive remote signal and to do that you need to commit capability ground in it that's it's really simple that is great we already also discussed about it previously for sending a remote it should be it should be guarded actually the function you are providing otherwise it's going to be public and you are going to be attacked or it should be guarded generally this one at the initialization part making a guard for a function that another agent is going to be called am i right yeah perfect yes that's it i got the meaning of the emit signal yeah it is here so if anybody would like to send a signal between agents you have a really clear example here post send the invitation generally everything is clear if there is any part would you like to add again please let me go here so it means uh let me explain here generally this zone has a one invitation that's it there is no link that's it this is one entry definition inviter invites and time is done what is what what we need for time is time meditation is going to be expired um no we actually needed to differentiate between different limitations okay let's let's say i invite you for a game of chess and we want to say um i accept this invitation hash right so um if i invite you for a game of chess and then you accept that invitation and a week later i invite you again and like your ex like the entry is going to be the same right so then links won't work and things like that it's it's to avoid collisions between exactly right it's it actually doesn't serve exactly yeah that's it to to make one invitation unique you added something that's it can can can do something like guid or something like that or you could yeah you could do it but yeah you could do it okay okay yeah like i i was going to say that the timestamp gives you more information but that's false because you have that in the header so whatever that is true so okay i got that yeah the the thing here that i think it's worth um noting is that we coded this so that it's not only a one-to-one invitation like i'm inviting you to chess but it's a list of invitees so here i could be inviting four people as well [Music] right so okay well i didn't see ui supporting the multi invitation it is the create invitation it is right because you're searching agent and you're putting them you are adding to the left side and then send invitation exactly exactly yes yes so um and for sure the reason that to reduce the load and dht as much as possible well the the reason is to support other scenarios as well like if if you want to support a game of four people or five people you can reuse the invitations zone right if we had done it like only one to one invitations then for for four people invitations for for for people i wouldn't be supported by this zone if i'm making sense so basically we only sent invitations that have one person inside the invite this list [Music] so it is a little bit challengeable what what's happening if i reject what is the result of the reject accept the level of where it is it is saving on dht is there any need to save the result on dht yes there is because this is a synchronous invitation so i could send you an invite and you reply a week later that could be possible so the rule is if anyone rejects the invitation is rejected that's the rule that the what we assumed it means if any of in invitees reject the whole invitation the whole invitation is going to be rejected yeah that's what we are assuming like we have to assume some rule right that's what that's the rule that we are assuming there could be another version or some parameter that would modify its behavior behavior but right now it's like it it's like i see i i'm not gonna ask more here because it is a specific you can easily say okay change it to one and continue totally yes but my question that i see entry definition just invitation but you told me that the result as a result of the reject also it is on dht i don't see any entry definition on dht how you are saving entry without entry definition where is it right so everything that's happening is between so you commit the invitations and then you commit a link from the public key of each of the invitees to that invitation you cr it means reject or accept it is not a specific entry by making a link between a public agent to that invitation you accept no that's a create invitation that's the korean invitation okay yes um to reject you uh delete it uh and i i i if i remember correctly you actually delete the invitation entry because the rule is if anyone rejects then the whole invitation is rejected i see right so any invitee has the capabilities to actually delete the invitation entry sure and that and that means that the whole thing is rejected it so am i right it means by default you create also the link if they want to reject it they delete the link now they tell at the end if i'm not mistaken to delete they delete the entry so let's let's see let's see if i'm right because i did not call this this is manuel because i'm looking for the pattern you know i'm looking yeah yeah yeah the pattern it means deleting or rejecting invitation do not always think about any operation by crowd it means delete or update or something are entry somehow you can create some meaning based on creating a link or editing the tag or delete the tag i just want to understand this part yeah yeah okay so it works like this and if you go to handlers and you want to be following me you can and send invitation it's uh quite clear in the sense that you create invitation entry and you create a link from all the invites to that entry that's it yes here right and you have to invite this list for each agent in dim by this list it's creating a link right so i'm inviting you all i'm creating the entry and i'm sending a link to you to the invitation i just created and i'm also sending a signal why is that because then get my pending invitations is just i get links if you're seeing get my pending invitations is just i get links get links from my public key to all the entries that are still available right i see i see yes and then what's happening in reject invitation in reject invitation what i want to express is that i no longer care about this invitation and this invitation should be rejected for all right so what we do is um we delete the entry and we delete our link yes it is our link to the invitation we delete as well we don't delete the link from all the other invites let's see because they should see actually that the invitation was rejected and then clear invitation i think i think so the the the workflow is a bit like i invite you as us for to play a game you had a yet accept so you are still seeing the invitation eric accepts still singing the imitation lucas rejects lucas doesn't want to see an invitation anymore because he has rejected it he knows that he doesn't want to to be there we want to see that lucas has rejected it so okay lucas rejected okay we can't invite like that invitation won't work so clear invitation i see i'm going to say it is invitation entry yes so and then it's going to be invited inviter so it is the list of the invitee in right t one two three so so let's see what's happening step by step so i'm invited so i'm here i'm creating this one so and then any of them is creating link right now what's happening for the first step okay so send invitation is creating the invitation entry okay yeah and creating a link from each of the invitees and also the inviter to the invitation entry that's it first step but one question is it okay that i create a link for you as an agent to the entry it is a good pattern generally or it is a possible pattern ah like this is the pattern we have chosen for in our case uh if you wanted a bit more security you could do something like um a public capability grant in a sense that okay i'm letting i know hadaya i trust him so hey everyone i'm letting hedayat uh invite me and then that link in its validation with would uh go and see if the if if i have uh let's head yet invite me i think right so you you could you could be a bit more secure that's right yes i got it but that's like we we are not assuming that we are assuming that anyone can invite anyone i see to recap right now it's working that you create invitation entry and make a link on behalf of each of them to this one plus that it is not always a good secure pattern because it is it is because a link between agent key to the entry it is a part of the entity it has a meaning so basically the security is that you should do that because it is a part of your property but there is a way that you can make it more secure so it is the first one second let's continue if because it is the guru if somebody is going just imagine it's going this one and it's going to reject so it means it's going to say i'm going to delete this one it means mark as a deleted yes yes mark is deleted that's really important yes mark has a deleted it means we are not producing a new entry we are adding a new action header as or even mark as a deleted delete oh sorry so for the people that still have a question we don't have a physical delete we have a logical delete mark as a deleted this one is telling mark this entry as a deleted and delete my link am i right yes exactly right others can detect how the others can detect this one as a as a as a as a rejected one how they are query or understand this invitation is rejected right because what they do is i get details on the invitation entry and they've received that it was deleted okay so it means others supposed to query to go for the details if there is a delete action in a detail they are assumed it's marked as a deleter also they can consequently delete it as a rejected yes wait go back a bit so at this point what they should see because remember get my pending invitations uh returns the get links yes right so at this point uh dimbaiti who rejected isn't seeing anymore invitation in the invitation lists okay which is what we want right if someone has rejected like it should disappear from their invitation list but the other ones should see it i think what happened with imitation what happened what happened so if if you go back to the drawing the drawing was really good go go go go go you have the content okay yeah yeah sorry here here okay perfect thanks let me also let me make it bigger wait wait wait wait wait please shh wait wait let me let me let wait wait do not move do not move do not move here also so please show the process anyway maybe one moment moment yeah okay it is the process and it is the code so perfect so um we have shown the reject invitation right and reject invitation does what you see here delete link yes right so delete delete my own link delete my link to the invitation and delete the entry yes right um this one is still going to see the invitation in the invitation list right but what they are going to see is that it is deleted so they will see the invitation and who rejected it okay can you show me the query because we need to i would like to say to see how we can call and get detailed and to write exactly yes exactly so you see uh get like you get your own agent public key so from this entry you do a get links right so all the entry hashes to which your agent public is linked and then you do get invitations entry info which is like a sub function which is again details i see yes yes that is beautiful it is the thing i wanted to see yes thank you yeah and here actually we are aggregating a bit information right so we are actually saying uh we are actually um aggregating knowing from just if i remember correctly let me see one moment right exactly we are aggregating the ones who accepted it and the ones who rejected it okay got the point right and then we are returning all the information to the front them i got all right right and then when this one here sees that it's being rejected and since that it's been rejected by this one because this delete has the agent public key so we can uh do that then they can choose to not care about the invitation anymore because it was rejected i think so clear invitation is doing this not oh i'm this right you delete the your link from you to the invitation entry so now get my pending invitations doesn't return anymore yes you don't care about invitation anymore i see i have an architect question here so if from the query i can understand that it is deleted to reduce the pressure on a dht and propagating more data it is better to do more action and each person can delete also the links or so uh or it is better to put something and query that one what is the what is the best recommendation what what right if i'm understanding the question correctly it's something like hey this is a bit convoluted and we could create a new entry which is entry acceptance or entry rejection or something like that and link to that i see right if if i understanding the question correctly yes the the clear question that as much as possible instead of playing deleting marking so any operation that can put a more load on dht more operation on phd what is the best architect that we can do something that to to have a more meaning instead of more data operation right right and yeah yeah yeah okay so this is a a very important pattern i think when you're starting to know more a bit more about volunteering and the way it works and the the thing is that an update or a delete or a delete link or things like that in holochain don't have inherent meaning across applications in the sense that in here we are using delete the invitation entry to mean rejected invitation right in another application i can use the deletion of an entry to mean that nobody should look at it anymore like we we can't even view this right because of the way that you query things yes um for example if i'm doing something like git the update of the of the entry is going to to be a new version of the document and you can go back but if i'm doing a chain of custody and i'm updating who has the nft then that's that's a totally different meaning right it's not like it's a new version of the thing it's that it's it's it's it's a new chain in the link yes right so the low-level primitives of holochain that are available like create entry create link delete link delete and update you can use to put your own meaning on top of them and in this case we are trying to opt to optimize to reduce the load of the dht and in this sense with just the entry uh invitation entry and the links and deletes attached to them we can reconstruct the whole meaning that everyone wanted to save so we we don't have to create a new entry and link to that and that's new links new entries new headers that's a whole bunch of uh more load into this in the vhd yes fantastic i think one day we are supposed to create something crosstable or to do something that developer can easily compare when to use what which is better it means reduce the load or a query on a dht or i hope one day we can reach that part so yeah i think we are have been talking forever if there is no question what do you think that we can go for the another part because there are a lot of content that i'm worried it's going to be headache yeah sure um i'm particularly interested and excited about the turn-based game engine that's a bit buried in in the repository but it's where most of the action happens actually and and the way that we did it uh it's um i like it a lot in and in the way in which the validation is working um like i'm quite happy with this so in yeah in the next part we can review all of that from the things i'm thinking we already we already have the ui part the whole topic as chaperone how to host the ui in a holoport we need to go into the detail to to open the layers it is the important one we already didn't discuss about the chest zone and your tan actually turned i think both of them can be the next part as a one is standalone yes yep yep uh like if and like maybe we have to do a third part let's see oh oh okay let's see but no no because because the turn-based engine it's like it's more big it's bigger than the invitations and profiles combined like it it it has a lot of yeah i see do you think we can is there any question is there any no no question just i'm delighted to to watch this and see the detail and the depth in which you're you are both explaining and showing it and it's i've also been using the the profiles um stone in an app that i've been building and so this is all it's all working really great and using the context pattern that you started talking about so i'm excited about it so mostly just props no questions thank you so basically i think it is better to just to to is there anything else would you like to mention kim otherwise let's go for the really quick review and overview and just finish the recording and continue no i think we are we are fine in the maybe it would be interesting in the next part to show how to create invitations element requires the search agent element but for that that can be an expert that is great that's it i think for the next one we can list this topic we already explained anything that the basic architecture how the things are supposed to be connected fundamentally the team for this part and then so far we are here in the invitation in the next part we are going to start a little bit the end part of the invitation if there is something is remain but generally we discussed and then we need to go to the chest and then you they tell chance that it seems quite important and really nice so and review the zone the ui if there is something and then go to the hosting to holocaust if we can cover everything so that's it otherwise we need to go to the temple so we are going to finish the recording if there is something anybody would like to mention please otherwise i would say bye bye that's it this is really fun yes bye
Info
Channel: Holochain in Action
Views: 853
Rating: 5 out of 5
Keywords: holochain, holoport, tutorial, holochain programming, pair programming, rust, peer to peer, happ, hApp, chess, elemental chess, modularity, profile zome, invitation zome
Id: E2ISltVei38
Channel Id: undefined
Length: 71min 53sec (4313 seconds)
Published: Wed Sep 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.