New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

OP Labs 🛠 Launching an OP Stack chain in 30 mins or I shave my head live on camera

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Kelvin Fichter from OP Labs for a talk titled "Launching an OP Stack chain in 30 mins or I shave my head live on camera". 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] and welcome to the op Labs Workshop launching an OP stack chain in 30 minutes where I shave my head live on camera joining us today is Kelvin Victor who will be taking us through this session and with that I will pass it over to Kelvin to get the session started all right hello everybody I'm sitting on the floor right now which is very bad my back but what can you do so such is life when you don't have a desk uh visit it's about running an empty stack scene in 30 minutes or I'd shave my headline on camera unfortunately I don't have a reason with me so if I can't make it in 30 minutes I'll have to do the the streaming at another time but I will do it live on camera so I'm going to start a stopwatch oh God okay let's go so essentially what I'm going to do is I went to staff.optimalism.io and then sorry I didn't forgot to introduce myself I'm Kelvin I work for op Labs doing a lot of different things but today I'll be running over the process of running an OP station which is really really easy now so essentially what we're going to do is watch Roman roll up in 30 minutes and do simply breathe with me and then later on go and modify it um if you go to the openstack docs so stack.optimism.io and scroll down to building openstack robots going to be getting started you can follow along but I'm basically just going to follow this tutorial and show you what I'm doing uh so let's get a move on I've opened up a new folder called demo for the sake of this and I'm just going to start running so first thing you do is watched the watch or did I clone the Opera written modern post that's where a lot of the code lives pretty much everything except for gift lives in the monetary book and then we're just gonna go at edit and install dependencies and then we're going to build a whole bunch of pads um install ID dependencies and building packages says a little bit of time so once we start building the packages we can go ahead and move on to voting and building op get which is the execution client the default execution client for the ufd stack so if you are familiar with the architecture uh uh the ethereum node eco mode system these days there are two components there's a consensus client and an execution client and the openstack with optimism and all the Roll-Ups I've based that are based on the op stack also use the same split so we will be running both those components as part of this tutorial first thing first I'm going to start building the Monterey boat in the meantime I'm going to go ahead and Wang will not yes and building open gets at the same time so yeah like I was saying there's there's two components uh the consensus client and the execution by the execution clients called opgeta it's at the very minimal debt on the top of Upstream debt represented right now it's a single commitment here you go I'm just building yet this is how do we build Gap if you're building a normal GIF you just run me to guess I listen usually pretty fast so I'm just going to take a second and then once that's done we're gonna go actually go so back into model repo it's still building a whole bunch of things uh building a whole bunch of different components but again the most important thing that we're going to build is this thing I'll be both P node which is our consensus client so in the Maze rhyme he needs to hurt her you know what the head and what we're going to do we're going to generate some private keys so as part of this tutorial uh there are four key actors in the system that we want to generate keys for there's an admin account which has the ability to upgrade contract within the system a bachelor account which publishes a specific search for that particular statements with the trim back medium publishes it to our L1 uh there is the Ozark app which publishes transaction results to the L1 and the sequencer account we're going to sign blocks on the L2 so that if we wanted to run more than one node we could run that and we will connect over peer-to-peer Network and distribute blocks uh quickly over the Jitter peer Network so the first thing that we're going to do in a second once this builds is we're going to create a whole bunch of these Keys using the Reiki man because I'm gonna eat these Keys private I'm just going to go over to uh my other window here and and where are we here we are and in a window that you can't see I'm going to run this demand so all it's going to do is what was it's going to do exactly what you can see on screen it's going to generate these keys and that's also going to generate a monitor oh my start BP okay um so be about a second to finish build all the name if I can't make it in 30 minutes I blame I blame Gurley I almost learned my lesson and it didn't do this on girly this time but then I got lazy and I decided to do another lead yet so my guess is that the most annoying thing will be deploying smart contracts together but we'll find out so it is almost on building on either that or the build process let me okay good we're done so in another terminal which you can't see probably again oops I'm going to run the npx art at the key commands uh we have added and it's just going to generate these so if you can't see this I can see this but I I now have an output that looks like this and in a minute I'm going to fund some of these to eat something now I'm going cheating noodle for a reading I'm going to go and configure the network so right now network configuration happens inside of the contracts Bedrock package so there's this folder called deploy prom frame inside of packages contract Bedrock one of the top physically in the opposite honorable and this is never pulled getting started in this sort of setup for you to fill in so that you can go and and run your own chain so it's got these things that you need to fill in here and what I'm going to do now is I'm going to run this command down here that will give me some information about a recently finalized Burley block which I can then use to uh to set the starting block for my rollout so the roll up can start at any point or a hashing number it started at any point and start saving from any point but we really really just want to find some block that we can use it for starting a coin so I'm just using the latest finalized block on girl lives and started acquaintances you can see that at the half the number next I'm going to throw out the three the remainder of the pre-populated config so I'm going to State the hash divided let's generate it I'm going to paste that in where it says L1 starting block tag let's go the network is going to start and I'm going to take my uh timestamp and I'm going to insert that as need starting timestamp up here then and the rest of this is just filling out some addresses so I'm going to copy the nation by other terminal where I generated those addresses and basically just wherever the adminating still in my admin app is not what we're supposed to say admin I mean hey sensitive there we go the whether it's an adminton yeah I did that right yes and I'm uh wherever it says proposer oops I might fill in my what was their address that's the second one where it says Batcher I'm going to insert my that's not maybe that's your address I don't even need to find or place something one and wherever it says sequencer I'm gonna insert my address well that was really easy and that's the whole thing so the next thing I mean it is I'm going to deploy the L1 smart contract so I'm just configured the network I need to deploy the other one smart contracts so the very next thing to do is to build into contract bedrock and create a DOT BNB file so there's this example.

enb file I'm going to copy and I'm going to paste it rename that just dot Envy and I'm going to sell put in my L1 RPC which I was carrying from Alchemy and I'm going to sell in my employer private fee I'm gonna have high Advantage employer for it keep artseed on steel only hear me beat now that apparently even so so expensive um and I'm also going to get rid of this tender and stuff so you only really need those two first days the next thing I'm going to do is I'm going to send some girly eat over to my t or to my deployer address so that I can then actually paid each of this if it ever decides the load and this is going to be the death end it's going to be the part where I can't send it early come on frame yes okay so I'm going to send my girly ease I'm going to send my unsolved why not why do you follow the religious what's that like three thousand dollars now who knows all right sending that boom okay so my account should now add 20 girly eat that's great oh did I just send I just sent it to myself oh no okay now I need to send it again and just send myself 20 Berlin it doesn't make any sense come on now I'm sweating it might be because my heater is on too high but I'm sweating oh boy oh no okay I got 20 minutes left oh no okay well in the meantime I'm gonna start deploying this bar contract so we are going to all you need to do is end mix for bad boy and network yeah they can start it so now my couch is out of the ethernet and then I'm just going to start to play so this is the slow card but the whole process that basically just deploying these Contour sticks while I'm really early oh it's usually fine but it's uh it's not the fastest networks are deployed to it looks like all right it looks like we're going I'm gonna keep an eye on like really deep account to make sure that I'm not running out of money because you never know when your account but it looks like it's going so this is just going to go into boil a whole bunch of spark contracts with makeup the L1 on the side of the system uh those smart contracts are things like the bridge smart contracts uh the uh contracts that configure the network so there's something called the system config contract and that is sort of a way to manage the L3 system on ld1 so can you make a change to that contract on L1 the system will actually upgrade sort of automatic neural detective change and change automatically there's there's a core British contracts but user land bridge contrast and then there's the erc20 and uh ERC 721 Bridge contracts which sit on top of all of that and so a lot of these things sit behind proxies so that they can be upgraded and so as a result you can see that we're we're deploying a whole bunch of proxins first then we're going to go ahead and deploy a whole bunch of uh implementation and then we use this cool contract called the system dictator which handles upgrading all of the smart contracts at the same time and initialize the system in the series upstairs so yeah so at this point all we need to do is wait it's pretty uh pretty insane luckily it looks like early eat is cheap right now or girly gas is cheap right now so I'm not burning it through eat but I can show you what we're about to do next so once all these smart contracts deployed I mean at this point it's going to look at identical to the system will that runs optimism as if it brought on the base so everyone bids the same smart contracts there's some Legacy stuff in there as well uh but the point is that by making the system uniform everybody gets the same box to play with so okay what's next well like I said we generate person we need to run these two components the op node and the uh oh and op yeah so the first thing that's necessary is to run a whole bunch of or not a whole bunch of things just a couple of scripts here to generate some config files and those contract file order based on the deployments that we generate so we're going to need to wait before we can do that once we generate the config files we also need to generate a Json web token that is used to interact between Opie guests and the OK node this is the exact same system that's used uh for the in census client and execution client then we're going to take so from those conflict files we're going to copy them over to go keep get where we're going to create a data directory and we're going to load the sequencer key and we're going to import the sequencer key and initialize get like I said we're going to run a we're going to try to run a full roll up here so we need we need to see sequencer so that's why to generate that sequencer P2P key earlier but essentially you only need one sequencer node for Network so we're just going to run one I'm not going to have time to run a second node but you could also just run effective mode and connect to the sequencer over the future network and receive blocks right away so we're almost ready in here it's still deploying a whole bunch of contract instance the unfortunate thing about the way that we do our deployments right now is it takes quite a bit of time so you can play everything but what we do it's just how it goes but luckily this time we are not running it well in the means I found I'll talk about AMD with all this so right now we're going to be running a standard roll up right we're going to be running a uh a thing that looks exactly like off to the main net and it's got all these default configurations but you can tweak the configuration quite a bit you take a look at to get it started we can treat paintings like block time right so you wanted one second walks on else on your roll up or if you wanted 10 second box it'll be rolled up and Tweet back there and there's also stuff like the finalization period just been saved your example of seconds uh which is one L1 log but if we get set at pretty much any number than there's things like the block gas movement that you can modify and uh and stuff just these parameters for essentially how much time a sequencer has in order to get data onto L one almost done here so the other thing that we can talk about later on that if you have time is that you can also modify the the know and software itself to do some really cool things so inside of this example we're inside of the dogs if you head over to the op stack fax uh sample hack so the adding attributes to the derivation function add in the creek and file you can actually see example Paths of how to modify the op node or the L2 to like the the op GIF node to do the thing was like the example that we give for modified review node is automatically tracking the L1 burn the Casper and on L2 into all sorts of stuff you just track all sorts of things about different smart contracts have been pulled data you can put things into L2 whenever there's a specific event on L1 and you can do all sorts of things and then of course you can just like add a pre-compiled yeah which lets you you know take expensive common computations that make them cheaper so now we're near the end of the deployment process uh you can see here that we had basically transferred control over to vibration system the executive error and it's essentially just executing a series of steps comparing the system getting everything ready to deploy my real networks and then we're going to be able to run an hour watching and so hopefully nobody has Erica leaping on develop and this deployment is going to work with no problems otherwise I would be shading but I guess we'll find out okay one finalizing deployment uh oh manually whale what count is visible this is Mike Gurley whale account visible now oh how do I make it hide I just want to go away so I can see the screening all right brain what are you doing oh oh no I did oh my gosh my screen is further I didn't expect but the death of me would be that my computer would trash oh my God oh no oh this is bad okay um hello I think frame did this to me no I think his name did it today uh oh Mal okay not like this not like redis wow my God oh no not like this we we need to start working well that's not our Oregon all right all right I don't know I don't know what to do I'm gonna have to restart my computer wait oh my God I'm back everything is flashing it's frame I'm blaming frame quit please no no okay oh God all right this is terrible I need to I need to find but I need to get a terminal come on let me have a terminal okay wait what's I I need someone in the chat my my screen is just Frozen and anyone hear me am I just talking to myself I'm very confused uh I think my wallet software just were to go hey Kelvin yeah I'm here I don't know what's happening oh man I'm trying to open up one terminal so I can kill the my wallet a cowboy everything is said okay what's the command to open up a terminal I need someone in the chat to tell me the command to open up a journal without it without any control over the rest of my screen say can anybody help them there is a command to this that I never remember take screenshot whatever now all right all right all right now Secrets there in two minutes okay so I got a bit of a little tin of it okay we're in the opino they have to make the jettison's con clear come on make the Genesis kind of big I'm just gonna can you do this weekend all right we're almost there okay we're gonna do this oops come on go generate with the planet oh I didn't needed to focusing quotes I guess all the way this is not going very well and then I'm going to shave my head okay what is this what's going on I don't understand listen word this is bad I don't know why it's not working now I blend whoever wrote this out of it not what this ad but it oh it's Brian is in here and it's using the comedic LOL that explains it okay come on come on jwtwoon spiral got the legitimate teacher okay there's no cost all right yeah uh everybody not a challenge to me now all right totally passing in the data directory but uh private data directly where is my other mirror committed and all right put a private key to the knot at the right period in order to come on import the key initialize yourself properly all right it's initialize uh blend get it run get in water I don't know what happened on that you just run bopper League it's running okay Gap is running depth is running we're almost done we're soaked boss um now I just had to run the op now that that's it that's it this thing in the sequence are key in here and the l1rpc and and we're on our PC and it's an Alchemy key and and come on it's running okay we're not gonna get it it's running okay so essentially all that's happening here is that it's it's catching up to to the ingurney to the L1 uh that really like epistan but IO and it is a couple hundred blocks behind so it'll take a minute to catch up but essentially this is just running sequence and now so the sequence started running and the only thing left is to start posting transaction data tell why not uh which we could do but I don't know if we have much time to do that and uh me in my map I can give it a shot I'm curious see I don't understand why not why not why not just do this run this and uh you know what for the sake of title and sand keys and sequencer key I don't know if it's going to break anything but to be honest I don't have time to do anything else other than that run the badger get the private Jeep and see if and sir put that in there and then start running the bachelor okay so we started running the badger and essentially now we go over to early media uh we should start to see if the bachelor decides to start producing locks which is going to happen in a second is we're almost at the tip of the chain so you can see the tip of the chain is that blocked really blocked 435 this is at 425 so in just a second the sequence is going to start losing watts and then we're going to start sending those blocks off to L1 so build on the sequence started producing blocks because it got to the tip it's right now it's filling in the blocks with empty empty blocks because if you didn't produce any transactions so it's instead of doing that and then after it's done it's going to start producing bottom block every two seconds like clock quarter you can see here the Batcher is starting to add those walks to its local state but on the batch was starting to submit transactions and so if we head over to the batch address which is at fed or between 69. you can see that three seconds ago The Bash submitter started submitting addresses and we now have a fully functional roll up uh I don't know how much time that took in total I over bless the very best total on over the issued by n but even even in a chaotic situation see that both be stabbed and so good that under correct during the chaotic situation you could restart a computer or have calculate it when it's difficult to do it in 30 minutes so there you have it that's a roll-up I can expose this thing to the internet um and people can start contacting on it but I probably won't do that yet but if you know I don't know if you're interested in doing that let me know or at concessions and tests in it but this is a fully logical roll up we had if it's node and I couldn't start sending transactions to it and I'll start doing stuff so um yeah so there we are that's that's finished simply it that's the whole thing hopefully that was 30 minutes I don't know who knows all right I'm not sure let's see we'll see you in that honest we are um we did it we had a question though um okay it does this process work on supply network as well what changes need to be done if so um this process dubs work on every single Network the only committed you you will need to change is in the config just what the L1 chain ID is and you'll also need to uh in the department config specify a network or sicolia because it's not in here yet actually yeah so you'll see that there's this getting started Network so you'll just have to edit the chain ID to do this deployment but otherwise it will work exactly this name and you could do this on any network you need to run it on another roll-up if you wanted to do an L Street okay cool that was the only question um yeah I uh I don't know I think well since you said you don't have a razor I think you should you needed to shave it the next next reason all right thank you everybody we kind of made it I'll blame I blame frame for all my problems I'll have the same but frame logo into my head seriously Follow Me tutorial and then we'll get far and DM me if you need help cheers thank you Kelvin and thanks everybody for attending and uh I posted the Discord link to the optimism uh Channel as well in the chat if you have any other questions um but yeah this was this was fun Kelvin definitely appreciate it thank you thank you and thanks for everybody for sticking in there I think I could appreciate it cheers how's it going see ya

Automatic transcript — names and jargon may be misspelled.