Filecoin 🛠Making Storage Deals on Filecoin EVM - Zak Ayes
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Zak Ayesh from Protocol Labs for a talk titled "Making Storage Deals on Filecoin EVM". As new users flock to web3, critical infrastructure advancements are needed to scale. Scaling Ethereum is your chance to shape the future of Ethereum. Join us March 10th-29th for three weeks of hacking and summits featuring teams like Gnosis Chain, Scroll, Hyperlane, UMA, IPFS/Filecoin, and more. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Applause] [Music] hello and welcome everyone to the filecoin workshop making storage deals on filecoin evm joining us today is Zach aish who will be taking us through this session and with that I will pass over to Zach to introduce himself and get the session started hey everyone Hi yep my name is Zach ayish I want to see me around on a couple of uh other follow coin coding demos um I'm a developer Advocate with the follow coin virtual machine team at protocol labs and today I'm going to go over uh programming on the fevm and you know you might have seen this talk from me before at previously Global events but on this talk we're going to do something a little bit new we're going to go over uh towards the end how to make storage deals uh with smart contracts on the follow coin virtual machine so this is a really cool new functionality we've been working on for a long time the engineers have been hard at work and so I'm excited to go through this this demo with you today yeah so uh quick Story one of my very first projects uh interacting with any of the file coin ipfs uh protocols was creating a dynamic nft and essentially it was like this nerdy shooting juriscat reference where you would mint an nft box and uh it would use the chain link vrf and randomly pick uh when you minted the cat to either be this attack cat or a sleeping cat right and this was probably two years ago or so now and little did I know I would be working uh this closely with the file coins stack and helping push things forward so today we're actually going to be using this photo uh to store on the with Falcon storage providers uh using solidity smart contracts um you can find this is the actual uh photo of me trying to get this demo working we actually uh first got this demo working for East Denver and I presented at the file coin hacker base it was uh quite the experience uh working with Engineers uh late into the night they put such a phenomenal amount of effort into getting this working and so yeah it was it was it was quite the Herculean task but I'm happy to be a little bit more well rested and presenting to you today and if you've seen any of my other presentations you know I like to talk about um imposter syndrome and a lot of my uh talks and I just want to briefly mention that here like this is this is like me working with the engineers trying to figure out how all of this works uh I'm so figuring all this out too uh so like don't feel bad if any of this is confusing to you or um feels overwhelming it is for everybody um I just like to put that in in all of my talks all right so today we're going to be going through um just a short introduction on the final coin virtual machine I want to focus more on the coding side of things we'll do a demo and remix deploying a very basic uh like solidity contract doesn't use anything special file coin related in it uh then will you will show an example using the file coin uh solidity libraries that gives you follicle and specific functionalities and then we'll move on to hard hat and making a deal on a storage deal on using smart contracts which is kind of uh the special thing we're demoing in this talk right so what is the file called virtual machine it is a virtual machine that lives on the file coin blockchain right and it delivers on-chain programmability to the file coin Network for the first time so the filecoin virtual machine is actually made in webassembly um but it was built to support multiple runtimes right so um you might have you'll hear me talking about the F evm right and uh that isn't running on ethereum or anything like that that is running on file and how it works is at the base layer you have the filecoin virtual machine uh like running on top of file coin nodes written in webassembly and that was designed specifically to be able to virtualize other runtimes on top of it right so the first one time the team targeted was the ethereum virtual machine because uh everyone knows how to work with Lydia at this point in web 3 at least you know it's the most common um language to use there's tons of tooling You Know Remix hard hat metamask everything supports it so the ethereum virtual machine is actually virtualized on top of the fvm and this ethereum virtual machine when you're interacting with it um interact acts like any other evm chain you may be used to whether it's uh ethereum or or polygon or Avalanche or or what have you um and so to you it shouldn't look any different and you should be able to use all all of your tools in the future this could be extended to other run times if they are developed and um there is a road map for the team to develop what we call native actors or the ability to compile smart contracts to wasm and deploy those directly to the chain as well if uh you know you like to program it any language that compiles tawasm webassembly which is a lot so yeah this is the new thing this is the big New Deal uh is creating a contract uh creating a storage Shield via Smart contracts this is a relatively new development even on the scdm um and we'll kind of go over how it works essentially um you know we'll be emitting a event a solidity event that boosts storage providers can listen to and uh store your store your data for you but you know this is the FIP uh follicle and Improvement protocol you can find it uh in the file coin GitHub if you want to read up more uh on a little lower detail on how it works all right so let's go ahead and let's just dive into the coding well again we're going to start with a remix and we're going to deploy a very basic contract called Simple coin you can give it as a simplified erc20 contract uh very basic um and yeah this is just going to show off you know the evm compatibility so let's start out uh first of course you're going to need to download metamask you can get this at metamask.io it is one of the most popular uh ethereum wallets you can get um you know I use it as a hot wallet for testing development um yeah so you can you can download it on metamask.io and you see I already have it downloaded right here right and once you have metamask it doesn't know about the file coin chain it has some default chains it knows about you know ethereum and his test sets but it doesn't default know about the file coin chain and so we're actually going to point it to uh hyperspace which is uh the file coin test net uh similar to sepolio or gorley before it you know became a whole for-profit thing um on ethereum right so to add uh hyperspace to metamask we can just go to chainless.org click include test Nets this out of the way and just type in file coin and you'll see here like all of the different file coin test Nets uh mainnet as well we're gonna click on add to nms for hyperspace so it's also will be using for the remainder of this demo uh mainnet for fevm support comes out on March 14th so um no evm yet but very close on mainnet so yeah you just click add to metamask you know um the Baba will come up for metamask I already have it added right here but yeah that'll add hyperspace to your meta mask and finally you're going to need to get some test net fill just like ethereum and any other almost any other blockchain you work with you need to have currency to interact with that chain you know to prevent spam prevention and to pay the note operators um for running all this computation right but on a test net uh you can just get this from a faucet right because tests have no value um most tests National I have to add so we'll click on hyperspace dot yoga right and this is the faucet you can use now file coin has its own address screen address address scheme which you'll see as like key addresses so like T4 yada yada yada or T1 yada yada but everything is actually uh compatible with ethereum addresses right so if I just copy my account address and I paste it in there just the ethereum address we get to go through this awesome captcha which is always a fun challenge to do live now click on the bunnies next running buddy usually have to go through two screens all right cool and click Send and uh test that faucet uh test that fill from the faucet is on the way to my wallet it takes about a minute to get to my wallet um we'll kind of go over uh transactions on follow-up one in a second all right but with that you have metamask you have some t-fill and we're ready to move on and deploy some contracts on remix and I already have remix open so that's nice so once you come to remix You Know Remix is an online IDE integrated developer environment basically uh just a quick and easy way uh for devs to test and interact with smart contracts um some people use it for the whole Dev flow um we'll go over some hard hat a bit more complex tool later but for now um we're gonna go and remix and you'll see on the left here we have a little file explorer and you'll you should get some pre-built smart contracts storaged outsole but I've imported these smart contracts uh simple coin is one of them and you can see it here right and all simple coin does is uh it's a very simple coin it takes the Constructor you can pass in a value for the tokens you want to be minted and it will mint it to whoever deployed this contract onto the fevm and we just have a function to send that coin to other addresses and get our functions to get the amount of token held by a specific address right so we're going to come to the compiler tab click compile simplecoin.soul and um everything is good I have Auto compile turned on to make my life easier and we'll go to the deploy tab right you're going to want to make sure that injected provider metamask is chosen when you come in it will default to remix VM that is a local VM within metamask and it doesn't interact with any blockchain anywhere just this like a virtualized chain on your browser injected provider metamask will tell it to send all transactions through metamask and because my metamask is pointed to hyperspace it um it is gonna go to hyperspace and it looks like I got my five key fail I didn't so that's awesome right so then you're going to want to make sure that the contract you're pointing to is the one you want to deploy or you want to deploy simple coin and we're gonna put in the Constructor since that has to be filled out before we deploy it to 1200 tokens that's how many I'm going to Mint uh for simple coin and they will be assigned to me again if I click deploy we'll see metamask comes up with a transaction it's going to estimate gas fees we're going to click confirm so if you're used to gas on ethereum gas on file coin is actually calculated a bit different and it does use file coin gas and not uh the traditional evm gas so the gas calculations you can find more detail in The Docks but they're based on wasm time run times for all these computations um as opposed to the hard coded gas values that you'll find in most ethereum run times right and so that's going to take about a minute to deploy it's going to take some time uh so I have a pre-deployed contract we can look at well that goes through so you can load any contract right here as long as you have the ABI and uh the address is deployed at which remix has API since we have the contract in here and we'll just click add address and it turns out my contract deployed at the same time so that's convenient we'll just go ahead and look at the contract we just deployed all right so if I copy and paste my account in here and click balances cool so I have a thousand two hundred a thousand two hundred I meant it to myself to initiate this token and um yeah so that's simple corn right so this is just basic um solidity um working on the follow coin EV but now I know that that's cool um but why uh evm on file right there's a million other evm chains out there and remember the history of filecoin is that it was designed um primarily for decentralized storage storing the internet's data and I find that this is a very important part of the web 3 stack right a lot of front ends for web3 dapps are actually hosted on centralized servers um and so filecoin is kind of there for Cold Storage right which is a very important um like sector right so we don't have to trust on any like one centralized entity right and so the Falcon blockchain actually um monitors the storage deals right the metadata um for these uh for for the storage providers right and so how can you access these storage deals you can do them through these file coins solidity libraries created by our friends um with the team zondex right so let's take a look at them right here and what I'm about to go into some more detail about uh storage deals in a second right so you know these are basically solidity apis you can't use these on any other chain because these are specifically for the fevm and they take again take advantage of um these native actors we call them uh for interacting with storage deals it is in beta at the moment is being audited as we speak it should be uh ready very soon but I just need to put that disclaimer and yeah you see the readme kind of explains some things if we look in the contracts directory you'll see here we have apis that these represent apis that were already open to filecoin but this opens them up to be used in solidity so if we look at the market API solidity contract um this actually opens uh apis like a bunch of apis for getting information about a specific deal on chain getting um the actual pcid getting the client who asked for the deal getting the provider the address of the provider who's storing the deal and um so on right so these these really uh using these in your adapts really opens up the world of the fevm when compared to other evm chains hey Zach uh when you're um in remix can you zoom in a little bit as well oh yeah sure yeah right no problem uh I'll make sure to do that when we go to the next contract okay yeah appreciate that um cool so uh I'm mentioning these deals right so let's talk a little bit more about them and how they're created in the past and how we're going to create them later on in the demo right so if we go to Phil Fox uh which is um a block Explorer for file coin you can click on the blockchain tab here and click on data list right and these are actually these are actual storage deals on chain if we click on one this deal ID right here you have the provider these are usually minors on the file coin Network and their address their ID and you have the client right the address of whoever requested data to be stored right um the data that are stored here and this deal is 32 gigabytes um and you can see when it was stored and the pcid AKA basically you can think of it as the root hash of the data that's stored there right so we're going to talk a little bit more about that that root hash uh that I mentioned earlier right also known as the pcid or the com P right uh so you'll see this big graphic uh it may look confusing but it really isn't much essentially you take a file let's say it's at that cat photo that I showed earlier right and um you want to prepare it to be stored in a far core and storage down right well one of the first steps is you're going to turn it into a car file right a compressed version of the of the actual file and then you're going to want to compute uh what we call the ipld dag uh directed acyclic graph confusing it's just like a tree if you're familiar with like the inner workings of ethereum or Merkle tree or a binary hairstry that's essentially what it is um right so it's going to take that data it's gonna it's gonna take that file that compressed files kind of split it up into chunks and then it's going to Hash each of those trunks and then create a tree hash all the way up until you get your root hash and uh this allows you to get like the hash that represents the old data um and so that kind of just represents the um raw file or the raw compressed file we actually are gonna You're Gonna Wanna pad the file uh to make sure it fits and there's tools that do all of this we're going to use one later in the demo um with some zeros and essentially when you send this to a storage provider uh you're going to send this padded compressed file along with um the ipld graph or dag to the storage provider and they're going to confirm that you know your file does in fact uh hash to that pcid or that root root hash and that's going to be what represents your deal on chain right here right so long story short file we create this graph we get this piece of data that represents the file and that's what we send to the storage providers to store our files so this is how deal making uh works at the protocol level and how it worked uh specifically uh before the fem was a thing right um essentially you you the client or whoever wants to store the data would um the would decide what data you want to store you would use a tool of your choice to compress it and create that file that we talked about earlier um said look you would do some research on storage providers and what deals they're offering maybe you know a storage provider and you can negotiate with them either way say okay kind of find a deal that you think works uh you need to lock some funds at escrow so that the storage provider knows um you're willing to you have the funds to pay for the deal over time uh you send what's called a deal proposal to the storage provider right and uh the storage provider will look it over and make sure that that's what y'all negotiated or what they deem as a fair deal um the storage provider would then say okay this looks good uh we're ready to accept this and publish the deal so then you need to actually transfer the data to the storage provider right and uh all of these steps there were tools to do this there's marketplaces you can look uh to find storage providers but yeah this this is a quite a manual you know process there was also things like web3.
storage and nst.storage that do all of these steps for you and make it a lot easier um but yeah you would transfer the data over you know they would make that check to make sure the data is actually what the pcid that's in the deal and uh then they would call a function on the follow current apis called publish storage deal and that would actually you know uh prepare them for storing the data and so that's kind of the traditional way of making the deals and how everything will work uh with the fvm uh I know that was a lot of information so I'm gonna go ahead and check the chat to see if there's any questions uh about any of that before I move on so yeah if you have any questions feel free to drop them in the chat as we're going on and I'll try to uh make uh periodic checks like this yeah there was one question from harsh um uh how seven maynett would lead to burning Phil yeah so um file coin just like ethereum has a similar implementation uh for EIP 1559 so every transaction that's sent to the final coin blockchain uh some of that Phil is bright right and so with the follow coin virtual machine live you would expect more transactions to be coming through now because there's more utility and uh you know that probably increase the burn of of Phil yep and I see some feedback on zooming in we'll make sure to do that when we go back okay cool so I think that answers all the questions right now so yeah so uh we kind of talked about uh the traditional way to make deals you can still totally make deals that way by the way uh none of this deprecates that you know follow coin uh still works that way this is just adding on functionality and new ways to make deals using smart contracts right and so one of the first ways we demoed how to do this was what we call the bounty hunting Bounty Hunter method uh and there's a contract you'll see in my hard hat kit later that that does this um but essentially like it's just a smart contract where you take that pcid you know again that piece of data that represents it and the size of data you want to store and you just create a bounty and a smart contract for that right and so this is a very useful tool I would say for like Dows like maybe you're a decentralized science a d side Dow and do you want a crowdfund for a specific piece of data to be stored on the file coin Network you can use uh this flow to say hey this is the PC ID for the data this is the size of the data that we want stored uh less crowdfund uh and see who can actually get this data stored on chain for us and we'll reward them and it actually uses the file coin libraries to make sure that the payment is sent to whoever actually the address of whoever made the deal right so this is one way this is just kind of like hey please someone make my storage deal for me but this is what we're going to demo um and this uh later on is um an even more automated flow for missing a deal which um now like you know let's say I have uh some data I want to store I generate the car file and the dag and I want uh in part of my smart contract flow I want to be able to call a method to store this uh this data right and so we can actually call the function in solidity as long as it admits that event I talk about I talked about earlier create deal proposal boost storage providers can listen for that event to be emitted from the evm and read the data from it and use that as the deal proposal right and actually store your data from that you know so we're going to tell them hey we have this already pre-prepared data and a server somewhere uh here is like a deal proposal here's how much I'm willing to pay here's you know the collateral um here's how much collateral I expect from you and how much is it all going to cost uh per block and send that into a function in our smart contract that a function didn't emits an event the Boost storage providers use that event and says hey uh uh that looks like a fair deal takes it up and stores your data right and a core thing I do want to point out here is that when the storage providers actually store your data they are writing proofs to the file corn blockchain that they are storing your data like that's super important right that's how that how we keep this all decentralized is that we're not just trusting the storage providers to keep your data you know live they actually have to provide proofs in specific windows and if they don't they risk getting slashed so we're going to first go through um a demo and remix again using the file coin uh example contract I call the filecoin Market consumer it just uses that uh zondax file coins literally library and gets data for a specific deal on hyperspace right it's all the same things we're just gonna go here back to remix and I'll zoom in hopefully that is better and we're not going to do a simple coin we're going to come back here and we're going to do this filecoin Market consumer right really basic contract we just have a bunch of State variables and a bunch of functions uh to call those getter functions and the Market API for the zondacks right so we're just calling all these getter functions and storing the data um in our smart contract in the estate variables here right and then I have one function that calls all of these menu functions store all so um yeah I see a question for uh repos with showcase to follow coin storage deals working yep we're gonna get to it right after this demo um so yeah we're just going to compile it you know here we are calling the zondex libraries and just like everything else make sure it's injected provider metamask up here it's important to file coin Market consumer you can hit deploy again to save us some time I'm going to pull in a pre-deployed contract so we don't have to wait for the transactions to go through oh not that way let's see here throw this right there all right so if we go to Phil Fox we're going to go back to the main fill Fox page uh we're on mainnet right now and we're actually working on hyperspace so we're going to switch the network exploding 2 to hyperspace and let's pick a deal we want to pull information on right so let's just get information for deal ID 1011. and uh go to remix you know you can store deal 1011 like store all we'll confirm our metamask transaction go through again you know we are paying gas fees it is going through with that yeah EIP 1559 like uh structure or some other fees are getting burned um but yeah um this should update with our information uh for that specific deal if we look here um we actually have this old deal with old information in it uh since this is a pre-deployed contract um and when this transaction goes through we'll come in and we can see that like hey this deal uh matched with that but it's going to take some time for the transaction to go through so actually why transactions take time on the file coin blockchain is because there's what's called a delayed execution model where it takes about 30 seconds for your transaction to be actually included in the chain and uh another 30 trans 30 seconds for your transaction to actually be executed right um and yeah so that's why it takes about a minute on average so our transaction has gone through and let's look at some of the information here right um so our size is 262 let's look at uh here yep so 256 kilobytes uh that's about where we're at on there um and this is actually that PC ID but serialized and represented as ethereum bytes right so if we convert it to the representation CID representation which leaves the base64. um it can be represented as a CID that we see on chain um you know the price per epic which is zero since it's on test net uh the deal provider actor ID 1036 uh which is their deal ID right there right so we got the information from that deal in our smart contract and you can use this to create all kinds of cool logic um you know other applications that uh you may have heard earlier like uh data dials or Perpetual storage contracts um all kinds of things we're excited about to be built right Okay so now we're going to move on to the new cool part right and we're going to actually create storage deals uh with that method I talked about earlier uh on hyperspace and we're going to do it uh via hard hat right so you can find this Nifty hard hat starter kits under the file a corn project GitHub right and here you'll see if we go into contracts you'll see the basic solidity examples there's a simple coin we deployed earlier you'll see uh the Bounty contract I talked about in the market consumer we just interacted with but we're actually going to be dealing with basic deal client today and deal client.soles specifically right so let's go ahead and we're going to clone this repo we'll try to get this got to minimize this so we're going to go into a terminal right you see I already have another repo open here but we're just going to walk through this real quick we're gonna do get Chloe and we're going to paste in that repo name make it big so it's easier to read enter that's going to clone it in there I'm going to type in code I have the vs code shortcut that'll automatically open this nvs code we don't need to update right now oh I'm actually One Directory up right so let's CD into the fdmr that kit and now we'll open it from we'll open it from there and I'm goofing with my typing abilities right now there we go all right cool uh we'll open a terminal in here right and one of the first things you're going to want to do is type in yarn to download packages right and this will get all the packages that we need into our project and um while that's going on we'll just kind of talk about how this works right so again just like I showed you in the repo we have all of those uh contracts including the deal client.
soul um contract and uh it's going to give us some problems just because uh so download the yarn but it's fine we have a deploy script right here that deploys each of our contracts and we have very importantly here tasks right and these tasks are how we can interact with our deployed some more contracts are on chain um so if we go to for instance the market consumer we have a task that calls that store all function right and sends it on chain um but the what we're going to focus on here is we're going to go back to deal client that's all and we're actually going to focus on calling this function make a deal proposal right so it takes in this struct called deal and you know stores a bunch of information on chain does a lot of stuff but the most important thing is it amidst this event deal proposal create right um and that's the event that uh storage providers know to look out for and if you want to see that struct here's our deal request we're going to pass in a pcid a piece size is the deal verified on fill Plus the label which is uh usually the raw um the raw CID before we do any padding or anything to the car file when we want the deal to actually start the Epic we wanted to start when the deal will end how much we're going to pay per Epic the collateral that the provider puts up in case they need to be slashed um the collateral the client puts up are you the client puts up uh to prove to the provider that you can continuously pay them for their services and um these extra params here are where some interesting magic happens right so this is what we're saying uh you know the the booth storage provider sees that there is um an event committed emitted in ethereum and um that they want and they say okay this this uh proposal looks good I want to store that data but they need to retrieve that data from somewhere right so we need to have that in some kind of open server um somewhere else right um so yeah see there's still some maybe issues with reading it so hopefully this makes it a little bit more clear um yeah so that's kind of what we're doing here we're giving them like an HTTP ref or ipfs reference and the size of the file that they're actually going to store right um and then to deploy you just type in yarn hard hat deploy in the console hit enter and I'll run it run the script and actually start deploying our contract oh course one specific thing I missed here is we need to add our private key and a DOT EMV file right so you're actually going to want to create a DOT EMV and then put your wallet private key in there so um Hard Hat knows what wallet to send this transaction with right um and you can do that by going into metamask and again I always have to put this disclaimer never ever show you a private key to anyone and never ever check this into git if someone gets your private key and you have mainnet funds in that wallet that they can and most likely will steal the funds right this is a dummy account I use just for demos so there's no real money associated with this and I want to show you the steps uh but again um you know this is not advised to ever be shown right so you're going to go here you're going to type in our password and metamask and we're going to copy our private key over please uh don't don't steal my my poor test that fill they just type in private key private key put it in some quotes paste save now we'll type in yarn part head deploy and our deploy script will start and start deploying our it's going to compile our solidity files and it's going to start deploying them right um we're not going to wait and that's why I have my other demo open we're just going to go ahead and close that we're going to go to the the pre-deployed one which real quick all right go ahead and open this all right so in this in this uh repo we've already deployed the contracts uh everything is good there um you know we've done the yarn I have the dot EMV file um and so we're almost ready um to call the method the last thing we need to do here is we need to take a file and we need to um we need to generate that car file and we need to store it somewhere right um so let me make sure this is big maybe that's not too big uh so what we're gonna do let's see do I have my Explorer open here all right so if I just go to my pictures right here you'll see I have my tab photo he attack dot jpeg as opposed to he sleep um and so that's the the file we're going to turn into a car file right and how we're going to do this is we're going to use this tools uh go generate car uh tool right here right so if I see any into tools and I see D into go generate car um you can type make I've already made it this will compile it this tool is written in go hopefully we'll write this tool in JavaScript so it'll be a little bit more native to hard hat but for now it's written in go um so make will actually compile the program and we can call it uh from this uh directory right so if we what we're gonna do is we're going to um and just to save time I'm going to put the script in here uh we're going to call in this directory generate car uh we're just gonna say hey it's a single file and this is where the file is right and see attack.jpg and this will actually generate the car file right and and the IPL dag that goes with it so if I hit enter you'll see we have all these cids are generated uh the very important one we need is right here under data CID we have pcid right so that is the CID of the file that we're going to store and that's the pcid that we're going to use to represent this to the storage providers now if I uh LS you'll see here this is that cid.car and this is the size of the file we're going to store right so we've generated the car file now uh we know the size of the car file we want to actually uh put this somewhere that the storage provider can store right um this could be anywhere right this could be any open um service but uh an easy one we're going to go to today is web3. storage all right so we're just going to type in web3 dot storage right and I already have my logged in and we're going to click Start now and here you can just uh upload uh upload files and you know web3. storage will actually go through that traditional deal making flow and make deals for you uh but what we're actually using this for is they actually just store your data and their ipfs Gateway and anyone can kind of pull it up that way right and so that's what we're going to use right so um you know I've uploaded the raw file here but here is that generated car file I click on the CID will come up right here um and this will pull up like the the Gateway for it on on ipfs right here and that's actually what we're going to pass through and use as the URL uh signal to our storage provider we want to store this file okay so all of that said we now have our files stored in a server somewhere or ipfs or wherever that the Boost storage provider can look for we're ready to call that function make deal proposal pass in all of our deal information and see it hopefully if the storage provider picks it up right so we're going to go back out to the main art hat kit directory here and we're going to call this task make get deal proposal you see there's a lot of parameters it takes in and so I've actually this is one we're going to copy and paste into the terminal um foreign I can just show you because I have it in a Google doc right here right um so um this is the task we're running so yard hard hat uh tells it okay and then make deal proposals the name of the task and we're pointing it at this contract I've pre-deployed and uh we're giving it that pcid of the data that we have stored uh the size of the data um you know the verified deal uh is false and we're passing in all this information in and where it can actually find the data to store so that's the actual full task I'm running we'll hit enter and this is going to take a second to go through again you know it's making the deal proposal Network hyperspace I'm going to look at something cool because I'm actually um SSH into a um boost storage provider right and so hopefully we can see it pick it up live right um so here is a GUI for the Boost storage provider and uh hopefully once the Steeler goes through uh once the transaction goes through we'll actually see a new deal added on here uh that the deal proposal picks up the the storage provider picks up so we'll just give this a second to go through um you know we can kind of look here at uh the GUI for the Boost storage provider so boost is just a um kind of uh helper binary you can run the storage providers typically run to make it easy to deal with storage deals and visualize them uh with this convenient GUI so they usually run alongside a file coin node like a Lotus node right um so yeah so this task is going to go through um you know it passes everything in um and then actually listens for the event right and boom you see our transaction went through it emitted the event and right here the storage provider has seen that event and it's actually pulling in the data right uh it's saying transfer installed uh that may be because of like a HTTP Gateway um and we'll try to redo that right um and boom there we go so it's transferred the data you know it's made all the checks that the pcid matches the file and it's saying hey this deal is good to go everything looks good and we're ready to publish the storage deal so after that um you know if I was you know this SP I can just come here and click publish now and um you know it's going to publish that deal on chain for me and of course this SPS probably have automated systems to do this this is just a very automate uh manual way to demo how this works right and uh again that data they're storing is that picture of my cat right um all done through some more contracts uh so I'm very excited about this you know if I click on the deal here um you'll see that the client address is like a file coin client address a T4 address right um but if we actually copy this well it's not actually gonna we'll just open it up um and we'll copy it right here we copy this and you go to like uh a translator tool there is one in the hard hat kit uh script Milwaukee translate addresses for you you type it right here uh no because it's just converting maybe I'll just put it in here oh and we need to put it on hyperspace that's the issue here so if we do that um you will see that this is the youth address of the contract that we um admitted so if you the contract itself as the client of the event right and you know we can also look up this contract on Phil Fox on hyperspace we could put in the ethereum address or the T4 address either one works see it's going to say actor evm and it's going to show um these uh this is the transaction we made with a big deal proposal and amidst uh the events we admitted right and so yeah this is the full workflow this is how you create storage deals on filecoin um and I'm going to blast you with a bunch of resources now before I save a couple of minutes uh for Q a right so let me see here um again here is the hard hat starter kit if you missed it um you can find it in the GitHub uh for the fall corn project fpvm hard hat kit um and as you go within hard hat kit you'll actually see if you scroll all the way down I link to uh Foundry kits for each of the the client contract and the Bounty contract that's where they're being developed currently um under the Lotus project we are going to kind of bring all of this together uh but if you are like kind of privy to Foundry you can you can deal you can look at these and they have a little bit more technical detailed readmies um and I also want to shout out a Community Driven Foundry starter kit right so um a great Community member very active uh shinhan um developed this uh Foundry kit right here and he is very active Community member he's active on the East Global Discord as uh at Peep and you know uh yeah I'm just like uh super proud that this is uh getting made uh he's updating it constantly uh very knowledgeable Community member and uh yeah you know we're gonna work on getting this uh you know completely up to par this will probably become the official Foundry starter kit that we um push everyone to so uh thank you very much for such an awesome job job and my colleagues Matt and Sarah are actually doing uh twitch streams now uh twitch.
tv slash Phil Builders uh the next two streams will be March 16th and 23rd um at 9 00 am PST 12 p.m EST 5 PM ugc right so feel free to go jump on those streams ask questions you'll find me there for some of the streams for sure um but uh you know we're excited to launch these these twitch streams um there is a request for startups out so if you are a startup and you think you want some support um some uh uh kind of maybe some grant funding or or just seeing what's going on with mainnet uh feel free to come over here to the request for startup so rfs.fvm.dev and finally all of this was done on hyperspace testnet but this will be launched uh March 14th next week we are super excited on Pi Day of course we are all nerds over here and we love it so um you can watch uh the event for the fvm mainnet launch on the final coin YouTube um and please go there subscribe wait it'll be a big deal and finally for everything else uh my colleague Sarah has made this awesome link tree um that just has a bunch of other resources on it um you know an about page uh the docs uh this hackathon cheat sheet is really convenient if you're um going to be on the hackathon it really combines all of these resources um that we've talked about it's uh you know up to date now and yeah super useful um uh resource and finally we have our mainnet cohort uh which you can apply for as well which is just a combination of teams that are all looking to deploy to mainnet and are ready to go and become active uh members of the filecoin evm launch so thank you so much uh for listening to my talk uh looks like I have just a couple of minutes to address any questions in the chat and I see there are some so I will try to answer them yeah one of the first ones was uh were there any libraries other than go for creating car files there may be I think there might be a JavaScript library out there somewhere I'm not sure if it's up to date and how well it works uh right now we're using this but we are working on making uh uh more libraries and we're actually working on with uh the community to make a front end that will do all of this for you right so um just a convenient uh web app where you can go in upload a file and generate the car the dag everything store somewhere that storage providers can take up um that'll be all done in the browser so we are definitely looking forward to and William asked what is the difference between the pcid and the CID when you uh you get when you upload the file to ipfs yeah that's that's a great question so the ipfs CID is actually just kind of the raw called the com D CID where you just take the file turn it into uh you know uh you generate the IPL dag for it and you generate that the pcid is very specific since storage providers want these specific uh formats so we turn it into a DOT car file we do that padding and then that's the ID that we get is the PC ID right so it's just a very specific CID but they look identical right um and if you were to put that car file with the padding and everything on ipfs uh I believe that might be the same CID that you would get but uh don't call me with it for me okay uh harsh asked uh how to access the data once stored like via ipfs only yeah so uh the retrievability side of things um there's a lot of cool projects working on that uh you can go to the uh I believe it's the Lotus stocks um as a section on retrievability um on here you can also um use and service like file coin Saturn which is new um so this is basically a I don't think this works with file coin like it works at ipfs but now follicle just yet but it is working so this is a CDN um that like caches ipfs um uh requests and make some super available anyone come on a node you can go to saturn.network and they are working on being compatible with file coin as well to make um you know data available on file coin uh retrievable right so there's a lot of options um you know search on file coin retrievability um and it's being made easier every day and uh what are the key advantages over ipfs Stephen asked that fantastic question so uh ipfs you know is its own uh peer-to-peer Network for file sharing I can pin data on ipfs I do all the time and it's there but there's no guarantees that your data on ipfs will stay there right like if someone if everyone stops paying that data it's gone right and someone could always repent but there's no guarantees right uh file coin we have very strong guarantees that the data will still be stored because the storage providers have to provide those proofs on chain uh that they have it or else they risk slashing so they're directly incentivized to keep your data right so file coin is really used for like cold storage of data data that you want very strong guarantees will be stored uh and available awesome okay and that was all the questions in the chat awesome a little bit over so uh yeah so thank you uh for joining us today uh everybody and thanks Zach for the great presentation I'm gonna drop in the uh does the Discord the falcoin Discord Channel if anybody else has any other questions feel free to reach out there um and thanks so much for for having us uh this was this was awesome so I hope I hope all of you found it helpful feel free to reach out to us um on the follow-up on slack on the global Discord um and anywhere we can be found and we'll try to reply and uh Happy hacking cheers thank you
Automatic transcript — names and jargon may be misspelled.