# Ceramic 🛠 ComposeDB Data Composites - Matthew Davis

- Channel: [ETHGlobal](https://streameth.org/ethglobal)
- Date: 2022-10-09
- Duration: 15:26
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-mCl1ao_17z0
- YouTube: https://www.youtube.com/watch?v=mCl1ao_17z0

## Description

Welcome Matthew Davis from Ceramic for a workshop titled "ComposeDB Data Composites". Learn how to discover, create and manage data composites with the new release of Ceramic's ComposeDB!

ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark.

---------------------------------------------------
Follow us: https://twitter.com/ETHGlobal​
Check us out: https://ethglobal.co​m
Email us at: hello@ethglobal.com

#ethereum #web3 #blockchain #eth

## Transcript

[Applause] [Music] hey youth online hackers i hope the hackathon is going well for you so far my name is matthew i'm a developer advocate over at the ceramic network we work on like composable decentralized web3 data you've probably heard of us if you've used popular projects like orbis or you've done stuff with like bitcoin passport or you've attended hackathons in the past you've probably heard of us and or implemented us into a project at some point in time i'm really excited to bring this workshop to you for this hackathon specifically we are on the verge of rolling out a developer preview for a bunch of major changes to how ceramic works inside of your web 3 projects one of the changes that we're getting is the often sought after indexing capabilities of our database so what i want to do is spend some time with you jumping through this new tooling and hopefully help prime you for the bounty that we have at the end um stay tuned we'll talk more about the bounty later but the reality is is we have 5 000 worth of prizes up for grabs and not only are we offering that cash reward for best submission of this bounty submissions that seem like viable proof of concept projects um we're going to do all we can to incubate those projects with you and for you to help you bring them to maturity so we're gonna pick probably the top three to four projects that submit a submission to the bounty and we're gonna fold you in to our ecosystem and do what we can to try to to get your project brought up to a more complete phase so there's a lot at stake and because of that i think it's really important to spend a little bit of time with you to show you how to get up and running with the new tooling and maybe throw an example or two your way so meet me over in a text editor we'll get started wait a minute this isn't a terminal or a text editor or whatever tool i said we were going to meet in you're right um and that's because couple prerequisites right if you're new uh this is useful to you if you've been using ceramic you probably already have all this set up but first and foremost hey we're going to be using node.js right so make sure you have version 16 installed it can be 16 dot whatever okay but major version 16 of node.js needs to be installed you're going to have the best experience if you do so if you're running a different version or node you're probably going to run into problems second thing you're going to need right even though node comes packaged with or comes with npm as a package manager we really suggest you guys go and get set up with pnpm okay this is what we use internally to manage all of our packages uh for the compose db code base so you're gonna have the easiest time and the most uh most comparable time to hours if you're using pmpm as your package manager so that's like the biggest amount of like prerequisite setup that that we have going on so now i'll meet you over in my text editor one of the absolute major changes taking place is a switch to graphql so in order to create a new model or com basically a piece of a composite we need to use graphql so we're going to create a file called source schema dot graphql you could name this whatever you want as long as it's dot graphql and in that file we're gonna paste uh some text and i'm gonna walk you through it really briefly it's not a real it's not really a crash course on graphql but here's a comment tells us exactly what's going to go on and it is a type the type is post and it's going to use this create model and it's going to basically create a new schema for us with uh text text is the only field that this model has so we can put text in and that value is a string and it's capped at length so if we say hey get me a post there should be post.text somewhere as a value okay so we're going to save this and come back into our command line and now we are going to create a model or a composite rather out of this graphql to do that we're going to come in here we're going to type compose db composite create source schema graphql like that's the file that we just created and then we're going to tell it to output that to my composite dot json because what we want to do is we want to convert this graphql into the same json schema that we have up here for the one that we retrieved with the model id that we already knew so we're going to do the same and then by default it's going to look at our local ceramic node and we're going to go ahead and do that and this is where things could get tricky i have already generated that private key remember it's right here i have already saved that as an environment variable in this terminal session but it might still break so let's see you'll see here it says no controller specified it did break that's okay we can run the same command and this time we're going to say did private key is equal to our private key which is up here okay we hit enter and there we go it used rdid and it created the composite and it saved it into mycomposite.json so if we come up here and we look we have that and if we look right here after this models key this is the model id that exists for that so earlier when we fetched it from the network we used a known model id well now we have another known model id so if you wanted to pass this to a friend or another project they could then fetch this model id and be able to create composites from it that's where that came from initially okay so we're gonna go ahead and close all that out we don't really need to see it anymore the next step is where we're gonna actually create our first composite and this is one of the major leaps that we're making with ceramic is we've talked about composable data along the way and we've had data models and you could query this data model and that data model and put them together to create a unified model for your application to use but you needed to go grab a bunch of different ones and in this case you do kind of need to grab a bunch of different ones initially but what we're going to do is we're going to merge them into one giant data composite that then we hand to our application and it knows everything it needs to know in order to make your application do the things you want it to do to do this we are going to do compose db composite merge right pretty pretty simple we're going to merge the mycomposite.json in the myfirstcomposite.json and we're going to set an output and that's going to be merged.js okay so we're just giving it a name we hit enter and now we have our third and final model which is merge.json and it represents both of the individual models that we had so now we have finally what we're calling a composite right and here's a model id here and up here is another model id okay so these are all different and they define how our data now looks feels and works all right the last thing is like before is to deploy that out so we can say compose db composite deploy and then we think we called it merge.json and if we do that bam we see now that each model here is stored into the the list that we need to add to our ceramic nodes configuration right and then it will be able to index these models that's our new way to combine different pieces of composable data into one large data composite that you can then pass to your application all right so now that we've talked about compose db and how to get up and running with new data composites i want to take a few seconds here to just kind of discuss the bounty or the prizes that we have available for eath online during this hackathon as i mentioned earlier we're we have 5 000 usdc up for grabs in prize money for this month-long hackathon we have going on i just want to make sure that i take some time to be clear with you guys about what we're looking for so the first place prize right for 3000 usdc is for the most innovative application that enhances the discoverability of a data composite earlier i showed you how to use the new compose db cli to do discovery but that's not always the most search friendly or user friendly so we would love to see whatever type of application or tooling you guys come up with that makes discovery discoverability uh a lot more user friendly and developer friendly the second thing we have is is best integration using compose db as a database layer uh now keep in mind with this one we don't recommend using compose db is in production at the moment right there's a lot of iterations that need to happen for uncomposed db before we're comfortable saying that this should be a production ready uh part of your tool stack okay but um if you want to build a proof of concept or you want to work on a hackathon project then this could be a good opportunity to include the compose db as your database layer the last piece is best use of compose db with another sponsor just like many eth global events ethonline has a ton of sponsors and from major projects in web 3 space right and there's a lot of opportunity for you to find a way to integrate the compose db from ceramic as like the database side of things while using something like lit protocol for encryption or some other verified credential system maybe get coin passport i don't know who's sponsoring exactly i didn't look all that into it however there are tons of sponsors out there and if you can find a way to integrate with those sponsors then we're offering 500 usdc for any project that successfully does that the last piece that i think is super important is to talk about the submission requirements here so first and foremost we're going to require a working demo and a video submission um in the past we've had submissions where it's it's just like a figma mock or something like that and and we want to see a working demo this is a month long hackathon so working prototypes are really what we're after here all your code it should be publicly available even though it's going to live in your repo it's going to be your code we're not interested in taking your code in any way shape or form but we are going to need to be able to view your code so that we can look through it you'll notice that judging criteria includes code quality so being able to have access to the code is helpful for us when it comes to doing proper judging on your project and your submission the last piece of submission is one of the things that we're most concerned with um that along with the working demo right this third piece is a small write-up providing developer feedback of the new cosmos db package ecosystem that means tooling that means the other dev packages that we didn't cover that are that are shipping as a part of cosmos db that means were the docks sufficient so everything from your experience we would love feedback on and it is a requirement for your project to be considered uh for the prize payout now that being said we're not looking for praise we don't want you to sit there and just tell us how great everything is we're rather looking for the pain points that you experience as you go through using compose db so what did you struggle with what wasn't written well what needs more more guidance these are the types of things that that we're interested in did you run into any bugs that's the type of stuff we're looking for in your feedback right up you don't have to write a book we're not expecting you to write a 20 page document but supplying some feedback along with your submission is mission critical for prizes the last thing here is we have some new uh some new links some new documentation for compose db kind of exists right here and almost all things should be directed to the forum i know you guys have a discord channel here for eth online that is going to give you direct access to me i'm more than happy to talk to you about what's going on with ceramic but for your technical questions how do i implement this i'm running into this bug i can't get started things like that the forum is the best place to go ask that question one it helps the entire community if you contribute your question to that forum and two you get access to our entire team rather than just me i'm the one hanging out in discord but our whole team is on the forum ready excited and willing to answer as many of the questions as you have so please try to direct those over to the forum i think that's the best place for your questions lastly have fun this is a month-long hackathon and we are so stoked to see what you build don't hesitate to reach out to us ask us questions we'd love to work with you and honestly even though there are only 5 000 usdc up for grabs is prize money what we are going to do is if there's a project that comes in that maybe doesn't win the prize money but shows promise has hope we're going to do all we can to work with you to take that from a hackathon project into a proof of concept and maybe even become a flagship project on compose db depends on uh your team what you build and how we get there right so the goal here i don't want it to just be about prize money let's think about how we build a better ecosystem together in web3 so have fun and we hope to talk to you soon
