Dev & Tell | Nena Djaja - Scaling Subgraph Collaboration

web3con 2022 · 4 Mar 2022 · 27:14

Nena Djaja of Edge & Node, the team behind The Graph, shows how subgraphs are now minted as NFTs so ownership can be transferred, for example to a DAO or multisig. A recorded walkthrough in Subgraph Studio covers transferring ownership, confirming the new owner in Explorer and OpenSea, and refreshing metadata. The Q&A touches on getting started as a developer, indexer, curator or delegator, upcoming mutation support, generating schemas from ABIs, and grants. Presented as a web3con special edition of Dev & Tell.

Speakers

Topics

From web3con 2022, hosted by Developer DAO.

Transcript

we're on gm gag everybody uh welcome to a special edition uh devontel web3con style uh so if you did not know uh devontel is a developer dow initiative where it's a 30 minute window for members of the dow to show showcase something they are passionate about or been working on this can be an awesome project to be working on demonstrating unit tests best practices automation goodies smart contracts how to structure project etc basically if you got a passion for something this is your opportunity to share it with the community and this week in the spirit of web 3 con we have nina from edunode and the graph here to show us a really cool new feature they've just released so nina uh handing

enough to you hi everybody nice to be here um let me just do a quick intro about me so i've been the product engineering leader at the node but i've been with the graph for almost four years since we were a really little startup and i was a developer myself for many years and then last year i built a team and i have an amazing team who i like to give a lot of credit for all these features they were building and so i became product engineering lead um and so the you guys might be familiar with subgraphs but i just wanted to kind of give a little bit of intro before i jump into the feature um so subgraphs essentially are these projects that developers build and they represent open

apis that enable users to query data from different blockchains um and so developers would define a graphql schema and soundcraftmanifest and a bunch of other things and then they could deploy them to our decentralized network and i'm just going to start screen sharing for um because i feel visuals oftentimes speak better than words um and so here are sub graphs on the the centralized network there's plenty of them and um if you want to i guess there's i think a lot of open source subgraph code out there to kind of get started and we also have a coi command that kind of creates an initial um like a scaffold of a subgraph to get started

um so every sub graph um let's click on one um essentially has an owner and that's the ethereum address okay like that we show right here and so what we have is that as a gns contract then um we were called to publish a subgraph and um since um it was just an erc20 contract it wasn't in the past you wouldn't be able to transfer this fabric it would belong to the person who um created developed and deployed and published this subgraph so what we did essentially the smart contracts theme we could collaborate with um we create an nfd contract so now every time a person creates a subgroup and nft

is minted and and i'll show you our collection and that subgraph can easily be transferred to a dow to a multisig so it can enable further collaboration um on it and i think it's a pretty cool thing and here you can um see our collection on openc and these are all the subgroups that are were on the network that we migrated over once we launch this feature and so i can um i can show you i actually recorded a video just um because you never know how live demo is gonna go um do you guys see my um because it turned into a full screen do you see the video screen uh yes yeah okay perfect

um right so this is my sub graph um and i guess i didn't mention so i what i showed is explorer which are the top graphs kind of more of a browsing experience but in subgroup studio which is another product we develop is um you create sub graphs and deploy them easily let me kind of walk you through and this is the one it's published to maine and um and it's version one and i'll play the video but i'm just gonna pause to explain a couple of things because it goes really fast and here in these three dots you can just click on transfer ownership um select the address um we validate it it's a valid address transfer thankfully gas was low when i was recording this um and we just put a note here that transferring subgraph is irreversible

make sure you know what you're doing we have a little bit of a dox um although when i was looking at this i was also thinking if you transfer a subgroup to your friend for example and they want to transfer back to you that is doable but in general um okay so cool so what's happening here the transaction was successful and we bring you back to so with this particular test account i have no other subgraphs so now it doesn't belong to me anymore and i can't see it on this screen um but i'm going to actually log out and log in with my other metamask account because i'm just transferring to myself here um and so then now on my other account i can actually see it and now i'm that other account is the new owner of it so there is the little

subgraph um so let me get out of this screen and just show a couple of other things so here i am logged into or not okay sorry this is in explorer in studio let me i'm logged in with that account and i can now see the subgraph that's transferred to me and here in explorer we can see the new owner here um and just once and also okay also on openc i can see the same subgraph owned by me now and i just want to mention here people might know but you can also transfer it on openc the same thing just paste the address and trends right here one quick thing i just want to mention

because it kind of happened to me is then um and i left this kind of on purpose i changed some metadata because it should have been more original here but anyways i put um and when you update the details here it's another contract transactions it doesn't um automatically update on openc so you actually need to even if it's like a few days after so actually we need to click here refresh and then refresh it here to kind of see your new updated metadata um so yeah this is kind of the main part of my demo but um i think this is pretty cool because i feel like people can collaborate easier it's easier it would be easier to maintain a sub graph and

then let's say somebody leaves a doll they can transfer to um another address and then um subgroups their own payday address can the transfer could be part of proposals um and things like that so let me stop sharing and i'll be happy to answer any questions this was great nina thank you so much uh i guess one question for me is um what was the inspiration to kind of get this feature out there like what drove um the graph as you know to kind of get this out there user feedback a lot of users requesting and we will listen to our users or at least try our best and there is a there's a

forum.graph.com and i think that's where people kind of started posting and wanting to um us to build this um so yeah that was the that was kind of what all kicked it all off awesome awesome gang does anybody have any questions for nina what's the easiest way to get started in the sort of the graph ecosystem like i know that you can build sub graphs but there's a couple of other different levels of activity that you could do what as a i guess from my perspective as a builder what's like the easiest way to get involved in the graph ecosystem well that's a great question um

so there's different roles that you can get involved as a developer you can definitely get involved as a subgroup developer you could also get involved as an indexer and we have a lot of support for indexers um i think you also you might um notice of discord when you can join the index or channel so it depends what you want so as a subgraph developer we have a lot of documentation if you let's say um look around um our docs and like learn a little bit about different roles and figure out let's say you want to build a soft graph so let me kind of guide you through what i was showing a little bit like you go through sound curve studio and um we create this kind of initial scaffold and um maybe you could look up um and then you decide which contracts

do you want the subcribe to index and also join the channel to get community help um there's also graph academy that provides a lot of good videos and tutorials on how to do things um and other than developers and indexers that are more kind of very technical role you could get involved as a curator um when you would curate sub graphs that you wanted them to be indexed and you could also get involved as a delegator when you essentially lend your grt to indexers nice like three of those roles are like supply side right and then what and then you have like users that pay gtc to use what people are indexing and providing the network

right sorry i didn't hear the last can you can you see a little more detail those the indexers sorry badly worded question um the there's like four kind of groups of roles right for the graph like three of them are like supply side that like make the network work and then you we can also utilize the right word by querying it right right you can utilize exactly dab developer mention that yeah you can you can utilize the network develop develop the apps use different subgraphs um and things like that for sure you can also get involved i mean there's many ways you give grants the graph foundation just gives grants to people to improve our ecosystem um there's also advocacy program

that we have that you can get involved we just recently launched in um so yeah there are several ways but um yeah please build more dabs for tools that we need out there yeah yeah for sure i have a question about the graph i have actually two questions i'll start with the first one the first one is uh when are you guys planning on supporting uh mutations i saw there's like a couple like references of it and like it just seems like a super interesting use case that uh yes i want that question and i yeah care about that question too uh it was like my internal question as

well um but uh we have car that court empties now that are onboarding um and that are working on that feature i can't tell you what exactly it goes like but it will come it will be soonish um i'm um i know that it's been kind of in the works got it perfect and then for my second question um so one of the things i was curious about like i'm building uh a subgraph right now for our app and hackathon uh one of the questions i have is is there a way like is it like i see there's like some generate code generation i was wondering like for the graphql schema you have you have to essentially type

that out yourself and you map it yourself do you know of any tools that like handle that mapping like itself that's a good question hold on i just recently saw some um where was it generated schema you mean to um define from the mapping to define your schema exactly yeah so from from the ab like from the abi mapping like because you're already having the types there and a lot of times you don't really need to do any custom mapping at that point i was wondering if there was like a code generation at that level you know what i mean very good yeah very good question you know what why don't you ask um i'm not 100 sure but i know i saw something that had like that looked like it had

like generated automatically generated schema rather than like handwritten um why don't you ask in the so in the graph community there's like subgraph developers channel and people are pretty responsive so what i would do is just there cool thank you sure great questions here gang uh any others i've got another it's about the grant programmer that's okay are there any like specific things that you're looking to fund at the moment or is it kind of more open and anything that sort of fits into the grass ecosystem i'd say it's more open it's things that

fit in the graph ecosystem um having said that i'm not sure if it just if we fund particular you know what there's actually um when you go to a blog there's a couple of blog posts with the projects that we just fund in i think there is two or three and then you can see a list of projects and type of projects that we fund um because i don't want to speak i don't know exactly how the foundation filters people but i would say we're pretty open but i would still look into that um before applying to see if you fit into that awesome thanks sure a follow-up to that question actually that was a good question i was wondering it'd be kind of like this is more uh feedback it'd be cool to see like you know like how the y combination y

combinator has like a request for startups for grants because i'd be like to like help people get started in this ecosystem because it's a super interesting ecosystem yes that that is um that is a good idea do you mean to build something that people can just go there and um um yeah so like more like a blog what like a post about like like what they're looking for and like what the what the foundation is looking for on like more like a request for startup there's like a really good example yeah that's a good thing um i'm actually gonna let me ask eva and then i can post it in in the in the channel one of the channels just tell me which one um because it might be

cool thank you i guess uh question for me um so regarding costs to query uh subgraphs is it um are those costs set by the uh indexers or and uh on average what do you see as like the average transaction cost per query that's a very complicated question it depends it depends on the complexity of the query yeah indexers are setting um how much of the query fees are depending on the parameters that um query fee cut they're

setting how much all the queries will belong to them versus the curators and other things um but i can also point you to um blog posts that explain that in a little bit of detail i'll share let me put a note i'll share that as well it's not a simple answer and i don't know myself like all the details how the home mechanism works yeah um but um yeah that's a that's a good question we were actually just kind of have something in works when we can set let people decide whether they want to maximize the low price or the efficiency of the query and and like different things like that and set different parameters because it all kind of plays a role gotcha got you

and i guess from a consumption standpoint uh is your is um querying a subgraph um like is there like a caching mechanism on your end so that um the the transactions or the queries are returned in a quick manner and like as a developer should um should we be caching these responses on iron since the event logs that are emitted are kind of they are what they are until they get updated so is there any guidance there on um how often we should be refreshing our data if we are caching here that's an interesting question i'm

not sure if there is something caching at the moment on the subgroup side um on the front end applications that we build we we do some caching on the front end yeah um we in particular we use a apollo and a polar cache right yeah um but yeah i'm not 100 sure if it um it's implemented um from the other side cool cool yeah it basically in my mind is whether or not uh i if i'm querying the sub graph if i should be hitting up a network call for every call or if i if i can uh save on some uh network calls by caching but yeah something to explore for sure yeah definitely you could also ask that in the subgroup channel on the

developer's channel on the chat for sure yeah but on the front inside like i said in the front we do we do use the cash sweet makes sense we have about uh 11 minutes left here again uh are there any last questions or questions for for nina question frankina uh this is more like career related so you notice that your title says project engineeringly so i was wondering if you touch upon like how you know you found yourself in that role and the types of like engineers that you would want to work with and would succeed in a role like yours um

yes good question how i found myself in that role or any role i feel like i stumbled upon it because i just we were an early stage startup and i essentially did all the things um and um so i and and so i did kind of a bunch of what lead do is kind of do crossed independences collaborative features make sure it gets out and things like that and then once i started hiring um more developers it made sense to me to i just stopped having time to code um and i wanted to build my team and empower them and encourage them and give them everything they need to perform at their best essentially and so i um just kind of naturally transition into a lead

position and i'm still learning and improving uh but what i'm looking for people is people who are resourceful kind of um because we are all working different time zones and so then you um you know we don't overlap at all times so what um would take for our team and i have really a great team i love my team is um everybody comes up with ideas shares them tries to implement tries to improve things everybody's really passionate about what we are building and i just give them a lot of freedom and needed resources to succeed awesome things um and then i guess another question

would be like what are some interesting like differences you notice in terms of like uh you know looking at user feedback or sourcing that from like the web 3 space versus your pi experiences at other web 2 companies okay sorry what was the first part of the question it was kind of um there was a background noise what are you uh i guess it was just more of like any interesting differences you notice when um you know gathering user feedback in what three space versus at your prior experiences at two companies right yes i've spent the many years of web two companies prior to um kind of jumping into web three um

yeah we um it's very chatty in web 3. um we we have a lot of 10 like i said on discord even early on we're just trying to build things and keeping our chats and we were all kind of um trying to see what people need and what um users want us to build and we really listen to that feedback so i guess the main difference is that their people are very freely giving feedback and have access to us in web 3 um which is great and it's great for them for us like we keep ourselves busy all the time um i love that we talk to users and i love that um there are different opportunities to share the feedback and we actually do implement it maybe not right away but

but we talk about it and we kind of let our users help us with um what are we going to build and how to improve it yeah the spirit of collaboration seems so much stronger in the workthrough say yeah totally thank you i guess on the topic of feedback uh what's the best way for folks to to give you that feedback just hop in your discord or yeah i would say hop in a discord um you could post in the forum and then kind of create more of a conversation when other people can comment like people post different proposals there um there is also depending on what feedback is on i know we have open source repos and github people create

issues um so kind of like maybe a combination of those let's say you post a forum post and then like share it on discord to get other people's take on that um and um yeah those are i think the best ones sometimes people also send an email to i don't even know which address um i think it's somewhere um sorry i can't i can't help there but i know i do receive it gets forwarded to me um if it's like a product feedback um but we do monitor this card excellent excellent and you know i thought i would just mention that um as part of your sponsorship the job board's now live so the edge of no jobs that were sent through to us are live on that job board

or on edge and node's own website if you if you want to go check them out rocket emojis so we draw post is it a specific job posting it's the ones you have on your website we've replicated onto our job board and then we've shared them with all the conference attendees and i've just put it in the text chat if anyone wants to go have a look okay cool yes yes the jobs we have the jobs we had on our sites are still active we are actively hiring and looking for passionate people i did have one question what feedback specifically like what keywords or um

ideas from the comments generated the the need in your eyes or your vision to make the product to make in general our two products yes um let me think there was a way in the past when we were thinking about having something like this because we like evolved over time so originally we launched explorer well originally we launched hosted service um which is was um kind of like a kind of one indexer to try to do proof of concept of for the decentralized network and then as subgraphs kind of became more um

more and more important and we were trying to figure out how to make it easier for subgraph developers to develop subgraphs and get started we kind of noticed the need and and honestly sorry i can't remember exactly like there must have been also somewhere in chats because like a long time ago we were brainstorming until it actually came to life we noticed the need to have some sort of like a playground um like a developer playground essentially um you can um to have something where you don't need to put your subgraph on chain and pay the fees right away um so in studio we do use the database you flow your subgraphs you see what they look like you try to query them in the playground see if that's what you intended to do you can also deploy multiple versions without um having to kind of directly publish them all on

chain and then like when you're happy you publish on chain so we kind of envision some sort of a tool like that for a while um and ever since we launched it we keep actually getting a lot of feedback and we've been building more features like we had in multisig which we didn't kind of support at the beginning um then we um also another use case for studio was we noticed that we need to you need to manage your api keys somewhere so we added that onto studio and then there's also billing um that we will improve um that we use polygon bridge uh so kind of made sense for all those features to live in studio because they're relating um so i don't know if that even answers your questions but it was like the evolution of things yeah yeah

definitely get that all right uh we're almost at the top of the hour uh are there any final questions going once going twice all right i guess not well uh thank you again very much uh you know we really appreciate you coming on and and uh having this talk with us it was very uh insightful and and i'm sure a lot of folks here are uh knees deep uh hacking away with the graph and sub graphs and uh this was a fantastic insight into some

the overall graph ecosystem and and and the new uh nft uh feature um and uh special shout out to uh eva i think she's in here for uh helping uh connect both of us more or less to to make this happen yes thank you for sending me everything i need to make it easy for me to join so uh with that uh i will say uh to all our uh uh audience here uh make sure to visit the graph uh channel in the sponsors uh category and ask any uh sub graph and graph questions you have as we're almost uh almost nearing the deadline for hackathon submissions so if you have any um outstanding queries or

whatnot please make sure to engage with the graph community here and uh for uh all attendees as well as um uh you nina uh there is a special pull up web 3 con devontelpo app that i will post in the hackathon voice text so for the audience and then nina i will uh give yours through a dm so awesome well thank you so much for having me this was really nice and um yeah please join our discord and ask your questions there um and um we'll answer them thank you awesome all right again all the best and see you at web3 con all right